[Flashcoders] ::dk :: passing args to onPress, onRollOver, etc

2006-10-16 Thread dnk
Hi there, I am trying to write a few mouse events for multiple movieclips. Now say I have the following: function writeBtnEvents() { for (var i:Number = 0; i 35; i++) { this._targetMc[btnHldr + i].onPress = function(i:Number) { trace(pressed: + i); } this._targetMc[btnHldr + i].onRollOver

Re: [Flashcoders] ::dk :: passing args to onPress, onRollOver, etc

2006-10-16 Thread eka
Hello :) you can try 2 solutions : 1 - with a little property index to save the index value var bt = this._targetMc[btnHldr + i] ; bt.index = i ; bt.onPress = function() { trace(pressed: + this.index); } 2 - with Proxy method (like mx.utils.Delegate class but you can use arguments : //