Hi list,

I have some code that I've made that I don't understand why it is failing, and I want your help

this works

var time = .3;
var easeType = mx.transitions.easing.Regular.easeOut;
var response2_mc:MovieClip = this.frmContato_response2_mc;
var plus6_mc:MovieClip = this.frmContato_plus6_mc;

plus6_mc.plus6_btNext_mc.onRelease = function() {
   plus6_mc._y = -160;
   response2_mc._y = 123;
   var startY = response2_mc._y + 10;
   var endY = response2_mc._y;
yTween = new mx.transitions.Tween(response2_mc, "_y", easeType, startY, endY, time, true); alpha_Tween = new mx.transitions.Tween(response2_mc, "_alpha", easeType, 0, 100, time, true);
};

this don't

var time = .3;
var easeType = mx.transitions.easing.Regular.easeOut;
var response2_mc:MovieClip = this.frmContato_response2_mc;
var plus6_mc:MovieClip = this.frmContato_plus6_mc;

function animateIt(tgt){
   var startY = tgt._y + 10;
   var endY = tgt._y;
yTween = new mx.transitions.Tween(tgt, "_y", easeType, startY, endY, time, true); alpha_Tween = new mx.transitions.Tween(tgt, "_alpha", easeType, 0, 100, time, true);
}

plus6_mc.plus6_btNext_mc.onRelease = function() {
   plus6_mc._y = -160;
   response2_mc._y = 123;
   animateIt(response2_mc)
};

I have many tweens like that, is that why I want to have a function to just call it everytime it's need, any clues why it don't work when it's called via function?

TIA
Marcelo Wolfgang



_______________________________________________
[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

Reply via email to