# Adding a SWF into a Scaled Container

**URL:** https://forum.kirupa.com/t/adding-a-swf-into-a-scaled-container/270722
**Category:** flash
**Created:** [September 12, 2008, 7:40pm UTC](https://forum.kirupa.com/t/adding-a-swf-into-a-scaled-container/270722 "2008-09-12T19:40:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gotoAndSmoke](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@gotoAndSmoke](https://forum.kirupa.com/u/gotoAndSmoke)
#### Post date: [September 12, 2008, 7:40pm UTC](https://forum.kirupa.com/t/adding-a-swf-into-a-scaled-container/270722/1 "2008-09-12T19:40:32Z")

</div>

Ok this is what I got

```auto

import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;

var portRequest:URLRequest = new URLRequest("PictureViewer.swf");
 var portLoader:Loader = new Loader();
var myPort:DisplayObjectContainer = new DisplayObectContainer();

portLoader.load(portRequest);
myPort.addChild(portLoader);
 

myPort._width = 225;
myPort._height = 250
myPort._x = 284 ;
myPort._y = 40 ;

```

And what I am trying to do is make it so my SWF file “PictureViewer” loads into a scaled down container with the variables = myPort.

I keep getting back so many errors I don’t know where to start.

Does anyone know the exact or proper code to compile this? I figure its the simplest thing in the world, and I’m the biggest newb. 🙂

Take care!
