00:00
00:00
Newgrounds Background Image Theme

Our goal is for Newgrounds to be ad free for everyone! Become a Supporter today and help make this dream a reality!

AS3 gotoAndStop

1,040 Views | 38 Replies
New Topic Respond to this Topic

AS3 gotoAndStop 2020-11-25 14:20:31


I'm trying to use gotoAndStop inside a movieclip and it won't work it keeps coming up with an error


the player movieclip is named _player, it's on the root.

the error is:


ArgumentError: Error #2109: Frame label walk not found in scene walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()


it's on the actionscript file. someone please help, thanks

Response to AS3 gotoAndStop 2020-11-26 12:21:26


game.zip (newgrounds.com)

here's a link to the AS3 and Adobe Animate file so you can have a look at what's wrong

Response to AS3 gotoAndStop 2020-11-27 12:13:04


Do you have a frame labeled "walk" in the walk scene?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-27 20:47:45


At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?


There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside

Response to AS3 gotoAndStop 2020-11-27 21:04:49


At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside


I don't have Animate; how are you calling gotoAndStop(), and from where?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-27 21:13:34


At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?


I'm calling it from a actionscript file in te same folder as the. Fla

Response to AS3 gotoAndStop 2020-11-27 21:23:31


It lets me change the xscale with _player.scalex


But it doesn't seem to like _player.gotoAndStop("walk);


Response to AS3 gotoAndStop 2020-11-27 21:30:06


At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla


I think you might have to do

MovieClip(_root)._player.gotoAndStop("walk")

Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-27 21:38:13


At 11/27/20 09:30 PM, Gimmick wrote:
At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla
I think you might have to do


I tried that code it doesn't work it comes up with Frame label walk not found in scene walk

Response to AS3 gotoAndStop 2020-11-27 21:40:00


At 11/27/20 09:38 PM, Spudzy wrote:
At 11/27/20 09:30 PM, Gimmick wrote:
At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla
I think you might have to do
I tried that code it doesn't work it comes up with Frame label walk not found in scene walk


What output do you get when you try tracing _player?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-27 21:45:47


At 11/27/20 09:40 PM, Gimmick wrote:
At 11/27/20 09:38 PM, Spudzy wrote:
At 11/27/20 09:30 PM, Gimmick wrote:
At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla
I think you might have to do
I tried that code it doesn't work it comes up with Frame label walk not found in scene walk
What output do you get when you try tracing _player?


Thank you so much for helping but it's 3am here in the UK gotta sleep. I'll get back to you tomorrow

Response to AS3 gotoAndStop 2020-11-28 07:09:02


At 11/27/20 09:40 PM, Gimmick wrote:
At 11/27/20 09:38 PM, Spudzy wrote:
At 11/27/20 09:30 PM, Gimmick wrote:
At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla
I think you might have to do
I tried that code it doesn't work it comes up with Frame label walk not found in scene walk
What output do you get when you try tracing _player?


ArgumentError: Error #2109: Frame label walk not found in scene walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()

Response to AS3 gotoAndStop 2020-11-28 08:11:05


package  

{

import flash.display.MovieClip;

import flash.events.Event;

import flash.events.KeyboardEvent;

import flash.ui.Keyboard;

public class Main extends MovieClip

{

private var _player:MovieClip;

private var _playerSpeed:Number = 4;

private var grav:Number = .5;

private var vspeed = 0;

private var touchingGround:Boolean = false;

private var _movingUp:Boolean = false;

private var _movingDown:Boolean = false;

private var _movingLeft:Boolean = false;

private var _movingRight:Boolean = false;

private var health:Number = 1;


public function Main() 

{

createPlayer();

// add listeners

stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);

stage.addEventListener(KeyboardEvent.KEY_DOWN, myOnPress);

stage.addEventListener(KeyboardEvent.KEY_UP, myOnRelease);

}

/**

* Creates player

*/

private function createPlayer():void

{

_player = new Player();

_player.x = stage.stageWidth / 4;

_player.y = stage.stageHeight / 4;

stage.addChild(_player);

}

/**

* EnterFrame Handlers

*/

private function enterFrameHandler(event:Event):void

{

hp.scaleX=health;

// Move up, down, left, or right

if ( _movingLeft && !_movingRight )

{

_player.x -= _playerSpeed;

_player.scaleX=-1;

MovieClip(root)._player.gotoAndStop("walk");

}

if ( _movingRight && !_movingLeft )

{

_player.x += _playerSpeed;

_player.scaleX=1;

}

if (!_movingRight && !_movingLeft) { /*_player.gotoAndStop("stand");*/ }

/*if ( _movingUp && !_movingDown )

{

_player.y -= _playerSpeed;

}

if ( _movingDown && !_movingUp )

{

_player.y += _playerSpeed;

}*/

if (_player.hitTestObject(floor) && vspeed>0) 

{ vspeed = 0; touchingGround=true;} else {touchingGround=false;

_player.y+=vspeed;}

vspeed += grav;

}

/**

* Key Press Handlers

*/

public function myOnPress(event:KeyboardEvent):void

{

switch( event.keyCode )

{

case Keyboard.UP:

_movingUp = true;

if (touchingGround) {vspeed=-8;}

break;

case Keyboard.DOWN:_movingDown = true;

break;

case Keyboard.LEFT:

_movingLeft = true;

break;

case Keyboard.RIGHT:

_movingRight = true;

break;

}

}

/**

* Key Release Handlers

*/

public function myOnRelease(event:KeyboardEvent):void

{

switch( event.keyCode )

{

case Keyboard.UP:

_movingUp = false;

break;

case Keyboard.DOWN:

_movingDown = false;

break;

case Keyboard.LEFT:

_movingLeft = false;

break;

case Keyboard.RIGHT:

_movingRight = false;

break;

}

}

}

}

