How to stop an action?

This is probably a (VERY) stupid question…

Is there any way to stop a script?

Lets say I have the following script:

onClipEvent (load) {
this._alpha = 0;
}
onClipEvent (enterFrame) {
if (this._alpha<95) {
this._alpha += 5;
}
if (this._alpha>95) {
this._alpha = 100;
}
}

The problem with this is that it keeps repeating the enterFrame script… I want it to stop running the script when its done (if you get what I’m saying)

Any ideas or suggestions?

stop() maybe?

Nope…

That was the first thing I tried… hehehe…

I put a trace in… According to the trace it keeps running…

dynamic event handlers…

myClip._alpha = 0;
myClip.onEnterFrame = function() {
if (this._alpha<95) {
this._alpha += 5;
} else {
this._alpha = 100;
delete this.onEnterFrame;
}
}

of course, use the script in the frame actions, not in the MovieClip actions. :wink:

thanx!

I’ll give that a shot :slight_smile:

no problem. =)

wow… mexico helping malaysia… we have like a 12 hour (more or less) time difference… this is SOOOO cool. :slight_smile:

ehmm… that’s because i’m a vampire. :stuck_out_tongue:

:wink:

ok, i’ll repay you with a bit of my blood… :slight_smile:

:stuck_out_tongue:

yup… that would be nice. :stuck_out_tongue:

alien blood ok for you? :stuck_out_tongue:

as long as it isn’t yellow or some weird color… :stuck_out_tongue:

nope… still red…

eek… the little envelope is starting to bleed already… its turning red!!! :stuck_out_tongue:

bah! there’s no alcohol in this blood!! :hair: :stuck_out_tongue:

we’ll need to spice it up with a bit of tequila… then i’ll also drink :stuck_out_tongue:

a bloody mary (literally)?.. :stuck_out_tongue: