Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
learner_7n

How to load an external SWF file into a specific movie clip?

Recommended Posts

Hi,

 

I have the following code which is working fine:

 

 
var mySwf1:SWFLoader = new SWFLoader("HandBook.swf", {width:600, height:400, container:this, onComplete:completeHandler1});

mySwf1.load();

function completeHandler1(event:LoaderEvent):void {
TweenLite.to(event.target.content, 0,{alpha:0});
TweenMax.fromTo(event.target.content, 3, {x:0, y:0, width:600, height:400, alpha:.5}, {x:0, y:0, width:600, height:400, alpha:1, delay:1});
}

 

The question is, how can I modify the below line of code to load this "HandBook.swf" external file into specific movie clip? Say, I have mc1, mc2, mc3 movie clips and I want to load this "HandBook.swf into mc2 movie clip.

 

Thanks in advance for any help.

  • Like 1
Link to comment
Share on other sites

You just need to update the value for the container property:

 

var mySwf1:SWFLoader = new SWFLoader("HandBook.swf", {width:600, height:400, container:mc2, onComplete:completeHandler1});

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×