1

I have a Flex 3.4 app that embeds a swf with mx:SwfLoader...

That swf has a public function named "playIt". I've tried dispatching events to gettingHere.content, casting gettingHere.content as a MovieClip and other stuff...

var swfApp:MovieClip = MovieClip(gettingHere.content); if (swfApp.hasOwnProperty("playIt")) { var helloWorld:Function = (swfApp["playIt"] as Function); helloWorld(); }

to no avail. Help!

2 Answers 2

2

See the example here for interacting with a loaded Flex application.

Essentially:

var swfLoader:SWFLoader; // assuming loading complete
var loadedSM:SystemManager = SystemManager(swfLoader.content);
var loadedApp:Object = loadedSM.application;

app.playIt();
Sign up to request clarification or add additional context in comments.

1 Comment

The swf being embedded is not a flex app. It is a CS4 AS3 swf.
0

Are you able to load the swf into Flex at runtime rather than embed it? I've had good results loading swfs into Flex after launch, whereas embedding tends to be problematic for accessing a swf API.

Either use Loaders with eventListeners in a script or mx:SWFLoader in MXML with a listener on complete should work for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.