all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

stop(); won't always stop?


stop(); won't always stop? sitebyMIKE
4/26/2004 11:13:26 PM
flash actionscript:
Has anyone ever had the stop(); command not work consistently?

I'm building a large Flash presentation and there are certain pages that don't
stop even though they have stop(); as the first line of actionscript in the
first layer of the first frame. The only other bits of code are button actions
to progress the movie through the other frames.

The swf in question runs perfectly fine by itself, but will occationally not
stop on the first frame when it is loaded into the parent movie. It's being
loaded with a simple loadMovie("fileName", target). I'm using Flash MX 2004
and exporting to Flash 6 as per the client's specifications.

Sure, I could (and probably will) rework the flash file to use only one frame,
but I'm still curious as to why this might happen.

I've been doing flash since version 3 and I've never encountered this before.
Anyone have any ideas as to what could be causing this?
Re: stop(); won't always stop? rlc5611
4/27/2004 3:37:18 AM
If you put the following script in a frame, for example, the movie will not stop

stop();
play();

I find that I do not fully understand how the stop(); action works. It seems
stop only stops the playhead but still executes the frame including all its
action script.

If I put that script in frame 5, for example and in frame 1 put
gotoAndStop(5); it still won't stop. either in MX or MX2004

I will say that I have had to modify some code from MX to MX 2004 because it
did appear to me that what used to stop, stopped stopping but I got so hammered
in this forum that I don't like to talk about it. I do think that the stop()
always works as Jeckly says. I found my problems to be elsewhere (arising from
bugs in some of the components I was using and how they treat focus). While the
appearance was that the stop didn't work, the problem turned out to be far more
complex.
Re: stop(); won't always stop? rlc5611
4/27/2004 7:19:06 AM
Re: stop(); won't always stop? rlc5611
4/27/2004 10:19:20 AM
Yes all well and true but it still does and always will me mad. :(

Re: stop(); won't always stop? Jeckyl
4/27/2004 10:50:05 AM
stop() always works .. perhaps something else is doing a gotoAndPlay()

Re: stop(); won't always stop? Jeckyl
4/27/2004 1:59:51 PM
[quoted text, click to view]

Of course not .. you tell it to stop and then you tell it to play again.

[quoted text, click to view]

Yes .. you've got it .. all stop does is stop the automatic advacement to
the next frame

That's the way its always been in.

Re: stop(); won't always stop? Jeckyl
4/27/2004 5:31:18 PM
Its a matter of what is stopping :)

Stop in those days meant "stop the whole program from running and exit".
Here it means stop the timeline from advancing (as opposed to playing where
it automatically advances). It has nothing (directly) to do with script
execution .. just as gotoAndPlay does not behave like a 'goto' in
Fortran/Pascal/C/etc

[quoted text, click to view]
Fortran and Pascal programming days where a stop did just that - it stopped.

Re: stop(); won't always stop? LarryJean
5/24/2004 9:39:56 PM
Well then, what does stop a program compeletely from executing?
ie
if(!condition){
Bailout!();
Re: stop(); won't always stop? Jeckyl
5/25/2004 9:33:26 AM
Do you mean exit the player .. or stop all animation?

You can use javascript to shut down the page that the movie is in, or for
projector exe you can use fscommand to terminate the projector.

To stop all animation, you'd need to recursively tell all objects in the
movie to stop. Even then, the movie could have timer events that make
things play again. So it really needs to be designed so that you provide a
way of stopping the all the animation if that is what you want (eg. have
script that looks at a global variable and stops animation when that
variable has a particular value).

Re: stop(); won't always stop? LarryJean
5/25/2004 7:31:47 PM
im new to action script, in other program languages if you dont have certain
information you can exit the script and tell the user you need it for example
(See Code)

so i guess what im asking is how do you stop the action script from further
executing and/or tell the user he/she is dumb and needs to give input?

$somevar = GetInputfromuser();

if ! ($somevar) {
print "You didn't give any input, the program will now exit";
exit;
} else {
print "You gave input now i will do stuff with it";
$somevar = $somevar *294950952;
}
print $somevar;
Re: stop(); won't always stop? JoeSnow
7/27/2004 3:05:59 PM
Hi

i have just had the same probelm, first key Frame in a movie clip, every clip
is just skipping the first frame through out the movie. But it is recognising
the 2nd stop command on frame two of the same clip.

I have been working in flash for about 5/6 years and this is the first time i
have had this happen. Did you get any where with solving this problem?!...

Joe
Re: stop(); won't always stop? sitebyMIKE
8/1/2004 1:32:48 AM
I did eventually resolve this problem. ..to a degree...

It seems that I had a conflict with the pre-loader I was using. I was never
able to pinpoint the specific line of code that was causing the problem, but
the code opperated correctly again when I removed the preloader. I have since
rewritten the preloader from scratch and the problem with the stop(); command
has gone away.

Not much help in the way of specifics, but hopefully it will help you look to
see what code could be causing a conflict.
Re: stop(); won't always stop? rlc5611
8/2/2004 1:20:55 AM
For what it is worth, my problem turned out to be caused by the combobox. My
main movie has a combobox in it as well as other buttons and the user loads
other SWF's to higher levels. All those SWF's used to work correctly and stops
actually stopped. They still will UNLESS the user opens the combobox. Once the
combobox is touched, many of my normal buttons and movie clip actions do not
perform correctly from there on. It took months and pure chance to even
discover this and then a major overhaul of my swf's to work around it.
Re: stop(); won't always stop? mandingo
8/2/2004 1:26:22 AM
Yeah, all it takes is one gotoAndPlay(1) action in the wrong place and
everything can fall apart...

It is unlikely that the code is 'skipping' the first frame, it is far more
likely that one part of your code is scripted to do that but you just haven't
found it yet.
AddThis Social Bookmark Button