Onload not running!

This should be easy to answer…

I have 2 swf’s:

Section.swf (to be loaded in main)
Main.swf

In section.swf, on the first frame I have this:

[AS]
onLoad = function(){
// start doing stuff
}[/AS]
When I run the section.swf on its own, the onload function works, and the “doing stuff” code runs. But when I load it into main, this onload (within the section.swf, above) does not run!

I desperately need to fix this. Any help please…thanks

take everything out of onload and just stick it in the timeline.

I did that, the code still wont run!!!

whats the code?

ok…
just look at the onload function on the top…

[AS]
this.onLoad = function() {
/Initialise variables/
stage_width = 512;
stage_height = 384;
var image_Initial_Position_x = -(stage_width/2);
var image_Initial_Position_y = -(stage_height/2);
/***************************/
MovieClip.prototype.useHandCursor = false;
window = this.createEmptyMovieClip(“border”, 2);
border.beginFill (0xFF0000, 100);
border.lineStyle(1, 0, 100);
border.lineTo(stage_width, 0);
border.lineTo(stage_width, stage_height);
border.lineTo(0, stage_height);
border.lineTo(0, 0);
endFill();
setMask(window);
this.createEmptyMovieClip(“clip”,“clip”,1);
clip._x = image_Initial_Position_x;
clip._y = image_Initial_Position_y;
clip.loadMovie(“car original.jpg”);
preload(clip);
};
[/AS]

outside this function (onload) I have proto functions, but that all works fine…

I just need the onload to run when this fla is being loaded into the main.

Thanks

and when I dont include the onload function, the preload(clip) function call doesnt run.

bottom line, onLoad isnt used like that. You would basically only use it with OOP classes associated with movieclips.

where is preload defined?

thanks senocular …I just changed the onload to a this.onEnterFrame function and it worked…thanks again