RE: [flexcoders] modules, rendering event trigger

2009-04-24 Thread Alex Harui
Put a try catch block around the code that assumes it is ready and in the catch 
assign the listener

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of nospam allowed
Sent: Friday, April 24, 2009 7:06 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] modules, rendering event trigger





I've got
parentApplication.addEventListener(ModuleEvent.READY, 
parentApplication.createmeals_swf.child.which_plan);

Which loads my function on first load of the swf, but I need a way to know when 
that module renders because if i try to call that function and it has not 
rendered then it throws an error when its not ready.

so if i can do something like this would be great

if(module -->ready)
   parentApplication.createmeals_swf.child.which_plan
else
  parentApplication.addEventListener(ModuleEvent.READY, 
parentApplication.createmeals_swf.child.which_plan);


--
Thanks
Jason



[flexcoders] modules, rendering event trigger

2009-04-24 Thread nospam allowed
I've got
parentApplication.addEventListener(ModuleEvent.READY,
parentApplication.createmeals_swf.child.which_plan);

Which loads my function on first load of the swf, but I need a way to know
when that module renders because if i try to call that function and it has
not rendered then it throws an error when its not ready.

so if i can do something like this would be great

if(module -->ready)
   parentApplication.createmeals_swf.child.which_plan
else
  parentApplication.addEventListener(ModuleEvent.READY,
parentApplication.createmeals_swf.child.which_plan);


-- 
Thanks
Jason