I am going to assume that this["m"+i] is a movieclip created/attached
somewhere else. When its attached/created, give it an index number. Then you
can use it later.
this["m"+i].indx = i;
//then later in your showImages function...
this["m"+i].onPress = function()
{
var nIndex:Number = this.indx;
...
On 8/17/06, ilteris kaplan <[EMAIL PROTECTED]> wrote:
Hi Everyone,
I am wondering what could be the way to pass an arg through a
callback function like in a scenario below. I really appreciate any
advice on this.
*****
function showImages() {
for (var i = 1; i<4; i++) {
this["m"+i].onPress = function(i) { // passing the value
of i
var obj:Number = i;
opened = !opened;
if (opened) {
this.enabled = false;
trace("opened");
trace(obj); // well this is undefined.
trace(this["img"+i]);
this["img"+i]._visible = true;
// var "tween"+i = new Tween("img"+i,
"_alpha",
mx.transitions.easing.Regular.easeOut, -20, 100, 1.5, true);
} else {
this.enabled = true;
trace("closing");
}
};
}
}
thanks in advance.
ilteris
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com