edit update resolved:::::::::::::::::::::::::::::::::::::::::
problem with code below
delete onLoadInit
remove that and it works fine.
function onLoadInit wont work, and I don’t know why.
Any help would be great.
fyi:
this is a function that makes a dynamically named _mc on the stage.
Then loads a jpg in to the _mc(“holder”) nested inside of the main _mc (“test_mc”). After words it centers the _mc “holder” where that the index(x,y point) of the main _mc “test_mc” is centered over the image loaded.
This works fine when not using array access notation, but since I need to name the _mc’s dynamical I have no idea how to other wise.
when calling the addImage function pass it to strings
1: the name of the _mc you wish to make. needs to be a :String
2: the url of the image you wish to load. needs to be a :String
addImage("test_mc","tes1.jpg");
function addImage(mc:String,imageName:String) {
var Image:String = mc;
var ImageName:String = imageName;
var nIndex:Number = this.getNextHighestDepth();
var image:MovieClip = this.createEmptyMovieClip(Image, nIndex);
var holder:MovieClip = this[Image].createEmptyMovieClip("holder", nIndex);
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(ImageName, this[Image]["holder"]);
function onLoadInit(mc:MovieClip){ //<---- heres the problem:: cant't get this to function
trace("test");
this[Image]["holder"]._y = -this[Image]._height/2;
this[Image]["holder"]._x = -this[Image]._width/2;
this[Image]._y = Stage.height/2;
this[Image]._x = Stage.width/2;
}
}