all groups > flash actionscript > may 2005 >
You're in the

flash actionscript

group:

Funny Actionscript...


Re: Funny Actionscript... Jeckyl
5/1/2005 12:00:00 AM
flash actionscript:
It could well be that you are not taking into account the order that the
script in different places is executed. That is not surprising as MM do not
document it!!

Put trace statements in where you stop and gotoAndPlay are called, and you
will probably see that the stop() is executing AFTER the gotoAndPlay().

It is not uncommon for people to be bitten by this sort of problem.

Also, ensure you don't have some other script that you forgot about that is
also doing a stop. Its very easy to lose track of script in Flash.
--
Jeckyl

Re: Funny Actionscript... [AtomiK]
5/1/2005 12:00:00 AM
I think I might have found out what was causing my problem, but I don't think I
have control over fixing it. I think that my gotoAndPlay call executes before
the movie is all initialized. This is what my first frame on the root timeline
looks like:

stop();
stuff.gotoAndPlay(2);

And the animation works fine if I put this actionscript in a different frame
(like frame 3 instead of 1), and allow the root timeline to play up until that
point with the "stuff" movieclip on the stage from frames 1-3. Still, the
movieclip on the stage freezes at frame 2. This might just be that I have a bad
flash player installed, cause Im sure that im not the first to use that kind of
setup with calling a function in the 1st frame on root, and that Macromedia
would not let something like this go past beta testing.

Links to the file are:
http://atomik.serveftp.com/testing.fla
http://atomik.serveftp.com/testing.swf

Thanks

stop();
stuff.gotoAndPlay(2);
Re: Funny Actionscript... Jeckyl
5/1/2005 12:00:00 AM
The problem is EXACTLY what was suggested to you. And it is a problem in
your movie, not in Flash.

You have a stop in the first frame of the movieclip BUT the first frame of
the scene tells that movieclip to play. As the movieclip code executes
AFTER the scene level code, the movieclip code wins and so the last thing
done is the stop (from frame 1 of the movie). You can fix it by putting a
play() in frame 2 of the clip.

If you did what I said in my reply earlier, and traced out the actions, you
would have see this happening.

It is not a problem with MM or anything that should have been caught in
Flash beta. Its a problem in your movie that you didn't catch and fix.
Some people are very quick to blame Flash for problems in their own movies.
Of course, if Macromedia documented the order of code execution, then you
probably would have had a better chance of finding the problem ;););)
--
Jeckyl

Re: Funny Actionscript... [AtomiK]
5/1/2005 12:00:00 AM
Awesome, It's crazy how I've not had this happen to me before.

Re: Funny Actionscript... Jeckyl
5/1/2005 12:00:00 AM
you're welcome ... and you're certainly not the first to have this happen :)
That's why I had my suspicions that that was the problem .. I've seen it
many times before.
--
Jeckyl

Funny Actionscript... [AtomiK]
5/1/2005 12:00:00 AM
I don't know if this is just a bug, or if I am doing something wrong. I tested
a movie I created, and the gotoAndPlay command jumps to the frame where I want
it to start, but it does not play. I thought this was the fault of the file I
was editing, that maybe something got corrupted in it. But, when i created a
new movie and tried this very basic command, and it still did not play.

What I had to do to make it work suprised me a great deal, and is something I
have never even had to think about solving in my use of flash. So that the
movie does not play automatically when it is placed on the stage, I did what is
common practice: I put in a "stop();" command in the first frame. Then, when I
want the movie to play, I have to create a keyframe in frame 2 of the MC, and
place a "play();" action in that frame. If I try to do a gotoAndPlay(2)
targetting the movieclip, it acts like gotoAndStop(). What surprised me even
more is I tried this in different versions of flash, and it did the same thing!
I then opened an older project in .fla format, exported it and that one worked
fine!

I am obviously very confused on what is going on... and am wondering if anyone
has come across this sort of thing before. I am thinking about reinstalling
flash altogether.
Re: Funny Actionscript... David Stiller
5/1/2005 7:38:54 PM
[AtomiK],

[quoted text, click to view]

Based on that description alone, there must be something else going on
that you haven't mentioned. What I'm hearing doesn't make sense to me. Can
you reproduce these steps in a very simple FLA with nothing else going on,
then make the FLA available somewhere?


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

AddThis Social Bookmark Button