[flexcoders] Cairngorm : commands to execute at startup
I have a command that I want to be executed at startup. So in my cairngorm:CairngormApplication tag I set the initialize attribute : initialize=loadCatalog() My loadCatalog function is defined like this : public function loadCatalog() : Void { alert(TEST); EventBroadcaster.getInstance().broadcastEvent( loadCatalog, null ); } I also set a button that execute this same function : mx:Button click=loadCatalog() label=test/ When the application starts up, the alert inside the loadCatalog() function is displayed but the loadCatalog command is not executed. If I click on the button, the alert is displayed and the loadCatalog command is executed. I have the impression that when initialize() calls loadCatalog(), the event system is not completely ready ... Is it possible to execute a command at startup ? How should I do that ? Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] Cairngorm : commands to execute at startup
try using creationComplete rather than initalize for your loadCatalog() method call.. Timing is everything ;) Steven -Original Message- From: Laurent Cornelis [mailto:[EMAIL PROTECTED] Sent: 21 March 2005 14:29 To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm : commands to execute at startup I have a command that I want to be executed at startup. So in my cairngorm:CairngormApplication tag I set the initialize attribute : initialize=loadCatalog() My loadCatalog function is defined like this : public function loadCatalog() : Void { alert(TEST); EventBroadcaster.getInstance().broadcastEvent( loadCatalog, null ); } I also set a button that execute this same function : mx:Button click=loadCatalog() label=test/ When the application starts up, the alert inside the loadCatalog() function is displayed but the loadCatalog command is not executed. If I click on the button, the alert is displayed and the loadCatalog command is executed. I have the impression that when initialize() calls loadCatalog(), the event system is not completely ready ... Is it possible to execute a command at startup ? How should I do that ? Yahoo! Groups Links -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 18/03/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 18/03/2005 Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Cairngorm : commands to execute at startup
I was sure to have tested with creationComplete() ... but apparently not because it works like a charm ;-) Thanks a lot ! Next time, I'll check twice before posting :-p Steven Webster a crit : try using creationComplete rather than initalize for your loadCatalog() method call.. Timing is everything ;) Steven -Original Message- From: Laurent Cornelis [mailto:[EMAIL PROTECTED] Sent: 21 March 2005 14:29 To: flexcoders@yahoogroups.com Subject: [flexcoders] Cairngorm : commands to execute at startup I have a command that I want to be executed at startup. So in my cairngorm:CairngormApplication tag I set the initialize attribute : initialize=loadCatalog() My loadCatalog function is defined like this : public function loadCatalog() : Void { alert(TEST); EventBroadcaster.getInstance().broadcastEvent( loadCatalog, null ); } I also set a button that execute this same function : mx:Button click=loadCatalog() label=test/ When the application starts up, the alert inside the loadCatalog() function is displayed but the loadCatalog command is not executed. If I click on the button, the alert is displayed and the loadCatalog command is executed. I have the impression that when initialize() calls loadCatalog(), the event system is not completely ready ... Is it possible to execute a command at startup ? How should I do that ? Yahoo! Groups Links -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.7.4 - Release Date: 18/03/2005 Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/