KingVin
KingVin

Reputation:

How can I use SWFLoader purely from Actionscript in Flex 3 and dynamically load content?

I'm doing a Flex 3 project wherein I've to load SWF based on the availability of required file. And the loaded SWF file will be placed in a container (a Panel) at a particular location i.e. coordinates. This I don't want to do in MXML as the SWFLoader container shows a cross marked box if the file is unavailable.

So friends is there any solution?

Upvotes: 0

Views: 4551

Answers (1)

Raul Agrait
Raul Agrait

Reputation: 6018

  • Create a new URLRequest object with the url of the file.
  • Create a new Loader object.
  • Call the Loader object's load() method, passing the URLRequest instance as a parameter.
  • Call the addChild() method on a display object container (such as the main timeline of a Flash document) to add the Loader instance to the display list.

Source: Loading an external SWF file.

Upvotes: 1

Related Questions