tigomark
12-03-2007, 06:54 PM
I have been working on a project and it is just been kicking my rear. Here it is in it's current rendition.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" viewSourceURL="srcview/index.html" height="100%"
initialize="getDaysUntil()" >
<mx:Style source="source.css"/>
<mx:Image source="@Embed('../images/title.jpg')" width="210" height="65" top="4" left="15"/>
<mx:Image source="@Embed('../images/title1.jpg')" id="image1" horizontalAlign="right" verticalAlign="top" right="0" scaleContent="true" y="0"/>
<mx:XML id="tempXML" source="http://mysite.net/interface.php?username=admin&password=pass&custome r=63&action=showopen&operation=defects&format=xml& critcal=both" />
<mx:TileList
dataProvider="{tempXML.defect.asset}"
width="100%" backgroundColor="#000000" color="#ff0000" fontSize="27" borderColor="#000000" columnWidth="300" rowHeight="50" themeColor="#808080" fontWeight="bold" allowMultipleSelection="true" height="496" verticalCenter="28" horizontalCenter="-1"/>
<mx:XMLListCollection id="defectXMLList" source="{tempXML.defect}" />
<mx:Script>
<![CDATA[
private function getDaysUntil():void {
// creates a new five-minute Timer
var minuteTimer:Timer = new Timer(1000, 300);
// designates listeners for the interval and completion events
minuteTimer.addEventListener(TimerEvent.TIMER, onTick);
minuteTimer.addEventListener(TimerEvent.TIMER_COMP LETE, onTimerComplete);
// starts the timer ticking
minuteTimer.start();
}
public function onTick(evt:TimerEvent):void
{
// displays the tick count so far
// The target of this event is the Timer instance itself.
trace("Seconds Left" + evt.target.lblTimeUntil.text);
}
public function onTimerComplete(evt:TimerEvent):void
{
trace("Time's Up!");
var minuteTimer:Timer = evt.target as Timer;
minuteTimer.reset();
minuteTimer.start();
}
]]>
</mx:Script>
<mx:HBox horizontalGap="4" x="400" y="500">
</mx:HBox>
<mx:Label id="lblTimeUntilRefresh" text="Time Until Refresh" color="red" fontSize="19" fontWeight="bold" x="387" y="500"/>
<mx:Label id="lblTimeUntil" color="red" fontSize="22" fontWeight="bold" toolTip="Current Time Left" x="200" y="500" fontFamily="Arial"/>
</mx:Application>
The problem I am running into is everything in flex says it's fine but when I go to test the flash player completely hoses and comes up with the following error.
ReferenceError: Error #1069: Property lblTimeUntil not found on flash.utils.Timer and there is no default value.
at Red_Board/onTick()[C:\Documents and Settings\Mark\My Documents\Flex Builder 3\Red_Board\src\Red_Board.mxml:36]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" viewSourceURL="srcview/index.html" height="100%"
initialize="getDaysUntil()" >
<mx:Style source="source.css"/>
<mx:Image source="@Embed('../images/title.jpg')" width="210" height="65" top="4" left="15"/>
<mx:Image source="@Embed('../images/title1.jpg')" id="image1" horizontalAlign="right" verticalAlign="top" right="0" scaleContent="true" y="0"/>
<mx:XML id="tempXML" source="http://mysite.net/interface.php?username=admin&password=pass&custome r=63&action=showopen&operation=defects&format=xml& critcal=both" />
<mx:TileList
dataProvider="{tempXML.defect.asset}"
width="100%" backgroundColor="#000000" color="#ff0000" fontSize="27" borderColor="#000000" columnWidth="300" rowHeight="50" themeColor="#808080" fontWeight="bold" allowMultipleSelection="true" height="496" verticalCenter="28" horizontalCenter="-1"/>
<mx:XMLListCollection id="defectXMLList" source="{tempXML.defect}" />
<mx:Script>
<![CDATA[
private function getDaysUntil():void {
// creates a new five-minute Timer
var minuteTimer:Timer = new Timer(1000, 300);
// designates listeners for the interval and completion events
minuteTimer.addEventListener(TimerEvent.TIMER, onTick);
minuteTimer.addEventListener(TimerEvent.TIMER_COMP LETE, onTimerComplete);
// starts the timer ticking
minuteTimer.start();
}
public function onTick(evt:TimerEvent):void
{
// displays the tick count so far
// The target of this event is the Timer instance itself.
trace("Seconds Left" + evt.target.lblTimeUntil.text);
}
public function onTimerComplete(evt:TimerEvent):void
{
trace("Time's Up!");
var minuteTimer:Timer = evt.target as Timer;
minuteTimer.reset();
minuteTimer.start();
}
]]>
</mx:Script>
<mx:HBox horizontalGap="4" x="400" y="500">
</mx:HBox>
<mx:Label id="lblTimeUntilRefresh" text="Time Until Refresh" color="red" fontSize="19" fontWeight="bold" x="387" y="500"/>
<mx:Label id="lblTimeUntil" color="red" fontSize="22" fontWeight="bold" toolTip="Current Time Left" x="200" y="500" fontFamily="Arial"/>
</mx:Application>
The problem I am running into is everything in flex says it's fine but when I go to test the flash player completely hoses and comes up with the following error.
ReferenceError: Error #1069: Property lblTimeUntil not found on flash.utils.Timer and there is no default value.
at Red_Board/onTick()[C:\Documents and Settings\Mark\My Documents\Flex Builder 3\Red_Board\src\Red_Board.mxml:36]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()