okay, i know that’s an obnoxious title.
trying to get variable from loop into scope of .onRelease function for dynamically attached clip. Of course, since i’m doing something improperly, i’m only getting the last variable from the loop/array.
you’ll see i’m using an index variable (indexa), but to no avail!!! help me!
code:
stop();
lastX=0
for(i=0; i<vids.length; i++){
item.indexa=i;
item=oVidHolder.attachMovie("otherVid", "otherVid"+i, i);
item.nameText.text=vids*.attributes.title;
item.file=vids*.attributes.file;
item.nameText.autoSize=true;
item.wC._width=nameText._width;
item._x=lastX+8;
lastX=item._x+item._width;
item.onRollOver=function(){
this._alpha=50;
}
item.onRollOut=function(){
this._alpha=100;
}
item.onRelease=function(){
_global.video=vids[indexa].attributes.file;
trace("VIDEO: "+video);
frank.gotoAndStop("startVid");
}
}
I’ve tried “this.indexa”, “item.indexa” as well as “this._parent.indexa” which i normally use if i have a button inside my clip. arrgh!