Skip to main content
March 27, 2011
Question

How To Import Swf Into Another Swf?

  • March 27, 2011
  • 1 reply
  • 495 views

I'm using CS3, I want to import a small swf into my main swf.

I tried this code:

try 01

onClipEvent (load){

_root.loadMovie("small.swf");

}

it show only my small.swf but outside the mainpage, this is not I want.

I also tried this:

try 02

var myLoader:Loader = new Loader();

addChild(myLoader);

var url:URLRequest = new URLRequest("small.swf");

myLoader.load(url);

can see the mainpage, but can't load "small.swf"

Anyone can help?

best regards,

Joanne

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
March 27, 2011

try 01 is AS2, try 02 is AS3.  Which version of actionscript is your file using (found in the Flash Publish Settings).

March 27, 2011

hi, thanks for the prompt reply.

I'm using AS2

kglad
Community Expert
Community Expert
March 29, 2011

you have an incorrect reference to that swf or try 01 would replace your main swf with that loaded swf.