Skip to main content
RiccardoB.
Participant
February 27, 2012
Question

Embed .swf with parameters

  • February 27, 2012
  • 1 reply
  • 663 views

I have to call a .swf having parameters from another flash file.

I made this using:

var context:LoaderContext = new LoaderContext();

context.parameters = {

    'param1': 'foo',

    'param2': 'bar'

}

loader = new Loader();

loader.load(new URLRequest('external.swf'), context);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);

addChild(loader);

But now I have the need to embed the .swf, not dinamically load from an external url.

How could I do it?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
February 27, 2012

It is not clear to me what you mean by the term embed, but if you mean you need to embed it into a web page, then you can assign the parameters as FlashVars in the embedding code.

RiccardoB.
Participant
February 27, 2012

No, I intend embed in the .fla like you can embed images using:

[Embed(source = "file.png")]

private var image:Class;