PDA

View Full Version : how to make the vibration effect stop



janecruy
August 16th, 2003, 06:09 AM
Hi there

I did the 'Vibration effect' tutorial - thanks for the help... but am not sure how to let the vibration occur for a finite timeframe. i.e. how do i make it stop?

Please help!

Thanks
Jane

radicaljugnu
August 16th, 2003, 11:16 AM
r u using mx? then i guess you can use delete this.onEnterFrame;
or something like that. This might work-

movieclip.onEnterFrame=function(){
i++
movieclip._x+=(Math.floor(Math.random()*2))
movieclip._y+=(Math.floor(Math.random()*2))
(i==300)?(delete this.onEnterFrame) : (movieclip._alpha=100)
}

janecruy
August 17th, 2003, 04:07 AM
Thanks!

I am using MX. I actually got it to work by putting the movie clip in another movie clip and then pasting that into the timeline for a finite period.

By the way, the kirupa site is excellent. A couple my classmates are using it too.

pom
August 17th, 2003, 12:31 PM
Just a note: use
if (i > 300) delete this.onEnterFrame ;rather than
(i==300)?(delete this.onEnterFrame) : (movieclip._alpha=100)which doesn't really make sense :)