hi-
i’m trying to make the paradigm shift to MX’s movie clip event handers–here’s where i’m stuck:
first, i’m dynamically attaching MCs for my menu:
menuArray = [“current”, “play”, “mfa”, “resume”, “contact”];
this.onLoad = function () {
mLen =menuArray.length;
//add menuMCs to stage ////
for (i=0; i<mLen; i++){
level=i+10;
myName=menuArray*;
attachMovie(“MENU_MC”,myName,level);
//set init properties for each loaded MC
setProperty(myName, _x, markerX);
myW=getProperty(myName, _width);
myX=markerX+(i*myW);
setProperty(myName, _x, myX);
setProperty(myName, _y, 200);
setProperty(myName, _alpha, 80);
}
}
second, inside each mc is this code:
myName=this._name;
this.onMouseUp = function () {
trace(myName);
//_root.loadMenuMC(myName);
}
when i mouse up, each Name is traced, so it seems that this function is being activated in every menu MC that is loaded, and each is calling loadMenuMC with its name as the variable. i also tried this syntax:
myName.onMouseUp=
and _parent.myName.onMouseUp
so how do i differentiate the ‘generic’ MC function calls?
also, bonus points for telling me how variables can be passed from onLoad to onEnterFrame, etc. it seems when i tried it that the onEnterFrame didn’t pick up any vars from onLoad.
any help in figuring this problem out and info on mc event handlers in general is much appreciated–
regards,
-mojo