Click here to Skip to main content
15,073,499 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I only have started to learn Action Script 3 and use Flex.
There is the code:
XML
<?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>



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!
Posted
Comments
Jardin1 27-May-13 10:53am
   
I found, problem is at id="time" and text="{time}"
Now, i have any error:
<mx:box backgroundcolor="#000000" cornerradius="8" borderstyle="solid" backgroundalpha="0.7">
<mx:label text="{time}" fontsize="28" color="#FFFFFF">

___________________
Severity and Description Path Resource Location Creation Time Id
Could not resolve <mx:box> to a component implementation.

How to fix it?

1 solution

Right code is:

XML
<?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!
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900