10 Replies - 7023 Views - Last Post: 02 September 2012 - 12:20 PM

#1 nicchiet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-August 09

gotoAndPlay stops instead playing...

Posted 18 August 2009 - 03:08 AM

hi everyone.
got this problem in actionscript programming, in anybody can help:

I have 7 movieClips named r9 to r15: any of them has an animation inside of 60 frames, stopped at frame 1.
i have to play them with actionscript like this:

function moveClips () {
for (i=9;i<=15;i++){
this["r"+i].gotoAndPlay(5)
}
}

well, when i call the function the movieClips go ti frame 5 and stop...

tried also:

function moveClips () {
for (i=9;i<=15;i++){
if (this["r"+i]._framesloaded >= this["r"+i]._totalframes) {
this["r"+i].gotoAndPlay(5)
}
}
}

but still no results...

where's the issue?

many thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: gotoAndPlay stops instead playing...

#2 gregwhitworth  Icon User is offline

  • Tired.
  • member icon

Reputation: 219
  • View blog
  • Posts: 1,604
  • Joined: 20-January 09

Re: gotoAndPlay stops instead playing...

Posted 18 August 2009 - 08:42 AM

Does it go to the correct mc or not? Or is it going to the current mc and stopping?

--

Greg
Was This Post Helpful? 0
  • +
  • -

#3 nicchiet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-August 09

Re: gotoAndPlay stops instead playing...

Posted 18 August 2009 - 01:00 PM

View Postgregwhitworth, on 18 Aug, 2009 - 07:42 AM, said:

Does it go to the correct mc or not? Or is it going to the current mc and stopping?

--

Greg


hi greg,

the mc is correct: in fact if I give a different instruction, like _alpha property, it works as well for any of the mentioned clips.

simply, gotoAndPlay doesn't work...
Was This Post Helpful? 0
  • +
  • -

#4 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1147
  • View blog
  • Posts: 7,132
  • Joined: 07-September 06

Re: gotoAndPlay stops instead playing...

Posted 18 August 2009 - 09:49 PM

Depending on the way you are attemping to accomplish this you may be causing a problem as you are trying to fix it. I believe your code it sound so I will look into the movieclip structure.

I am assuming that you only have one layer, or your layer with content and an animation on it also has the actionscript stop() on it. That will cause it problems especially if that keyfrme is more than one frame long. My suggestion is the make a new layer, name it actions, place a 1 frame long keyframe as the first frame (and delete the rest of the frames) and in that one place the stop() code. That should have it only going through the stop on the first frame instead of each frame it plays.

NOTE - I haven't tested this out to make sure it works, but I would expect it to be something simple like this.

Hope that helps.
Was This Post Helpful? 0
  • +
  • -

#5 nicchiet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-August 09

Re: gotoAndPlay stops instead playing...

Posted 19 August 2009 - 12:41 AM

View PostBetaWar, on 18 Aug, 2009 - 08:49 PM, said:

Depending on the way you are attemping to accomplish this you may be causing a problem as you are trying to fix it. I believe your code it sound so I will look into the movieclip structure.

I am assuming that you only have one layer, or your layer with content and an animation on it also has the actionscript stop() on it. That will cause it problems especially if that keyfrme is more than one frame long. My suggestion is the make a new layer, name it actions, place a 1 frame long keyframe as the first frame (and delete the rest of the frames) and in that one place the stop() code. That should have it only going through the stop on the first frame instead of each frame it plays.

NOTE - I haven't tested this out to make sure it works, but I would expect it to be something simple like this.

Hope that helps.


Hi BetaWar,
I tryed your way, put any of mc on its layer, and inside mc i put stop an actions layer with the stop() on first keyframe, but nothing different happens.
Now, the solution I found is to put a play() action on keyframe 2 inside mc, give the mc.gotoAndPlay(2), and so it works... but I've never had to do something like that before, so, is it a flash bug?

And more: if i put the stop() in frame 2 of mc, and the playing instruction is mc.gotoAndPlay(3), it works! So, is the damned frame 1?

This post has been edited by nicchiet: 19 August 2009 - 12:48 AM

Was This Post Helpful? 0
  • +
  • -

#6 Aurel300  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 230
  • Joined: 10-November 07

Re: gotoAndPlay stops instead playing...

Posted 19 August 2009 - 12:48 AM

No, maybe you´ve (mistakenly) had the stop code layer longer than one frame and when you put the play code there, it just overwritten it.

