PDA

View Full Version : UpdateComplete Keeps Firing in A Loop


brixel
04-07-2008, 01:57 PM
Hey guys,

Not sure why this is happening. I've assigned a simple method to work with some objects on the stage when the application fires it's updateComplete event, but it keeps firing in an end-less loop. Any ideas?



<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" updateComplete="InitApplication()">

<mx:Script>
<![CDATA[

private function InitApplication():void
{
// Code here...
}

]]>
</mx:Script>

kahuja
04-07-2008, 04:56 PM
UpdateEvent fires when an object has had its "commitProperties", "measure", and "updateDisplayList" methods called. Are you writing in the code something that may be firing any of these internally?

brixel
04-07-2008, 05:09 PM
I don't think so, but it's possible - I had tried just taking it down as simple as an Alert.show and it was still looping, but maybe that is firing one of the events you mentioned above.

I'm just using creationComplete right now.

kahuja
04-07-2008, 05:14 PM
Can I ask, what is your criteria for choosing an event?

I will give your case a try in some time.

brixel
04-07-2008, 05:16 PM
In some cases when the application initializes, I need to be able to access the stage, and it doesn't appear to be available in the creationComplete event, only in the updateComplete event.