Response to AS3 gotoAndStop 2020-11-28 10:33:00


At 11/28/20 07:09 AM, Spudzy wrote:
At 11/27/20 09:40 PM, Gimmick wrote:
At 11/27/20 09:38 PM, Spudzy wrote:
At 11/27/20 09:30 PM, Gimmick wrote:
At 11/27/20 09:13 PM, Spudzy wrote:
At 11/27/20 09:04 PM, Gimmick wrote:
At 11/27/20 08:47 PM, Spudzy wrote:
At 11/27/20 12:13 PM, Gimmick wrote: Do you have a frame labeled "walk" in the walk scene?
There is no walk scene there's a movie clip named _player on the root,with a frame labelled 'walk' inside
I don't have Animate; how are you calling gotoAndStop(), and from where?
I'm calling it from a actionscript file in te same folder as the. Fla
I think you might have to do
I tried that code it doesn't work it comes up with Frame label walk not found in scene walk
What output do you get when you try tracing _player?
ArgumentError: Error #2109: Frame label walk not found in scene walk.
at flash.display::MovieClip/gotoAndStop()
at Main/enterFrameHandler()


Er, what happens when you try running

trace(MovieClip(_root)._player)
trace(stage.getChildIndex(MovieClip(_root)._player)

before the gotoAndStop()?


That said, can you post a few screenshots of:

  • the stage,
  • the Scene Viewer (I think the shortcut is F2)
  • the _player mc


As well as pasting any actionscript code you have just before the error occurs (i.e. the gotoandstop code, and anything else you think may be relevant)? That might provide a lot more context to work with.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-28 15:56:03


iu_201265_3469712.jpg

I tried tracing it, it just comes up with an error

Response to AS3 gotoAndStop 2020-11-28 15:57:15


and it's just root, not _root

Response to AS3 gotoAndStop 2020-11-28 16:01:33


hey i've just got progress... I tried trace(MovieClip(_player));


and it's outputting [object Player] now ?

Response to AS3 gotoAndStop 2020-11-29 15:55:52 (edited 2020-11-29 15:56:47)


At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error


D'oh. Silly me. Fixed, try running this:


trace(MovieClip(root)._player)
trace(stage.getChildIndex(MovieClip(root)._player))
At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?


Ah, so it's visible to the document.


Try


MovieClip(_player).gotoAndStop("walk")

Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-29 16:40:44


At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try


i'm getting


ArgumentError: Error #2109: Frame label walk not found in scene walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()

[object Player]

[object Player]

1

ArgumentError: Error #2109: Frame label walk not found in scene walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()

Response to AS3 gotoAndStop 2020-11-29 19:04:30 (edited 2020-11-29 19:04:38)


At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting

Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-11-30 08:01:08


At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)


iu_202057_3469712.jpg

I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame

Response to AS3 gotoAndStop 2020-12-01 20:02:05


At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame


So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?


If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-12-02 06:26:43


At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.


Tried both, still not working

ArgumentError: Error #2109: Frame label player_walk not found in scene player_walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()

Response to AS3 gotoAndStop 2020-12-02 06:57:23 (edited 2020-12-02 06:59:30)


At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.


I've noticed that the program recognizes that the object is called 'Player' not _player (even though that's what I labelled the movieclip as)

iu_203149_3469712.jpg

I tried Player.gotoAndStop("walk"); and

ArgumentError: Error #2109: Frame label Player_walk not found in scene Player_walk.

at flash.display::MovieClip/gotoAndStop()

at Main/enterFrameHandler()

Response to AS3 gotoAndStop 2020-12-02 08:48:55


At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.


I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with

TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.

at Main/enterFrameHandler()

Response to AS3 gotoAndStop 2020-12-03 14:39:52


At 12/2/20 08:48 AM, Spudzy wrote:
At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.
I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with
TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.
at Main/enterFrameHandler()


The "linkage" is not the same thing as the variable name. The linkage is actually the Class name - so your class would be called Player, but the instance name of the Player object should be "_player".


