flash - Embed an SWF file in Flex and interact with ExternalInterface functions -


I use a SWF file that exposes functions and events using ExternalInterface. Here is an example of an exposed function:

  ExternalInterface.addClallback ("myfunction", ExecuteMyFunction);   

If I embed a file in an HTML page, then I can use those functions using Javascript.

Now, I'm dynamically embedting a similar SWF file in Flex using the MX app: SWFLoader component, like something:

  & lt; Mx: SWFLoader id = "myLoader" source = "http: //localhost/file.swf" autoLoad = "true" />   

I am trying to reach those exposed functions and events, but I have not found the way to interact with them with the Flex app. I would like to be able to call functions like javascript, like:

  myLoader.myFunction ();   

How can I use a function that is exposed to an external frame inside Flex?

Basically you need to do something like this:

  Var mySubApp: * = (myLoader.content as a SystemManager). Application; MySubApp.myFunction ();   

There are more details in this link:



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -