Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: onEnterframe= function(){

(145 views • 5 replies)

This topic is 1 page long.

<< < > >>
Angry

I-smel

Reply To Post Reply & Quote

Posted at: 12/3/07 01:54 PM

I-smel NEUTRAL LEVEL 01

Sign-Up: 03/02/06

Posts: 1,159

Hey, I've started using onEnterFrame = function(){ about as much as I'm using onClipEvent(enterFrame){

Is one of them faster than the other?


None

Jindo

Reply To Post Reply & Quote

Posted at: 12/3/07 01:55 PM

Jindo LIGHT LEVEL 22

Sign-Up: 08/30/05

Posts: 1,784

One of them is used for scripting on the time-line (onEnterFrame), the other is used for scripting on objects (MovieClips).

I don't know if one or the other is faster.


None

sandypaw

Reply To Post Reply & Quote

Posted at: 12/3/07 02:05 PM

sandypaw DARK LEVEL 10

Sign-Up: 06/28/07

Posts: 1,281

same speed,when it enters the frame. Use onEnterFrame = function() though, because maintimeline script is much better.

For speed, use intervals.

=3


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 12/3/07 03:08 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 9,218

Why would that make execution any diffirent? The only diffirence is its entry point, it doesn't change anything.

It is better, however, to use the 'onEnterFrame' property as having your program stretched out makes it harder to access things so it's more disorganised and unviewable.

haXe AliceML Box2dLite Learn AS
#ngprogramming at irc.freenode.net
OVER NINE THOUSAAAAND!!!


None

PyroflameProductions

Reply To Post Reply & Quote

Posted at: 12/10/07 02:24 AM

PyroflameProductions NEUTRAL LEVEL 09

Sign-Up: 08/04/07

Posts: 1,956

On the Frame is faster... Because when I put this code on a movieclip...

_root.button.levelamount = Math.round((_root.button.levelamount)*1)

I can see the number as 232.214 before it goes to 232. But if I put that code on the same frame I NEVER see 232.214 before the 232, it's instant a instant 232 on the timeline unlike the "lag" if it were to be on a movieclip. My Fps even is at 30.

Free .fla's are currently down.

BBS Signature

Happy

zenyara

Reply To Post Reply & Quote

Posted at: 12/10/07 02:33 AM

zenyara NEUTRAL LEVEL 10

Sign-Up: 06/17/05

Posts: 839

At 12/10/07 02:24 AM, PyroflameProductions wrote: On the Frame is faster... Because when I put this code on a movieclip...

_root.button.levelamount = Math.round((_root.button.levelamount)*1)

I can see the number as 232.214 before it goes to 232. But if I put that code on the same frame I NEVER see 232.214 before the 232, it's instant a instant 232 on the timeline unlike the "lag" if it were to be on a movieclip. My Fps even is at 30.

Interesting observation. I am forced to put all the events on a movie clip inside one of my games due to the fact I'm using the main timeline for frame reference and I don't want to have to recode every single frame action...


All times are Eastern Daylight Time (GMT -4) | Current Time: 01:07 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!