PDA

View Full Version : Stupid Simple Problem I can't work out with gotoAndPlay();


TjOeNeR
08-31-2004, 07:30 PM
Hi everybody,

I'm kind of a SUPER-Noob in Flash MX 2004
I've worked with Swishmax for some time now, but I thought i'd better step over to Flash MX 2004.
Now, my problem is the next...
I've got a main scene and I want to play an animated movie clip on frame 1...
Now what is the best way to do this?
Some Basic Actionscript...
gotoAndPlay...
But does it have to be :
- clip.gotoandplay("start") (start is a label)
- clip.gotoandplay(start) (without "")
- telltarget(clip){gotoandplay();}

Or do I have to use framenumbers.

Thanx in Advance,
Belgium Noob

deQue
08-31-2004, 07:43 PM
You can either use myMovieClip.gotoAndPlay("frameLabel"); or myMovieClip.gotoAndPlay(#); A third option, which does not apply in your case, is using frameLabel as a variable, in which case you'll have to first set frameLabel to a string or number value, and then use myMovieClip.gotoAndPlay(frameLabel);

TjOeNeR
08-31-2004, 07:52 PM
thanx man.

framelabels do they have to be set with AS or can they be set by selecting a frame in the movieclip and setting it in the properties menu?

(That you get a little red flag :D)

deQue
08-31-2004, 08:08 PM
They have to be set at authoring time.

TjOeNeR
08-31-2004, 08:26 PM
I've attached a Zip File, doesn't seem to work...

But thanx

Maybe you could fix it with the zip...

deQue
08-31-2004, 08:45 PM
Your problem is two-fold:
1) you did not give an instance name to left_image. You do that by click on it on the change , and entering a name in the textfield under the dropdown on the left side of the properties panel.
2) You have a stop() command on the first frame of left_image. For some reason (due to a bug in Flash) when you put a stop command in a movie's first frame it sometimes does not respond to play commands, even reacts to them as gotoAndStop() instead.
So move your keyframe with the stop command to frame 2 if left_image, and give left_image an instance name.

TjOeNeR
08-31-2004, 09:04 PM
many many thanks
It works now

But with all the names:
-Name of Movie Clip
-Instance Name
-Name of Actionscript
-Classes

:confused:

deQue
08-31-2004, 09:13 PM
Yeah, I know what you mean. It takes time to get familira of all the difference double meanings Flash has.