Be a Supporter!

Frame labels or istances?

  • 280 Views
  • 4 Replies
New Topic Respond to this Topic
BlackMist75
BlackMist75
  • Member since: Aug. 17, 2011
  • Offline.
Forum Stats
Member
Level 07
Musician
Frame labels or istances? Nov. 26th, 2011 @ 10:32 PM Reply

I am coding something that I didn't copy and paste! I hope everyone on the Flash Forum is happy! woohooo!

Anyway, I am coding a game and I have encountered an issue

onClipEvent (enterFrame) {
	trace(apollon_stance);
	//Basic Movement
	if (apollon_attack == false and apollon_stance == 0) {
		if (Key.isDown(39)) {
			this._x = this._x+10;
			this._xscale = 100;
			this.gotoAndStop("run");
		}
	}
}

I want the "run" animation to play when you press the RIGHT key. I'm wondering if I why it isn't working. Can I have some help please?

CloudEater
CloudEater
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Frame labels or istances? Nov. 26th, 2011 @ 11:10 PM Reply

You've got the code as 'gotoAndStop("run")' and so on your run frame you should have a movieClip with the running animation inside it. If it is in a Graphic then it will not play. If you have the animation on the same timeline as the frame label then you're doing it wrong.

BlackMist75
BlackMist75
  • Member since: Aug. 17, 2011
  • Offline.
Forum Stats
Member
Level 07
Musician
Response to Frame labels or istances? Nov. 26th, 2011 @ 11:25 PM Reply

Now does run have to be the instance? So your saying, the gotoAndStop command should stop on my run mC? If so, would I have to put the run symbol inside another symbol for it to work? I'm still getting errors and my head hurts! When I compile everything I keep getting "undefined" in the output section and a loop of the idle stance and running frame.

YoinK
YoinK
  • Member since: Jan. 5, 2001
  • Offline.
Forum Stats
Member
Level 60
Game Developer
Response to Frame labels or istances? Nov. 27th, 2011 @ 01:14 AM Reply

At 11/26/11 11:25 PM, BlackMist75 wrote: Now does run have to be the instance? So your saying, the gotoAndStop command should stop on my run mC? If so, would I have to put the run symbol inside another symbol for it to work? I'm still getting errors and my head hurts! When I compile everything I keep getting "undefined" in the output section and a loop of the idle stance and running frame.

in this case... "run" has to be a frame label within that particular movieclip. It might be easier to just use a specific frame number instead of telling the movie clip to go to the frame labeled 'run". if you don't have a frame labeled "run" within that movie clip... it won't go anywhere.


Kanye West Did What??????
They should make a black guy the manager, they know how to run shit!
2 Girls 1 Cup .... THE SONG!!!!

BlackMist75
BlackMist75
  • Member since: Aug. 17, 2011
  • Offline.
Forum Stats
Member
Level 07
Musician
Response to Frame labels or istances? Nov. 27th, 2011 @ 01:34 AM Reply

Thanks its starting to work! Another thing, the run loop continues to well loop

I tried putting this in the last frame of the animation

_root.gotoAndStop ("idle")

would that work?