Actionscript without display list (update/draw loop)

219 views Asked by At

I've been working with several different programming languages recently, and I've come to the conclusion that I don't really like the display list in Actionscript. I would much rather have an update/draw loop and draw and manage everything manually like in XNA (C#). What I do like in actionscript is the ease of use of events, movieclips animations and vector graphics.

What are the possibillites for this? I would really like to be able to use animated movieclips, but I think that would be impossible without the display list, so I could settle with writing my own animation system with spritesheets. Rewriting the entire event system isn't something I look forward to though. Are there any (molehill) frameworks that work without the display list?

2

There are 2 answers

2
Staven On

You can do something similar by creating a Bitmap with the same size as the stage, attaching it to the stage as a child and using it like a "screen", by blitting your graphics on it every frame (on ENTER_FRAME event). I think it's even mentioned somewhere in the official Adobe documentation, as a method of efficiently animating a large number of objects.

1
stenrap On

I would advise you to muster up the courage and let go of C# when programming in ActionScript. As Bjarne Stroustrup wisely said in his book The C++ Programming Language:

...applying techniques effective in one language to another typically leads to awkward, poorly performing, and hard-to-maintain code. Such code is also most frustrating to write because every line of code and every compiler error message reminds the programmer that the language used differs from 'the old language.' You can write in the style of [another language], but doing so is neither pleasant nor economical in a language with a different philosophy.

I think that applies very well to the question you're asking here.