PDA

View Full Version : Is it possible to create my own onEnterFrame?


CoR
02-17-2009, 11:11 PM
Hi to all :D

I want to create something (myClass/myFunction, whatever) that is able to call a function, give focus to FlashPlayer and let it do it's drawing, singing, whatever AND after FP is done, to call that function again.

Timer and onEnterFrame are only two methods I know about that do this.
Timer calls function on some ms, let FP do it's thing and calls back function few ms later. onEnterFrame calls function on frame rate but it's basically same thing.

Is there a way to create game loop that doesn't use timer or enterframe as starter?

Pure event calls are not working :(

Is it possible in AS3???

bluemagica
02-18-2009, 04:03 AM
Nope, you have to use timer or eframe! but if you can explain why you don't want to use them, then we might try thinking of a solution!

cjx3711
02-18-2009, 06:50 AM
There is a way, but it most likely will lag flash.

You create an empty movieclip.
On the MCs timeline, paste your function on a frame.
Make sure you have at least 2 frames so the mc will loop.
If you want a delay, just add blank frames.
The mc will automatically loop thus repeating your code.