Jump to content
Search Community

How to mask an external .SWF movie?

learner_7n test
Moderator Tag

Recommended Posts

Hi,

 

I am using external .SWF movie on stage by using the following code. I want to mask some of the portion of this movie. How can I mask an external movie?

 

Code:

 

var mySwf1:SWFLoader = new SWFLoader("Clock.swf", {width:200, height:200, x:-300, y:-300, container:this, onComplete:completeHandler1});

mySwf1.load();

function completeHandler1(event:LoaderEvent):void {
  TweenMax.fromTo(event.target.content, 3, {x:270, y:250, scaleX:.5, scaleY:.5, alpha:0}, {x:270, y:250, scaleX:2, scaleY:2, alpha:1, delay:3});


  TweenLite.delayedCall(30, mySwf1.unload)

 

I have entered the code on on Layer2 and created a mask (Circle shape) on Layer1 and selected the MASK option by right clicking on Layer1. But It did not work. How to resolve the problem?

 

Please help.

Link to comment
Share on other sites

don't use a layer mask, use an actionscript mask.

 

get rid of your mask layer.

 

make sure your circle is a movie clip with instance name circle

 

alter your code to include the following:

 

 

var mySwf1:SWFLoader = new SWFLoader("Clock.swf", {width:200, height:200, x:-300, y:-300, container:this, onComplete:completeHandler1});


//ADD THIS
mySwf1.content.mask = circle


mySwf1.load();

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.
×
×
  • Create New...