3

I have some swf compiled in flex I want to load it into my movie clip in flash pro.

...So how to for example load flex swf inside Flash CS4?

how to do such thing?

Rella
  • 65,003
  • 109
  • 363
  • 636

1 Answers1

5

Here you can read more about it: http://troygilbert.com/2009/05/loading-flex-based-swfs-in-as3-only-swfs/

Here is the code for loading the flex swf:

var loader:Loader = new Loader();
addChild(loader);
loader.load(new URLRequest("my-flex-app.swf"));
loader.addEventListener("mx.managers.SystemManager.isBootstrapRoot", systemManagerHandler);
loader.addEventListener("mx.managers.SystemManager.isStageRoot", systemManagerHandler);

function systemManagerHandler(event:Event):void { event.preventDefault(); }
a--m
  • 4,716
  • 1
  • 39
  • 59
  • But how to set resolution to thet flex swf (it was 100% to 100%) and now I want to set it to 500 to 100 but it just keeps being square... – Rella Mar 01 '10 at 11:24
  • what do you mean with setting the resolution? Once you load the swf you can set it's dimensions as any other display object, so loadedSwf.width or loadedSwf.scaleX change them accordingly. – a--m Mar 01 '10 at 12:36