1
votes

Myapp loads an external swf and adds it to MovieClip. External swf movie has elements that are placed outside the stage (they go on the stage during swf playing). But after loading that elements are visible in the main MovieClip.

In other words, it looks like the whole space outside the stage is visible as well as the stage.

How to hide elements outside the stage of loaded swf?

1

1 Answers

1
votes

Adobe has a page about this, with the following code example showing you how to add a mask to the loaded clip at runtime:

import flash.display.*; 
import flash.net.URLRequest; 
var rect:Shape = new Shape(); 
rect.graphics.beginFill(0xFFFFFF); 
rect.graphics.drawRect(0, 0, 100, 100); 
addChild(rect); 
var ldr:Loader = new Loader(); 
ldr.mask = rect; 
var url:String = "http://www.unknown.example.com/content.swf"; 
var urlReq:URLRequest = new URLRequest(url); 
ldr.load(urlReq); 
addChild(ldr);

Full link to the page: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7c83.html