Question : Keep original stage dimensions of loaded swf

Hi all ive jsut made an image gallery in another swf that I want to load into a website. The problem is when I load the swf in it looses its stage dimensions of 540 x 380, which means all the content that was off the stage is now visible in the document it is loaded into which is much larger 1200 x 800. Ive seen some stuff about masking but due to the way this is developed id like to do it with actionscript. How would i go about keeping the loaded swfs original stage dimensions.  my loader code is posted below. is it not possible to mask it with actionscript?

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
/*Load in external swf */
				var loadSwf:Loader = new Loader();
				var requestSwf:URLRequest = new URLRequest("photo_gallery.swf");
				loadSwf.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
				loadSwf.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
				

				loadSwf.load(requestSwf);
				
				
				
				/* Add swf to stage */
				function onCompleteHandler (loadEvent:Event) {
					stage.addChild(loadEvent.currentTarget.content);
					
					
					
					
				}
				
				/* Progress tracking*/
				function onProgressHandler(mProgress:ProgressEvent) {
					var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
					trace (percent);
				}

Answer : Keep original stage dimensions of loaded swf

There are a couple of options here, you could make the sprite in the Flash IDE, using the rectangle tool(color doesn't matter unless you are going to be blending), and load it into the document class. Or, you could make the rectangle with the flash.geom.rectangle class, and add it to a sprite.  Instead of Loader.mask, you would want to set it to the Loader variable (I apologize for being unclear..) so, loaderSWF.mask = maskingSprite;
Random Solutions  
 
programming4us programming4us