Be a Supporter!

Class question

  • 655 Views
  • 4 Replies
New Topic Respond to this Topic
Schmastalukas
Schmastalukas
  • Member since: Oct. 22, 2007
  • Offline.
Forum Stats
Member
Level 18
Blank Slate
Class question 2009-03-31 19:01:12 Reply

I have a question about creating custom classes in AS. Up until this point, I've been doing all my coding in the .fla. But now, I'm trying to be dynamic and use .as files. This is mostly to create components right now, but I kinda want to get into it for normal things, too.

Ok, my question is this - how do I get a function to do something every frame? I tried doing a onEnterFrame function, but when I tested the swf, it said something about there being 256 recursions, and it might be an infinite loop.

What do I do?


Winning = failing at failing
Failing at failing = failing
Therefore... Winning = failing

BBS Signature
Redshift
Redshift
  • Member since: Feb. 12, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Class question 2009-03-31 19:33:03 Reply

If you want to go into classes, it's probably best to upgrade to AS3 if you can.


#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}

BBS Signature
Shinki
Shinki
  • Member since: Feb. 14, 2005
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Class question 2009-03-31 20:10:29 Reply

At 3/31/09 07:33 PM, Nano256 wrote: If you want to go into classes, it's probably best to upgrade to AS3 if you can.

This this this! Make the jump.

In AS2.. you can use setInterval (but it won't quite line up with the frames) or have your class extend MovieClip so you can use onEnterFrame.


SCGMD4 is on the way! @scgmd4
If a picture is worth a thousand words, a game is worth a play.

BBS Signature
henke37
henke37
  • Member since: Sep. 10, 2004
  • Offline.
Forum Stats
Member
Level 30
Blank Slate
Response to Class question 2009-04-01 01:16:39 Reply

As 2 or not, his logic is obviously busted if he has infinite recursion.


Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.

Yuen-Chen
Yuen-Chen
  • Member since: Mar. 19, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Class question 2009-04-01 17:24:40 Reply

the the

Class question


BBS Signature