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

flash actionscript

group:

Simple Actionscript Help Needed! GotoandPlay


Simple Actionscript Help Needed! GotoandPlay sledgeweb
2/2/2004 9:35:11 PM
flash actionscript:
Hello-

I have a scene that stops on frame 20 (actionscript "stop();").

In that scene are 4 movie clips that make up a directional compass. Each movie clip has an actionscript that reads "gotoandplay(10);". But, it doesn't work. It never leaves frame 20. I think the movie clips are trying to go to frame 10 of the movie clip and not of the scene. So, I tried "gotoandplay("Scene 1", 10);" ... but still no go. Am I doing something wrong? What do I need to do to get an actionscript contained within a movie to do a gotoandplay for the scene?

Thanks!

Re: Simple Actionscript Help Needed! GotoandPlay eonyron
2/3/2004 6:25:16 AM
_root.gotoAndPlay(10);

Re: Simple Actionscript Help Needed! GotoandPlay sledgeweb
2/3/2004 1:48:21 PM
Thanks, works like a charm now. I thought it would be something simple...

Thanks again,
Sledge

Re: Simple Actionscript Help Needed! GotoandPlay Rothrock
2/3/2004 2:07:39 PM
Also remember that gotoAndPlay(); is case sensitive. And personally I don't like to use _root.

The reason I don't like to use it is that if later you decide to load that swf into another, well then _root will be the _root of the loader, not the loaded movie. Of course there is this new lockroot thing in 7, but I haven't used it.

Depending where the Actionscript was I might have used _parent.gotoAndPlay(10); instead.

Re: Simple Actionscript Help Needed! GotoandPlay eonyron
2/4/2004 7:24:04 AM
No problem sledgeweb!
Would love to see your work seems you got a good bead on what your doing!

And also your question is not a simple thing, just check the post above! It can become a very complicated issue. But my opinion is to never fear the dreaded _root!

I even stand fearless using root in linux/unix!

Mostly to my own detriment by the way, but how else am I gunna learn this craziness?

Re: Simple Actionscript Help Needed! GotoandPlay sledgeweb
2/4/2004 1:38:41 PM
Heh, I definitely don't have things under my belt yet. I'm a fairly decent PHP programmer, but actionscript is new to me. I just learned about the loadVars object... which I'm finding to be more useful than the loadVariables function.

Right now I'm just doing a little multiplayer game project for myself as a learning challenge. So far, I've got player icons on a map that you can use with a directional compass. If you get close enough to another player, it will show their icon on the map - otherwise they are out of sensor range and do not appear on the map. All the player's position data is stored in a mysql database, along with their team affiliation. Their icon on the map will be one of three colors depending on their team affiliation. I'm using loadVars to load a php page and query the database, returning results to flash.

It's nothing that amazing, but for me, it's a lot of progress already.

AddThis Social Bookmark Button