That´s the only thing I can think of - I am sure it is not a Flash bug.
Was This Post Helpful? 0
  • +
  • -

#7 nicchiet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-August 09

Re: gotoAndPlay stops instead playing...

Posted 19 August 2009 - 01:21 AM

View PostAurel300, on 18 Aug, 2009 - 11:48 PM, said:

No, maybe you´ve (mistakenly) had the stop code layer longer than one frame and when you put the play code there, it just overwritten it.

That´s the only thing I can think of - I am sure it is not a Flash bug.


maybe...
ok , try this: create a new file, create a mc with a 30 frames animation on a layer and an actions layer of 1 frame only with stop instruction. now go to root and put on frame 1 the mc just created, name it "mc1". create another actions layer in root and put the code: mc1.gotoAndPlay(2).
Mine is not working.
and yours? (possibly this try can tell us if my flash has bugs or not)
Was This Post Helpful? 0
  • +
  • -

#8 nicchiet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 18-August 09

Re: gotoAndPlay stops instead playing...

Posted 19 August 2009 - 01:58 AM

View Postnicchiet, on 19 Aug, 2009 - 12:21 AM, said:

View PostAurel300, on 18 Aug, 2009 - 11:48 PM, said:

No, maybe you´ve (mistakenly) had the stop code layer longer than one frame and when you put the play code there, it just overwritten it.

That´s the only thing I can think of - I am sure it is not a Flash bug.


maybe...
ok , try this: create a new file, create a mc with a 30 frames animation on a layer and an actions layer of 1 frame only with stop instruction. now go to root and put on frame 1 the mc just created, name it "mc1". create another actions layer in root and put the code: mc1.gotoAndPlay(2).
Mine is not working.
and yours? (possibly this try can tell us if my flash has bugs or not)


listen what... changing the publish settings to AS3 all is working. doesn't sound a great solution.. it is definitly a bug
Was This Post Helpful? 0
  • +
  • -

#9 lht001300000  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 31-August 09

Re: gotoAndPlay stops instead playing...

Posted 31 August 2009 - 10:15 AM

i dont know if this help but just share my little experience to you

before i tried using the gotoAndPlay in flash CS4
actually im just doing little testing
i've create a movieclip of 15 frames
at frame 15 i added

gotoAndPlay(14)

into it and actually it got bugged....
it DOESNT PLAY, working like "gotoAndStop(14)"

im sure there is nothing other than gotoAndPlay i've added

so i try another way
adding gotoAndStop(14) at frame15 and play() at frame 14

testing it again, it give me strange result "the action script in this file will probably slow down your computer....."
this usually only appear for actionscript contain some looping like

gotoAndPlay(14) at frame 15 ,gotoAndPlay(15) at frame 14

how does

adding gotoAndStop(14) at frame15 and play() at frame 14

cause my computer to slow down...

the most ridiculous thing is that all these are sloved by
adding 1 frame between it like this

gotoAndPlay(13) at frame 15

then all things go extremely smoothly, nothing got halted...

how comes gotoAndPlay(13) is working but gotoAndPlay(14) does not even work

so i think the goto function is really bugged... or if i've done something wrong?? please point out my mistake to help me improve
Was This Post Helpful? 0
  • +
  • -

#10 joeshmmoe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-September 12

Re: gotoAndPlay stops instead playing...

Posted 01 September 2012 - 05:29 PM

I ran into the same problem. In my class I call
myMovie_mc.gotoAndPlay(1);
. The movie stops.

The solution was to put
play();
on the first frame of the timeline. Now it works :wacko:
Was This Post Helpful? 0
  • +
  • -

#11 joeshmmoe  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 01-September 12

Re: gotoAndPlay stops instead playing...

Posted 02 September 2012 - 12:20 PM

Okay the problem seems to be related to actionscript on the timeline and actionscript in my class.

If I have
stop();
on the last frame of my timeline and call
myMovie_mc.gotoAndStop(myMovie._totalframes);
then I lose control over the movieclip. If I call "gotoAndPlay()" after that from my class it will go to the frame and stop.

If I remove the actionscript from the timeline and only control it from my class, it works fine and plays.

Oops...

View Postjoeshmmoe, on 02 September 2012 - 12:18 PM, said:

myMovie_mc.gotoAndStop(myMovie._totalframes);


should read:
myMovie_mc.gotoAndStop(myMovie_mc._totalframes);

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1