PDA

View Full Version : Pathing to duplicateMC Query


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.

farafiro
05-12-2004, 10:02 AM
didn't see the file but try this
after clicking it add script for making it un-clickable
like this.enabled = false

TFatality
05-12-2004, 03:04 PM
I dun want that much lapse in time between shots... =)

farafiro
05-13-2004, 02:58 AM
huh ???

TFatality
05-13-2004, 04:49 AM
Say if I use this.enabled=false wouldn't it mean there'd be a 0.5/0.6 second pause until the button is reactivated/ between each click?

Which I don't want..

or maybe I've mistaken how "this.enabled=false" works.