The app takes a full frame to get initialized. The JS can be called before then. We use callbacks from the SWF into JS to tell that the SWF is ready for a call from JS
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of dorkie dork from dorktown Sent: Sunday, July 01, 2007 1:29 PM To: [email protected] Subject: Re: [flexcomponents]ExternalInterface addCallback scope *i dont think you can add a function on the application from within the component. but now, oddly enough, I think it is working from within the component, albiet intermittently, after I moved my ExternalInterface addCallback call earlier in the process. On 7/1/07, dorkie dork from dorktown <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: i dont think you can add a function on the application. Inside the component: parentApplication.onHTMLCreationComplete = new function() { } ExternalInterface.addCallback("htmlCreationComplete", parentApplication.onHTMLCreationComplete ); ReferenceError: Error #1056: Cannot create property onHTMLCreationComplete on HTMLWithGoogleMaps. On 7/1/07, Bhuvan Gupta <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: What I have noticed is that if you "addCallBack" in the main Application file (i.e mxml file containing <mx:Application> tags) then it works fine otherwise it fails silently. So may be you can also try doing this. i.e - addCallBack in the main Application mxml file - when this callback is executed generate an event for your component. This approach is working for me, should work for "dorkie call back crazy dork from dorktown" as well :-) Thanks Bhuvan http://flex-apollo.blogspot.com <http://flex-apollo.blogspot.com> On 7/1/07, dorkie dork from dorktown <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: In my component I'm calling the addCallback method but when I try to access the method from JavaScript it still fails silently. Is there scope issues with using the addCallback method? For example, can I only add callbacks to the application or handlers on the application? dorkie call back crazy dork from dorktown
