enterframe

anyway to check to see if an enterframe event is running [import]uid: 7911 topic_id: 14456 reply_id: 314456[/import]

I use a print command to check in the terminal. Or you could set a flag to true within the function called by the enterFrame listener and check against that. [import]uid: 64596 topic_id: 14456 reply_id: 53471[/import]

thanks but let me explain more
im building an animation class for ppl to use and i need to check if they have an enterframe already running or not [import]uid: 7911 topic_id: 14456 reply_id: 53472[/import]

The enterFrame function will run whenever the user enters the frame…it will always run and will contently refresh.

Regards,
Jordan Schuetz
Ninja Pig Studios [import]uid: 29181 topic_id: 14456 reply_id: 53480[/import]

nevermind i think it cant be done going in different direction
[import]uid: 7911 topic_id: 14456 reply_id: 53484[/import]

people have answered your question correctly in my eyes. If you think they are wrong, then you must have phrased the question wrong/ [import]uid: 79135 topic_id: 14456 reply_id: 53565[/import]

ill try this one more time

i am build a library for people to use ( like people use the director class ) but for doing animations. say you have a ball and you want it to animate in a figure 8 twice but you dont know how to program it. you would require my library and then say js.ani( “ball.png”, “figure 8”, 2 )
from your app file. the problem is i’m using enterframe in my library but you are using it in your file also to do something. if there are multiple enterframes things move faster cause enterframe is being called multiple times so i wanted to be able to detect if a enterframe is already running. now with that said if i use this library i can look at my own code and determine if this is happening but if your using my code i cant look at your code from my house when you are running my code. i need my code to determine if this is happening.
like i can use system.getInfo() to find out what device my app is on so i could make adjustments to my app for better performance

so back to the OP is there a way to check if enterframe is already running [import]uid: 7911 topic_id: 14456 reply_id: 53567[/import]

I don’t understand that very well but enterframes are event listeners.

this:
Runtime:addEventListener(“enterFrame”, function)

well run a function every time you enter a new frame (default is 30 frames a second.)

that may not be what you want to know, but I don’t understand you. [import]uid: 79135 topic_id: 14456 reply_id: 53571[/import]

i know what enterframes are, i know how to use them, i know what they do, and how they do it
you are over thinking the problem (not being rude just trying to put it in a way you can understand )

say you use a file that i made to help you do something in you file. without me looking at your file personally i dont know if your file is using enterframe but i do know that my file is. i needed my code to check and see if your file had already called enterframe otherwise it would be called twice and things wouldn’t move at the correct speed

you can try this yourself run a sample app that uses enterframe and watch it then add a second enterframe to the code and watch the difference [import]uid: 7911 topic_id: 14456 reply_id: 53573[/import]

I could be entirely wrong (being new to this myself), but I’m not sure the use of multiple enterFrame events is going to speed up anything. IF I understand this correctly (and that is a big if, hence the capitalization):

A frame occurs each time the program cycles through. Each enterFrame listener you have fires each frame, but each enterFrame listener only fires the specific function listed.

Therefore if a user of your class uses enterFrame for their own purposes it shouldn’t interfere with your specific calling of your own functions using your own enterFrame.

If your experience differs, please correct me. [import]uid: 64596 topic_id: 14456 reply_id: 53577[/import]