# Flash website scripting and 1009 error

**URL:** https://forum.kirupa.com/t/flash-website-scripting-and-1009-error/291297
**Category:** Uncategorized
**Created:** [June 27, 2009, 3:07pm UTC](https://forum.kirupa.com/t/flash-website-scripting-and-1009-error/291297 "2009-06-27T15:07:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dietros](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@dietros](https://forum.kirupa.com/u/dietros)
#### Post date: [June 27, 2009, 3:07pm UTC](https://forum.kirupa.com/t/flash-website-scripting-and-1009-error/291297/1 "2009-06-27T15:07:58Z")

</div>

Hi everybody, I’m pretty new to flash and I’m trying to create a website in Flash CS3 using AS3. I’ve googled some tutorials and came up with a website that auto sizes to fit the browser screen. A full-browser website. I will add my sourcefiles as well as my code.

My sourcefile can be found at this URL: [http://www.2shared.com/file/6472682/e9dacb06/websitefla.html](http://www.2shared.com/file/6472682/e9dacb06/websitefla.html)

I made a SWF to preload my website and when it’s loaded, it automatically opens my main content SWF. On my first frame I’ve added the following code

```auto
var myStage:Stage = this.stage;
myStage.scaleMode = StageScaleMode.NO_SCALE;
myStage.align = StageAlign.TOP_LEFT;

function initialDisplay(event:Event):void {

    var swfWidth:int = myStage.stageWidth;
    var swfHeight:int = myStage.stageHeight; 
    
    var menu2YPos:Number = swfHeight - menu2.height;
    var menuBarBGYPos:Number=0;
    
    frame.y = swfHeight / 2;
    frame.x = swfWidth / 2;
    menuBarBG.width = swfWidth;
    menu2.width = swfWidth;
    menu2.y=menu2YPos;
    menuBarBG.y=menuBarBGYPos;
    menuDK.x=swfWidth / 2;
    loGO.y=swfHeight-loGO.height-menu2.height-15;
    loGO.x=swfWidth-15;

}

addEventListener(Event.ENTER_FRAME, initialDisplay);

```

This I got with some help of tutorials. So far everything works, part from the fact that I’m getting a 1009 error at my main timeline, initialDisplay. I have identical coding on other frames which represent other pages. Every page has the same kind of errors.

My preloader SWF has the folowing AS:

```auto
// Set up the loader object
var request:URLRequest = new URLRequest("preload.swf"); // File path is relative to this preloader
var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

// Update the percentage display
function loadProgress(event:ProgressEvent):void 
{
    var percentLoaded:Number = event.bytesLoaded / event.bytesTotal;
    percentLoaded = Math.round(percentLoaded * 100);
    
    this.percentLoaded.text = String(uint(percentLoaded)) + "%";
}

// Load complete, hide the animating graphic and text
function loadComplete(event:Event):void 
{
    trace("Load Complete");
    this.rotatingOrb.visible = false;
    this.percentLoaded.visible = false;
}

loader.load(request);
this.addChild(loader);

```

Can someone help me and explain why I keep getting this error, and how to get rid of it?

Thanks a lot for reading! I hope I was able to make myself clear, and explain my problem properly.

Greets, Dietros.
