;

PDA

Click to See Complete Forum and Search --> : Question on gotoAndStop()


Stephan P.
12-09-2002, 08:04 AM
Hi guys,

I'm trying something *very* simple, and I don't understand why it doesn't work as expected.


I create 4 empty frames.

I put this one single line of AS code on frame 1:
gotoAndStop(3);

On the remaining 3 frames, I just put one text string each that simply identifies the frame (like "This is frame 2").


Shouldn't the movie just jump to frame #3 and stop? I.e., the only thing you see is the text on frame #3?

When I play it in the web browser (flash player V6), (Crtl-SpaceBar), the movie first runs to the end, showing all frames, then stops at frame #2.

When I play it in the stand-alone Flash players V5 and V6 , it only displays frame #2. When I play it in the stand-alone Flash player V4, I only get an empty frame (but shouldn't gotoAndStop work in V4 also?).

I'm kind of having trouble understanding this behavior :)

Anybody out there who can shed some light? :)

I'm using the latest 3.60 beta, btw.

Stephan

Bob Hartzell
12-09-2002, 08:30 AM
Are tweens set to 0? It is best to name the key frames and use a goto with a frame name.

Stephan P.
12-09-2002, 09:06 AM
Hi Bob,

thanks for your reply.


Are tweens set to 0? It is best to name the key frames and use a goto with a frame name.

Only for the first frame did I set tweens to 0, the other frames have tweens set to 6.

I changed the movie (see attachment) and now labelled the frames ("start", "frame2", "frame3", "frame4"), using gotoAndStop("frame3") on frame "start".

When I play it in the web browser, the movie now jumps to "frame3", then goes to "frame4" (i.e. runs to the end), then stops at "frame3".

When I play it in the stand-alone Flash players V5 and V6 , it behaves correctly, i.e. it only displays "frame3".

When I play it in the stand-alone Flash player V4, I still only get an empty frame.

Stephan

Stephan P.
12-09-2002, 09:07 AM
Oops,

somehow the attachment got lost...

Stephan

Bob Hartzell
12-09-2002, 12:11 PM
Swf exports with action script are tagged as flash version 5.

Using goto commands with frame numbers is dangerous with tweens not equal to zero unless you carefully count the actual frames (key frames + tweens). That is why it is safer to use frame names.

It is possible that goto commands do not work well on the first frame.

johnie
12-09-2002, 08:44 PM
Its the Frame 0 Flash Player Bug. In the Browser Players Frame 0 (The first Frame) all frame actions are ignored the first time the movie runs. It is documented a documented bug in the Player. Adding a preloader fixes this.

As far as using numbered Frames for Goto and Stop- Agreed it is much safer to goto a frame as it is easy to miscount frames especially if you decide to later add some tweens or a preloader it will throw it off.

Stephan P.
12-11-2002, 11:27 AM
Bob and johnie:

thanks for your help!

Stephan