Skip to main content
Inspiring
October 31, 2013
Answered

Is there a way to find a stop(); function call in a frame?

  • October 31, 2013
  • 1 reply
  • 1539 views

Hello all, and thank you in advance for any assistance you can provide.

Background:

I have two functions built into a root swf; one stops all nested movie clips loaded into the root swf and the other plays all nested movie clips loaded into the root swf.

The stop function performs perfectly. Clips that are playing stop and clips that are not playing do nothing (as expected).

The play function works very well except for one issue.

I have modified the play function so that it checks each movie clip to see if the current frame is 1 or if the current frame is equal to the total number of frames in the movie clip.

This keeps the play function from playing clips that may be on the stage but have not started playing yet, or re-playing clips that have already completed their animation but are still on the stage.

Issue:

The  issue I am having with the play function is when I am dealing with nested movie clips that have been created to be part of a sub-navigation.

For example; I have a movie clip named BOB. BOB has ten frames.

In staggered layers there is a movie clip in each frame of BOB that has its own animations and sub-navigation controls.

When I use the stop function, it stops all animations as expected.

BUT when I use the play function, it goes to the next frame of BOB, rather than simply playing the current frame's animation as it would normally do.

Code:

Unfortunately, I cannot copy the function here because of access limitations from the source.

However, here is an example of the IF statement I am using to control the playing of all movie clips.

if (typeOf(mc) == movieclip && mc._currentframe != mc._totalframes && mc._currentframe != 1){

name_playAll(mc)

I need to add one more delimiter to my play function to account for existing stop() function calls so that I can make the play function ignore movie clips if the current frame has a stop(); in it.

Is there a method to account for existing stop() function calls?

Again, thank you in advance for any suggestions you may have.

This topic has been closed for replies.
Correct answer kglad

no, stop() is a movieclip method, not a boolean variable and it returns void.

when you apply a stop() to a timeline, use:

var stopped:Boolean=true;

if you latter apply a play(), you should update stopped to false.

1 reply

kglad
Community Expert
Community Expert
October 31, 2013

no, there's no such thing.

however, you could add your own boolean which would indicate a stop() has executed.

Inspiring
October 31, 2013

Isn't the stop(); function itself a boolean?

I mean, essentially, either a stop is true or false. Something is either stopped or it isn't.

But to follow on your reasoning, how would I add a boolean to indicate a stop?

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
October 31, 2013

no, stop() is a movieclip method, not a boolean variable and it returns void.

when you apply a stop() to a timeline, use:

var stopped:Boolean=true;

if you latter apply a play(), you should update stopped to false.