I have a simple but effective script from Flashmo that basically duplicates a graphic of a heart and creates a raining heart effect.
But I would like to turn it off, and then back on. So basically it starts, then stops, then starts again later.
I am reading the script and experiemented with it but I cant seem to turn it off.
Probably simple. Can someone help?
Here is the script...
// created by www.flashmo.com
flashmo_heart._visible = false;
var i:Number = 1;
var duration:Number = 200;
var total:Number = 500;
var fm = flashmo_heart.duplicateMovieClip("fm" + i, total - i );
fm._x = random(750) + 50;
fm._alpha = random(40) + 61;
fm._xscale = fm._yscale = random(60) + 41;
if( i % 2 == 0 )
rotation = random(90) - 270;
rotation = random(270) + 90;
new Tween(fm, "_rotation", Regular.easeOut, rotation, 0, 1.5, true);
new Tween(fm, "_x", Elastic.easeInOut, fm._x, fm._x + random(120) - 60, 3, true);
fm_tween = new Tween(fm, "_y", None.easeOut, -30, 430, random(3) + 3, true);
fm_tween.onMotionFinished = function()
if(i >= total)
i = 1;
interval_id = setInterval(this, "create_flashmo", duration);
flashmo_bg.useHandCursor = false;
flashmo_bg.onRelease = function()
Thank you very much in advance..
YOu could use a clearInterval(interval_id) call to stop the creation of new hearts, but getting the existing ones to stop falling would be tricky and getting them to restart falling even trickier. The reason for being tricky is that your code uses coded Tweens and dynamically created objects without keeping track of who's still around. You'd be better of not using the Tweens if you wanted some way of controlling the motion more easily.
While it might not be what you wanrt, you could just keep them running and add a movieclip that blocks them out when you want them stopped (not visible as well)
Hi, and thank you for your answer...
I understand as far as my limited experience allows..
I will take your advice and try putting the elements in an apart movieclip and try to manipulte visibly that clip.
Thanks for that idea!
Europe, Middle East and Africa