如何修复错误Flex? [英] Howto fix error Flex?
本文介绍了如何修复错误Flex?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是开始学习动作脚本3并使用Flex。
有代码:
I only have started to learn Action Script 3 and use Flex.
There is the code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
<mx:Script><![CDATA[
private var ticker:Timer;
[Bindable] private var time:String;
public function onStart():void
{
var currentTime:Date = new Date();
time = currentTime.toLocaleTimeString();
ticker = new Timer(1,1);
ticker.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerComplete);
ticker.start();
}
public function onTimerComplete(event:TimerEvent):void
{
onStart();
}
]]></mx:Script>
<mx:Panel x="218" y="68" width="250" height="200" layout="absolute">
<mx:Label x="10" y="10" id="time" text="{time}" color="#ffffff" fontsize="28" height="50" width="210"/>
</mx:Panel>
</mx:Application>
所以我在[Bindable] private var time:String;获取错误使用下一个内容:
严重性和描述路径资源位置创建时间ID
1151:命名空间内部的定义时间存在冲突。 LABA / src LABA.mxml第6行1369665834875 52
什么意思?如何解决?
感谢您的帮助!
So i get error at line [Bindable] private var time:String; with the next content:
Severity and Description Path Resource Location Creation Time Id
1151: A conflict exists with definition time in namespace internal. LABA/src LABA.mxml line 6 1369665834875 52
What is mean? How to fix it?
Thank you for help!
推荐答案
正确的代码是:
Right code is:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application layout="absolute" xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onStart()">
<mx:Script><![CDATA[
private var ticker:Timer;
[Bindable] private var time:String;
public function onStart():void
{
var currentTime:Date = new Date();
time = currentTime.toLocaleTimeString();
ticker = new Timer(1,1);
ticker.addEventListener(TimerEvent.TIMER_COMPLETE,onTimerComplete);
ticker.start();
}
public function onTimerComplete(event:TimerEvent):void
{
onStart();
}
]]></mx:Script>
<mx:Panel x="224" y="133" width="250" height="200" layout="absolute">
<mx:Label x="86" y="73" text="{time}"/>
</mx:Panel>
</mx:Application>
谢谢!
Thank you!
这篇关于如何修复错误Flex?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文