Be a Supporter!

As3 - Controlling Animations

  • 363 Views
  • 7 Replies
New Topic Respond to this Topic
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
As3 - Controlling Animations 2009-05-08 14:41:39 Reply

My second thread at newgrounds ~

I'm making a game and my fps is 30. At 30 fps animations is very fast,
so i'd like to control my animations in some way so that they are not
depending on fps. I managed to one time by using a timer, i've tried
doing the same thing but failed =P

I'd appreciate if you'd give some suggestions.
thank you,
Daniel


BBS Signature
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 02:56:06 Reply

Day 2 ~

Bump.


BBS Signature
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 04:07:34 Reply

I might have solved it myself. The setInterval() method looks
promising enough. If anyone else is wondering about this
i read about it here http://www.republicofcode.com/tutorials/
flash/setinterval/

happy actionscripting ~


BBS Signature
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 04:56:04 Reply

in my case the setInterval method apparently makes everything lag, ALoT.
i used it to inside my "character walking" movieClip make it move to the next frame

function anispeed():void {
	gotoAndPlay(nextFrame)
}
setInterval(anispeed,5000)

I guess the timer method is the way to go =P


BBS Signature
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 05:04:47 Reply

At 5/9/09 04:56 AM, Dafali wrote: in my case the setInterval method apparently makes everything lag, ALoT.

the lagging was caused by my shitty computer >.>


BBS Signature
mongoid
mongoid
  • Member since: Jan. 3, 2002
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 05:05:40 Reply

Hey dude, hope this helps.

http://www.kirupa.com/forum/showthread.p hp?p=1876826

Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 05:09:07 Reply

At 5/9/09 05:05 AM, mongoid wrote: Hey dude, hope this helps.

http://www.kirupa.com/forum/showthread.p hp?p=1876826

It doesn't since i don't want to change my framerate, i only want
to change the speed of one animation


BBS Signature
Dafali
Dafali
  • Member since: Apr. 18, 2009
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to As3 - Controlling Animations 2009-05-09 06:24:01 Reply

finally found what i was looking for ~

function wait() {
   stop();
   var myInterval = setInterval(function () {
      play();
      clearInterval(myInterval);
   }, 1000); // stop for 1 second
}
wait();

BBS Signature