Hi,
without going into activation objects or what're called and scope issues,
i'd go with:
for (var j = 0; j<5; j++) {
trace("j is"+j);
this["clip"+j]["button"+j].myJ = j;
this["clip"+j]["button"+j].onRollOver = function() {
Tweener.addTween(this._parent,{_xscale:100, _yscale:100, delay:0,
time:2});
Tweener.addTween(_root["text"+ this.myJ],{_alpha:100, delay:0,
time:2});
_root.touchedButton = true
trace("j is"+this.myJ);
};
this["clip"+j]["button"+j].onRollOut = function() {
Tweener.addTween(this._parent,{_xscale:50, _yscale:50, delay:0,
time:2});
Tweener.addTween(_root["text"+this.myJ],{_alpha:0, delay:0, time:2});
_root.touchedButton = false
};
}
Haven't tested it though :)
greetz
JC
On Jan 23, 2008 4:38 PM, Dwayne Neckles <[EMAIL PROTECTED]> wrote:
> Gang here is a stumper for you..
>
> When in the first trace statement j is 0 through 4 but in the second trace
> statement j is 4, 4 times...
>
> ive been playing with this for days.. so i guess the j value is not the
> same inside a nested function..
> what can i do to make it the same?
>
>
> for (var j = 0; j<5; j++) {
> trace("j is"+j);
> this["clip"+j]["button"+j].onRollOver = function() {
>
> Tweener.addTween(this._parent,{_xscale:100, _yscale:100, delay:0,
> time:2});
> Tweener.addTween(_root["text"+ j],{_alpha:100, delay:0, time:2});
> _root.touchedButton = true
> trace("j is"+j);
> };
>
> this["clip"+j]["button"+j].onRollOut = function() {
>
> Tweener.addTween(this._parent,{_xscale:50, _yscale:50, delay:0,
> time:2});
> Tweener.addTween(_root["text"+j],{_alpha:0, delay:0, time:2});
> _root.touchedButton = false
>
> };
>
>
>
> }
>
>
> _________________________________________________________________
> Helping your favorite cause is as easy as instant messaging. You IM, we
> give.
>
> http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join_______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders