TFatality
05-12-2004, 05:30 AM
Basically i have a spacecraft mc, and a "bullet" mc. Inside the bullet mc i have a "shot_mcanim" mc, and the following:
sweet = new mx.transitions.Tween(this.shot_mcanim, "_y", easeType, 0, -100,0.5,true)
this.onEnterFrame = function()
{sweet.onMotionFinished = function()
{ pathway = _root["shot"+(_root.i-1)] // defining the path to duplicated mc is very important
new mx.transitions.Tween(pathway, "_alpha", easeType, 100, 0,0.1,true)}
}
Okay, when I click it slowly it works out fine. But if I click more than once before the motion has finished, it screws up. How do I fix this problem?? I know it originates from the fact that once I click the mouse, the "_root.i" value increases by 1 and therefore would leave some "bullet"s lying around, but i've also tried pathway = this and failed as well...
The following works:
stop()
this._alpha=100
easeType = mx.transitions.easing.Regular.easeIn
easeType2 = mx.transitions.easing.Strong.easeIn
sweet = new mx.transitions.Tween(this.shot_mcanim, "_y", easeType, 0, -100,0.5,true)
this.onEnterFrame = function()
{sweet.onMotionFinished = function()
{gotoAndStop(2)}
}
and on frame 2:
stop()
this._alpha=0
But that's just running around something I don't understand. Are there other ways of solving the problem, ie can "pathway" have a certain value that would solve the problem? and why doesn't pathway=this work?
ty.
sweet = new mx.transitions.Tween(this.shot_mcanim, "_y", easeType, 0, -100,0.5,true)
this.onEnterFrame = function()
{sweet.onMotionFinished = function()
{ pathway = _root["shot"+(_root.i-1)] // defining the path to duplicated mc is very important
new mx.transitions.Tween(pathway, "_alpha", easeType, 100, 0,0.1,true)}
}
Okay, when I click it slowly it works out fine. But if I click more than once before the motion has finished, it screws up. How do I fix this problem?? I know it originates from the fact that once I click the mouse, the "_root.i" value increases by 1 and therefore would leave some "bullet"s lying around, but i've also tried pathway = this and failed as well...
The following works:
stop()
this._alpha=100
easeType = mx.transitions.easing.Regular.easeIn
easeType2 = mx.transitions.easing.Strong.easeIn
sweet = new mx.transitions.Tween(this.shot_mcanim, "_y", easeType, 0, -100,0.5,true)
this.onEnterFrame = function()
{sweet.onMotionFinished = function()
{gotoAndStop(2)}
}
and on frame 2:
stop()
this._alpha=0
But that's just running around something I don't understand. Are there other ways of solving the problem, ie can "pathway" have a certain value that would solve the problem? and why doesn't pathway=this work?
ty.