Okay, given this I think I have enough info to say what's happening. I know this could've been resolved much quicker if I had Animate, but can you show a screenshot of the stage? (In the screenshot earlier it shows the Player MC, but not the stage itself. Is the player MC on the stage? What's the variable/instance name in the properties panel?)


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-12-03 15:35:56


At 12/3/20 02:39 PM, Gimmick wrote:
At 12/2/20 08:48 AM, Spudzy wrote:
At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.
I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with
TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.
at Main/enterFrameHandler()
The "linkage" is not the same thing as the variable name. The linkage is actually the Class name - so your class would be called Player, but the instance name of the Player object should be "_player".

Okay, given this I think I have enough info to say what's happening. I know this could've been resolved much quicker if I had Animate, but can you show a screenshot of the stage? (In the screenshot earlier it shows the Player MC, but not the stage itself. Is the player MC on the stage? What's the variable/instance name in the properties panel?)


iu_203778_3469712.jpg

iu_203779_3469712.jpg

Response to AS3 gotoAndStop 2020-12-03 19:56:31


At 12/3/20 03:35 PM, Spudzy wrote:
At 12/3/20 02:39 PM, Gimmick wrote:
At 12/2/20 08:48 AM, Spudzy wrote:
At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.
I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with
TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.
at Main/enterFrameHandler()
The "linkage" is not the same thing as the variable name. The linkage is actually the Class name - so your class would be called Player, but the instance name of the Player object should be "_player".

Okay, given this I think I have enough info to say what's happening. I know this could've been resolved much quicker if I had Animate, but can you show a screenshot of the stage? (In the screenshot earlier it shows the Player MC, but not the stage itself. Is the player MC on the stage? What's the variable/instance name in the properties panel?)


That's not the main stage, or if it is, I don't see the player character anywhere. Can you click the arrow beside "player"?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature

Response to AS3 gotoAndStop 2020-12-03 19:59:02


At 12/3/20 07:56 PM, Gimmick wrote:
At 12/3/20 03:35 PM, Spudzy wrote:
At 12/3/20 02:39 PM, Gimmick wrote:
At 12/2/20 08:48 AM, Spudzy wrote:
At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error
D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote: hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?
Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.
I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with
TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.
at Main/enterFrameHandler()
The "linkage" is not the same thing as the variable name. The linkage is actually the Class name - so your class would be called Player, but the instance name of the Player object should be "_player".

Okay, given this I think I have enough info to say what's happening. I know this could've been resolved much quicker if I had Animate, but can you show a screenshot of the stage? (In the screenshot earlier it shows the Player MC, but not the stage itself. Is the player MC on the stage? What's the variable/instance name in the properties panel?)
That's not the main stage, or if it is, I don't see the player character anywhere. Can you click the arrow beside "player"?


It is the main stage and the player is generated on the stage by code

Response to AS3 gotoAndStop 2020-12-03 20:05:24


At 12/3/20 07:59 PM, Spudzy wrote:
At 12/3/20 07:56 PM, Gimmick wrote:
At 12/3/20 03:35 PM, Spudzy wrote:
At 12/3/20 02:39 PM, Gimmick wrote:
At 12/2/20 08:48 AM, Spudzy wrote:
At 12/1/20 08:02 PM, Gimmick wrote:
At 11/30/20 08:01 AM, Spudzy wrote:
At 11/29/20 07:04 PM, Gimmick wrote:
At 11/29/20 04:40 PM, Spudzy wrote:
At 11/29/20 03:55 PM, Gimmick wrote:
At 11/28/20 03:56 PM, Spudzy wrote:
I tried tracing it, it just comes up with an error

D'oh. Silly me. Fixed, try running this:

At 11/28/20 04:01 PM, Spudzy wrote:
hey i've just got progress... I tried trace(MovieClip(_player));

and it's outputting [object Player] now ?

Ah, so it's visible to the document.

Try
i'm getting
Okay, I feel like this is a really basic question that should've been asked before, but do you have a frame labelled "walk" in player? Can you show a screenshot? (Select the frame and show the properties panel or wherever it is you set the frame label)
I have the 2nd frame labelled as "walk" inside the player MC. Inside the player MC there's a stop(); called at the first frame
So what happens when you try _player.gotoAndStop(2) instead? Does it go to that frame?

If it does, try renaming the "walk" frame to something else, maybe player_walk. There might be a conflict in the name and scene which might cause the error.
I've also tried MovieClip(Player).gotoAndStop("player_walk"); but it comes up with
TypeError: Error #1034: Type Coercion failed: cannot convert Player$ to flash.display.MovieClip.
at Main/enterFrameHandler()
The "linkage" is not the same thing as the variable name. The linkage is actually the Class name - so your class would be called Player, but the instance name of the Player object should be "_player".

Okay, given this I think I have enough info to say what's happening. I know this could've been resolved much quicker if I had Animate, but can you show a screenshot of the stage? (In the screenshot earlier it shows the Player MC, but not the stage itself. Is the player MC on the stage? What's the variable/instance name in the properties panel?)
That's not the main stage, or if it is, I don't see the player character anywhere. Can you click the arrow beside "player"?
It is the main stage and the player is generated on the stage by code


Can you include whatever code you're using?


Slint approves of me! | "This is Newgrounds.com, not Disney.com" - WadeFulp

"Sit look rub panda" - Alan Davies

BBS Signature