Hi,
I have a situation where I create many instances of an MC, one for each node in an XML file (using a for loop), using attachMovie.
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);
Then later, but still inside the “for” loop, I refer to these instances with the variable to create an onRelease function for all of them:
photo_mc.onRelease = function() {
//stuff happens here
}
Now, elsewhere in the code, I need to activate the onRelease for one specific instance, so I can’t use photo_mc but instead I have to do something like:
_root.center_mc.photosLevel1_mc.**myInstanceName**.onRelease();
For some reason this isn’t working? What am I doing wrong? When I try to implement this the onRelease doesn’t work at all and the Flash file seems to kind of hang or freeze up.
To complicate matters further, the instance name of MC I’m calling here is going to be a variable, so I will also need to know the proper AS notation to write that last line of code with the instance name being a variable. Is it something like?:
_root.center_mc.photosLevel1_mc.**['varName']**.onRelease();
All this confusion I’m having stems from trying to implement SWFAdress (http://www.asual.com/swfaddress/) into my flash file but my navigation is not straight-forward at all so it is making things VERY complicated. I’ve got the address and titles properly updating, but I can’t quite get the SWFAddress.onChange function to work (this is where I am trying to put the above code, the variable being the SWFAddress.getValue(), which will supply the proper instance name to trigger the onRelease.
Any help here would be greatly appreciated! I’m pulling my hair out here!