You can try this:

timer.addEventListener("timer",timedFunction);

var counter:int;

timer.start();

function timedFuntion(e:TimerEvent):void{
  if(counter <= 1000){
var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;
counter++;
}else{
timer.stop();
}
}
------Original Message------
From: Gustavo Duenas
Sender: [email protected]
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: Re: [Flashcoders] making a repeating effect
Sent: Feb 4, 2010 3:14 PM

I've downloaded thanks
on other matters, when you say using a timer, you mean something like  
this ( I've have this from a tutorial, mixing with my idea);

something like this?

import flash.utils.*;

var timer:Timer = new Timer(5000);

timer.addEventListener("timer",TimedFunction);


timer.start();

function timedFuntion(e:TimerEvent):void{
  var heart:MovieClip = new Heart();
heart.x = Math.random * stage.stageWidth;
heart.y = Math.random * stage.stageHeight;

}

the question is , how can I stop this?

Gus
On Feb 4, 2010, at 3:40 PM, Jer Brand wrote:

> Completely un-helpful for your code, but you could also give HYPE a
> whirl. Have been having a blast playing with it lately. I think the
> above task is one of the examples.
>
> http://hype.joshuadavis.com/
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
[email protected]
254.749.2525
www.mynarcik.com

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to