bgamblin wrote:
> I've got a SWF, embedded in an object, just like the standard Flex HTML. In 
> another section of the same HTML, I have JavaScript that calls a function in 
> the SWF. However, when the call is made, everything stops. That is to say, 
> all code written after that call is ignored, and the function itself doesn't 
> execute.
>
> // In the HTML
> function JavaCall()
> {
>    getFlexApp('SWFName').callFlexFunc();
> }
>
> function getFlexApp(appName) 
> {
>    if (navigator.appName.indexOf ("Microsoft") !=-1)  return window[appName];
>    else return document[appName]; 
> }
>
>
> // inside app creation function
> ExternalInterface.addCallback("callFlexFunc", calledFunc);
>
> // outside creation function
> public function calledFunc(event:Event = null):void
> {
>    // Execution doesn't get this far
> }
>
> I should note that the object and embed that hold the SWF are set to 
> allowScriptAccess="always". It's not something I intend to ship with, but I'm 
> grasping at straws at this point.
>
> Every tutorial I've seen on the subject seems to indicate that I'm doing just 
> what I should be doing. So I have no idea what could be wrong. Any help would 
> be appreciated.
>   
I suspect you're calling the function before the SWF is properly loaded. 
Get the Flex app to call a javascript function to say when it's ready to 
run, only then call any functions in the SWF.

Paul

> -Brand
>
>
>
> ------------------------------------
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>   

Reply via email to