Why use a timer?
It is not necessary to do it on exact time because you use a random.
So in this case Event.ENTER_FRAME would do the trick for you.
HTH
Cor
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of
Without getting too technical, you don't want to use timers move things.
You want to use frames instead of timers. Save yourself some headache and
don't use timers for movement. (unless you're using them to invalidate
properties and such, but that's a more complex topic)
Now if you want the
addEventListener(Event.ENTER_FRAME, onEnterFrame);
function onEnterFrame(event:Event):void
{
ball1.x += Math.round(Math.random()*5);
ball2.x += Math.round(Math.random()*5);
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor
Sent: Tuesday, December 16, 2008 11:49 AM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Timer (AS3 newbie question)
Why use a timer?
It is not necessary to do it on exact time because you use a random.
So
] Timer (AS3 newbie question)
Why use a timer?
It is not necessary to do it on exact time because you use a random.
So in this case Event.ENTER_FRAME would do the trick for you.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http
to the target, but I
guess not. Thanks!
- MM
-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor
Sent: Tuesday, December 16, 2008 11:49 AM
To: 'Flash Coders List'
Subject: RE: [Flashcoders] Timer
6 matches
Mail list logo