Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411914 Posts in 69430 Topics- by 58477 Members - Latest Member: KriegsHetzer

June 10, 2024, 10:55:59 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)a game/update loop in flashdevelop
Pages: [1]
Print
Author Topic: a game/update loop in flashdevelop  (Read 1623 times)
nikki
Level 10
*****


View Profile
« on: April 11, 2010, 05:18:54 AM »

Hi,

i just started writing in flash (i have a few years experience in other languages)
also i've had alook at flixel and flashpunk.

the thing is,

when i start a new AS3 project in flashdevelop ,
what is the easiest way of entering a loop that keeps on running (aka the Update() loop or Gameloop)


the question is realy basic so i feel extra silly

edit: Event.enterframe I found it, sorry for too quick posting

« Last Edit: April 11, 2010, 05:26:18 AM by nikki » Logged
PlayMeTape
Guest
« Reply #1 on: April 11, 2010, 08:24:25 AM »

Code:
package 
{
import flash.display.Sprite;

public class Main extends Sprite
{
public function Main():void
{
addEventListener(Event.ENTER_FRAME, update);
}

private function update(e:Event):void
{
}

}

}

There you go! Wink

Edit:
Haha, didn't see your edit. Anyway, if anyone else comes looking.
« Last Edit: April 11, 2010, 08:27:43 AM by Christoffer » Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic