Skip to main content
rickhino
Inspiring
June 26, 2021
Answered

Getting Loopy

  • June 26, 2021
  • 1 reply
  • 352 views

Seems almost silly to ask but I have a simple animation with a loop. 

  1. Frame 1  (0) code:
  2. var _this = this;
  3. _this.stop();
  4. var _this = this;
  5. _this.IndexNext1.on('click', function(){
  6. _this.gotoAndPlay('Indx1');
  7. });

This works. 

On frame 100, if I use this code, it doesn't work:

  1. var _this = this;
  2. _this.gotoAndPlay('indx1');

However, if I send it to a different frame with this code, it works:

  1. var _this = this;
  2. _this.gotoAndPlay('repeat1');

 

I figure I'm missing a basic concept here, but I don't know what it is.  Is there a better way to move the playhead to a labeled frame?

 

Thanks!

 

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

 

One thing I noticed is that in your example you started the label name with a capital I ("Indx1") and in a line below you started the label name with a lowercase i ("indx1").

 

Could this be the issue?

 

Please let us know.

 

Regards,

JC

1 reply

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
June 26, 2021

Hi.

 

One thing I noticed is that in your example you started the label name with a capital I ("Indx1") and in a line below you started the label name with a lowercase i ("indx1").

 

Could this be the issue?

 

Please let us know.

 

Regards,

JC

rickhino
rickhinoAuthor
Inspiring
June 26, 2021

Thanks JC!  LOL, can you tell that I haven't done this in a while?  I haven't coded much since Flash died.  I was pretty good at AS3.  Back to making all my rookie mistakes again I guess.

Have a great weekend!

JoãoCésar17023019
Community Expert
Community Expert
June 26, 2021

You're welcome!

 

And I do believe in you! I make mistakes like that too. 😄

 

Welcome back and have a great weekend you too!