Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




GotoAndPlay Problem



Hello.
I have two scenes: scene1 and scene2
Inside scene1, wich has one keyframe with a stop();
on it, a MC is placed on stage. Inside this movie clip there is an animation, and after the animation has played, a button shows. this button should gotoAndPlay scene2

heres what I wrotte on this button:
on(press){
_root.gotoAndPlay("scene2",1);
}

but it didnt work.
how can i go to another scene from this button, wich is inside a movie clip?



FlashKit > Flash Help > Flash General Help
Posted on: 02-14-2004, 12:07 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

GotoAndPlay This...then...gotoAndPlay That? (transition Animations For Menus)
Hi all,

Quick question. How do I make my nav buttons trigger an animation that removes the main menu graphics(in an animated way) then loads up the graphics for the relevent section thats been selected?

All I can do is have the buttons click straight to the frame label with the relevent pages on them. I need to have an 'ending animation' for the main page to see first before continuing on.

Thanks for any help.

GotoAndPlay Works, But Now This.gotoAndPlay?
I want to but my navigation in the library. Then when a certain button gets clicked, I want to go to a certain scene.

So I have the action

on (Release)
{
_root.gotoAndPlay ("Scene 3", 1);
}

for the button in the library. This does not work. If I put this in Scene 1 on the first frame, it also doesn't work. Putting

gotoAndPlay ("Scene 3", 1);

there works.

So my question is: How do I change between scenes from a library button?

[MX04] GotoAndPlay Then GotoAndPlay
Newbie here... how would you do this...

if (_currentframe=="concept_stop" or _currentframe=="develop_stop" or _currentframe=="gallery_stop") {
gotoAndPlay(_currentframe + 1) THEN gotoAndPlay("develop_start");
} else {
gotoAndPlay("develop_start");

Basically, I want it to play the frame after the current frame until it stops, then play the develop start frame... how would you do that?

Help With If() And GotoandPlay()
Ok. I've been a programmer for many years and in many languages, but I seem to be SUCH A NEWBE when it comes to Action script.

What I am trying to do is set up a flash file that is made up of multiple scenes, and each time the flash file runs I want it to go to one of a set of random scenes in this file.

So, I started to come up with a what I thought was a solution. WOW... It doesn't work...

Here is the code. I'm using F5. The scenes are named "0", "1", "2", and "3". I threw in the "trace" (that didn't seem to help me while debugging this (that's another question I'll ask later) and the "unknown" scene was thrown in to also help with debugging.

The system always runs down and stops on the "unknown" scene.

Any help would be Greatly Appreciated.

Thanks,

William Howard

// Code start here ----

newscene = int(random(3));
trace ("newscene");
if (newscene == 0) {
gotoAndPlay ("0", 2);
}
if (newscene == 1) {
gotoAndPlay ("1", 2);
}
if (newscene == 2) {
gotoAndPlay ("2", 1);
}
if (newscene == 3) {
gotoAndPlay ("3", 1);
}
gotoAndPlay ("unknown", 1);

// Code ends here ----

Gotoandplay ?
i have 2 scenes and I am trying to go back to scene 1 from 2 and vice versa. I have this code on a button in scene 2, but it will not go back to scene 1, why? Do I need to use _root somewhere?

on (press) {
gotoAndPlay ("Scene 1", 1);
}

Gotoandplay )o:
i swear to god im going to kill someone if i dont figure this out soon.

gotoandplay does not work in my movies! i'm probably missing one little thing but it's pissing me off!

i want to assign gotoandplay on release of a button to a different scene, but i've tried everything and it does not work! is it just my version of flash?

excuse my newbieness here.

what is the proper way to do this?

is this right?

on (release) {
gotoAndPlay ("name of scene", 1);

}



where "1" is the frame of the scene i wish to play at

Gotoandplay
in a movie clip inside my main swf, i have a button that i want to go to and play at the frame labeled "main" in frame 1, in the button i put this


Code:
on (release) {
gotoAndPlay ("Scene 1", "main");
}
and it just reloads from frame 1, i also tried using 82 instead of "main" and it still did the same thing, am i doing something wrong?

GotoAndPlay
I'm having trouble with a button and gotoAndPlay

I have a button that is on a movie clip. I have placed that movie clip on the main timeline. What I'd like to do is when this button is hit for the main timeline to jump to a certain frame. I can't seem to get this to work, despite how easy it should be. I've tried using frame labels and just using the frame number. I've had the button do other things, such as changing the alpha on other movie clips that are also on the main timeline (just at least seeing if I can do something with the button).

I went into the normal mode for the actionScript in Flash 5 and have tried with putting the scene in there (despite that it's a one scene movie, just that the button is inside of a movie clip rather than directly on the main timeline). I also tried putting this.gotoAndPlay, but no luck. Any ideas?

Thanks

GotoAndPlay()
G'Day,
I am currently loading a menu onto a movie. That menu controls the bottom movie. The bottom movie has many scenes. When I press on one of the menu buttons to go to a particular scene and a particular frame on that scene, the whole thing craps itself and gets me VERY angry.
I'm using:

on (release)
{
tellTarget(_level0)
{
gotoAndPlay("products", 1);
}
}

What's all that about? Any help would be greatly appreciated!

GotoAndPlay Help.
I have a movie clip that I want to place on the stage three times. I want to control each one separately with three buttons. I've put a stop action in the first frame of each clip. How do I call them separately? By Instance name?
Please Help.
Thanks.

GotoAndPlay
I have a question. Is it possible to have a button, where by pressing it, you go to a certain frame, and after it passes a few frames, for it to skip to another frame somewhere else. I know this is possible, but can you do it all in the actionscript of the button. so, for example, it goes to frame 30 up to 40, and then skips to 60 and continues on. I hope i can get help, it would really do me a lot to know. Thanks

-Paul

GotoAndPlay
Sorry, such a dumb question. But, I've been playing for the last 2 hours trying to solve this problem. If anyone could help I would greatly appreciate it.
I just installed Swish and I'm stuck!

Simple; Scene 1, Create text called "Option 1", "Option 2" etc.

I imported .png images and turned them into spites with fade in animation.

Set action on text to "On Roll Over" ,"Tell Target/Image1"

Help files refer to "GotoAndplay" action, and I can't figure out where they are calling on the spite to run.

Summary; I want to roll over several text fields or buttons and have the specific image spite play.

Gotoandplay
I forgot how to use a variable or expression to tell the timeline to go to a specific frame. Anyhelp?

Mc.gotoAndPlay?
how do i target a mc to play a certain frame, from another mc?

-_root.a.gotoAndStop (2);
(doesn't work)

GotoAndplay
Hi,

I'm having trouble triggering a scene.
I use a scrolling menu, and when I give the instruction to the buttons in the scrollingmenu : on release gotoAndplay Scene(nameOfscene) frame(framenr) ,nothing happens.
I use a rollover command to slow the scrolling menu down when mouse is over.
But even when removing this code and use only on release goto scene there is no result.

When I put a button directly in to scene 1, without the scrolling window the command works fine.

When I want to trigger a movie from within the scrolling menu it works fine, but triggering a scene doesn't.

I use flash 5.

anyone has any idea's?

Gotoandplay Help Plz
I tried .root_gotoandplay() but after that all of the buttons wont let me change each ones gotoandplay even after i take the .root out. and it also gives me 2 errors that shouldent come up

Symbol=new window template, Layer=Layer 1, Frame=3: Line 1: Statement must appear within on handler
gotoAndStop(2);

Symbol=new window template, Layer=Layer 1, Frame=3: Line 1: Statement must appear within on handler
gotoAndStop(1);

and the on handler on the buttons is

on (release) {
gotoAndPlay(1);
}

plz help me! the last one that said put .root_ messed up my buttons!

GotoAndplay
Hi,

Pls help me.

My problem:
From my movieclip gotoAndplay maintimeline frame 2, How to do it?

Thanks

GotoAndPlay HELP
Hi guys

I have a multiple scene movie with a nested movie in each. This nested movie acts as a menu. The menu has 3 buttons. When a user clicks on the button I want the main movie to swap scenes. Is this do-able.

I can't get it to work with this code attached to each of the menu buttons:

on(press)
{
gotoAndPlay("kiwi",2);
}

"kiwi" is the name of my scene.

what am I doing wrong?

cheers

GotoAndPlay - Won't
Hi, I am using Flash MX althought I am publishing the movie as Flash 5.
I have a movie with 2 scenes "Intro" and "Main".
I have a couple of buttons inside a MC on "Main". One of the buttons I want to take me to frame 0 on "Main" and the other I want to take me to "Intro".
This is what I have but it is not working.

Code:
on(press){
_root.gotoAndPlay("Main", 0);
}
And


Code:
on(press){
_root.gotoAndPlay("Intro", 0);
}
I have even tried replacing the _root with _level0 and it still won't work. If you can help I would be grateful.
Thanks Lee

GotoAndPlay
I have assigned a button inside of a movie clip on the stage this action:

on (release) {
gotoAndPlay("level1", 1);
}

level1 is the scene name and i want to play frame 1. Am i missinbg something? Please post if further detail is need.
-thanks

GotoAndPlay...
... simply doesnt work on a simple animation. Fed up of this. Actually i happenned to make a small animation with motion tween with 40 frames. on frame 20, I have given stop(); with a button with the following script in it (Note: This button is on a movieclip)
____________________________________
on (release) {
nextFrame();
}
____________________________________
But this doesn't work. This is to make the movie work like forward play & reversed play. But this thing doesnt work. Simple script but causing lot of mental dismays. Please Help!!!!
Rgds
bhaskee

GotoAndPlay
Ok...so I'm beginning to get really irritated at Flash, and I have a feeling I'm doing something wrong that I'm completely unaware of. My movie just starts into a new scene, and the first thing I want it to do is to start playing a movieclip from a specific frame. I have tried so many things and it's not working.

If I do movieclip.gotoAndPlay(16) right from the first frame, it won't do anything. Also, if I do onClipEvent(load/enterFrame) { this.gotoAndPlay(16); } inside the actionscript for the movieclip itself, it still doesn't do anything. However, if I put something like movieclip.onrollover = function() etc, then it'll work. However, that doesn't help me because I want it to play as soon as the scene starts..any ideas what could be causing it not to play properly?

GotoAndPlay
Instead of just stating a frame, how do you specify a frame and scene for gotoAndPlay?

andy

GotoAndPlay?
I am having a problem with my script. I have a movie clip called "bullet" that is as follows:

Frame 1 - blank with a stop() command
Frame 2 - shows a bullet and has a sound
Frame 3 - shows the same bullet and does _x = _x - 8;
Frame 4 - gotoAndPlay(3);

Okay now in another script I duplicate that clip and tell the duplicated clip to gotoAndPlay(2); It goes to frame 2, but just stops! Here is the code:

_root.bullet.duplicateMovieClip("bullet"+ _root.count, _root.count+100); // duplicate bullet clip
_root["bullet"+ _root.count]._x = _root.yay._x - 34; // set x position
_root["bullet"+ _root.count]._y = _root.yay._y + 16; // set y position
_root["bullet"+ _root.count].gotoAndPlay(2); // play new clip from frame 2
_root.count = _root.count + 1; // increment counter

Now it works fine in the original clip if I do _root.bullet.gotoAndPlay(2); But why doesn't it work in the new duplicated clip? Any ideas???

GotoAndPlay
Hey.

I am working on this project . . . big whopty do, however i am having and issue, alright i have 4 MCs One inside another inside another . . . blah and blah till we get to the fourth MC now this MC consists of three layers, top one actionscript second one animation, third one is a button. all these layers spand 13 frames. This MC is actions and motion for a rollever button. The previous MC is just animation. With basic stop action on frame 10, it consists of 15 frames.

The problem i am having is that when i click this button which is in the fourth MC i need it to goto frame 13 in the previous MC, as you guess it is not. I have frame 13 in the third MC labeled Motion i have on this frame a stop action. so when button in fourth MC is pressed it does not goto frame 13 in previous MC. My actionsript on the button is:
on (rollOver, dragOver) {
btnPlay = true;
play();
}
on (rollOut, dragOut) {
btnPlay = false;
play();
}
on (release) {
gotoAndPlay(Motion);
}

I am not sure why it is not working, does anyone have any ideas that could be of assistance? I would Really Appritiate help. Thanks a lot.

GotoAndPlay() Help
i don't know what's wrong with me today.
i'm going through a serious brain fart.

basically what i'm trying to do is that i have different aerobic classes.
- i have on the main timeline a movie clip that plays when a button is pushed and has a condition if the variable "pic" is equal to a value.
- a movie clip on the main timeline called "slideshow"
- two movie clips inside the slide show movie clip called "step" and pilates"

i have set in the first frame the variable class to equal "step"

Code:
class = "step"
when i trace the variable named class it's displayed as step.


Code:
if (pic == 1) {
_parent.slideshow.class.gotoAndStop(1);
} else if (pic == 2) {
_parent.slideshow.class.gotoAndStop(2);
} else if (pic == 3) {
_parent.slideshow.class.gotoAndStop(3);
} else if (pic == 4) {
_parent.slideshow.class.gotoAndStop(4);
} else if (pic == 5) {
_parent.slideshow.class.gotoAndStop(5);
} else if (pic == 6) {
_parent.slideshow.class.gotoAndStop(6);
} else if (pic == 7) {
_parent.slideshow.class.gotoAndStop(7);
} else if (pic == 8) {
_parent.slideshow.class.gotoAndStop(8);
}
but wouldn't flash read class as what i declared it as ?
wouldn't flash look at it like it being:

Code:
_parent.slideshow.step.gotoAndStop(8);
so when i click another button then class will equal pilates.

my problem is that when i want it to gotoAndPlay a certain frame in the step or pilates movie clips but it won't.
please help.

thanks in advance

Gotoandplay
okay i have button in scene 2 and when i press it i would like it to go to scene 1. Now i have tried

on (press) {
gotoAndPlay ("Scene 1", 1);
}


this does not work. so i tired to label a frame in scene 1 and called it "menu" then used this action script

on (press) {
gotoAndPlay ("menu");
}

also tried

on (press) {
_root.gotoAndStop("menu");
}

which also doesnt work. am all out of ideas

GotoAndPlay()
Is there a reason that gotoAndPlay does not work in Clip event handlers? For instance:


Code:
onClipEvent(enterFrame) {

...other code stuff...

trace(_root.whereTo);
if (_root.whereTo == "house") {
gotoAndPlay("house", "start");
}


I think i've tried every possible workaround and just can not get gotoAndPlay to work in a clip handler. I know my coding is working because I get the correct message when then trace appears. Any and all help would be greatly appreciated.

Carl Gibson - rkitecsure@hotmail.com

GotoAndPlay();
onClipEvent(enterFrame) {
if (Key.isDown(Key.CONTROL)) {
_root.gotoAndPlay(framer);
}
}

This doesent work, i hate myself. I never get this to work. Any help?
The frame that i want to play is in the mc, the second frame of the MC.
I got an attachment too, jeehaa!
-_-
Thanks for the help!
flash mx

How To? GotoAndPlay
ok, in my time line i have a movie clip with text that rolls in and then there is a keyframe and then it rolls out. i want to know what kind of scripting i could use in the frame=
if (butten is pushed (in any level of the movie)) gotoAndPlay (next frame of the movie clip) while the mani timeline does its thing.

is it possible and if so whats the formula??????

Cheers

GotoAndPlay Bug
I'm using Flash 2004 Pro.

This should be a simple thing to do but it's not working:

I have a frame action on the root time line that tells a movie clip to go to a named frame and play.

_root.r_textWindow.gotoAndPlay("open");

It doesn't work. The same code works in a button but not as a frame action! I triple-checked spelling and syntax.

I encountered this problem before with a gotoAndStop for a frame to a clip. I've never had this problem in earlier Flash versions.

GotoAndPlay
Im having a problem in my movie clip.I want it to go to another movie once the playhead roll over a frame. Could someone tell me how to make this work.

Gotoandplay
Does anyone know if there's some kind of rule against jumping to a later frame?
On frame 5 I have


trace("this is frame 5");

if(bLoaded>=bTotal) {
  gotoAndPlay(10);
  trace("goto10 done");
}


In my output window I get



goto10 done
this is frame 1



What the hell is going on here??
Thanks in advance for any help!

GotoAndPlay
Half way through a Scene at a frame ive told the flash to go to another scene

just by writing:

gotoAndPlay("design",1);

but when it reaches the frame with this command it skips the scene i told it to go to and proceeds to the next one... what am i doing wrong?

[Help] GotoAndPlay
Hey,
Ive got an MC on the main time line, it has 11 frames in it, each time a object goes under a certain point on the main stage, it goes to the next frame in this MC (like a life bar).

But what i want is when it gets to the last frame (frame 11), to gotoAndPlay a frame on the main stage, (framed labbled "damage").

I thought it was this, but it dosent work

code: gotoAndPlay(_root.damage);

Thanks for any help you can give

GotoandPlay Help
i draw a box and convert is to button (with f8 and then select button)

next i do is giving it this script:


Quote:




stop()
on (keyPress "<Enter>") {gotoAndPlay("2")
};





and the only thing flash is telling me is:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 2: Mouse events are permitted only for button instances
on (keyPress "<Enter>") {gotoAndPlay("scene2")

what did i do wrong?

(btw.. im really bad at this scripting...)

GotoAndPlay
I'm using Flash MX 2004 on a PC. Haven't used Flash since v5 so everything is different. I'm trying to get a submit button when clicked goes to a frame within a movieclip and I don't know the updated ActionScript programming to make it do that. (The submit button in not active, all it is doing is going to a frame that says "username and password did not match.") Any help on this would be much appreciated. THANKS!!

GotoAndPlay
I'm using Flash MX 2004 on a PC. Haven't used Flash since v5 so everything is different. I'm trying to get a submit button when clicked goes to a frame within a movieclip and I don't know the updated ActionScript programming to make it do that. (The submit button in not active, all it is doing is going to a frame that says "username and password did not match.") Any help on this would be much appreciated. THANKS!!

GotoAndPlay In MC ?
I have a MC with 100 frames, and a stop() action in the 1st frame.
When the MC is instancied, it starts and imediately stops at the 1st frame. I would like to know if there is a way to make it run, later, with of MCinstance.gotoAndPlay (2) - because I tried that but it didnt work...

Thanks!

GotoAndPlay Help
arrite this is gonna sound dumb but the gotoAndPlay command does not like me.. this is one of my first files.. so okay here's the thing.. this file i was making a football playbook rite.. and in scene "Direct Snap" i got this go bak to menu button in the upper right hand corner that has a gotoAndPlay("Select",1); select being the scene i want it to go to to show the rest of the plays.. but instead of going to the scene i want it to.. it goes to this other scene.. the first one.. the one wit the preloader.. im attaching the file if anyone needs to see but i need help wit it

GoToAndPlay
Hello,

I have a flash site with buttons. When you click on a button, it points you to a spot on the timeline for that page like this...

on (release) {
gotoAndStop("neighborhoods");
}

So this loads a movie. But on that page, there's another menu list... and I want to go to another page on the timeline but it doesn't work. I've tried

on (release) {
gotoandplay("Scene 1", "artessa");
}

AND

on (release) {
gotoAndStop("artessa");
}

None seem to work. Am I doing something wrong?
Thanks,
-Meezee

GotoAndPlay
Does anyone know what would cause gotoAndPlay to work like gotoAndStop?

Here is my code:

test.gotoAndPlay(2);

test is a movieClip and I made sure to give it an instance name of "test".

Frame 1 of that movieClip has nothing in it and a stop(); action. Frame 2 through 8 has some text that fades in. Frame 8 has a stop(); action.

When I run the movie it goes to frame 2 of test and stops????

any thoughts?

thanks

Gotoandplay
On a layer in scene1 i have 4-5 different movie clips, all connected by a motion tween. When seeing it all on scene1, its a slideshow. Each movie clip has also a tween inside. What i want to do is... when the movie clips motion tween ends i want it to goto scene1 and play the next movie clip and so on.
Iam aware of the goto and play action (i apply it to the final frame of the movie clip) so i set the desired scene and frame but when testing the movie it seems like it goes to the movie clips frame and not in the scene1 timeline.
What did i do wrong?

Help With GotoAndPlay
Hello everyone, I was wondering if any of you could help me.

I have a script that gets the UTC time, and depending on the current time, it has to do an action.

I got the code to work this way:


Quote:




onClipEvent (load) {
myDate = new Date();
hours = mydate.getUTCHours();
if (int(hours) == 22) {
getURL("test.com", "_blank");
}
}




Using this script, the test page opens up regularly, if the hour is right.


What I need to do is instead of opening a page (getURL) I need the movie to gotoAndPlay at a particular frame depending on what time it is. I tried coding it this way but it doesn't work:


Quote:




onClipEvent (load) {
myDate = new Date();
hours = mydate.getUTCHours();
if (int(hours) == 22) {
gotoAndPlay(5);
}
}






Can anyone tell me why the movie does not go the frame specified and play, but it does open the url? Or is there a better way to have the file check the Universal time and go to a specific frame on the same file depending on the current time?


Any help is greatly appreciated. Thank you!!

GotoAndPlay
Can I use the GotoAndPlay function to play a frame in a timeline in another level. For example - I'm in Swf1 which is in Level(0) and I want to go to Swf2, frame "tabulate" on Level(1). Is this possible? Thank you.

Gotoandplay? WHAT THE ****? :*-(
I've been woorking with flash before (back when it was Flash 5). Just got Flash8.. And i can't make the things work....

When i try to make a button play a movie on press the movie the movie just starts and keeps running... And i cant make the movie start when i press the button it starts on its own.

My action is:

on (keyPress "<Enter>") {
gotoAndPlay("Scene 2", this.Test);
}

Please help me... I'm going nucking futs!!

GotoAndPlay In A MC
I want a button in a movie clip to gotoandPlay the frame in the movieclips timeline, and not goto frame 20 on the main stage. What do i add to it to make it go to the frame inside that MC's timeline?

Code:
on (release) {
gotoAndPlay(20);
}

Gotoandplay
I have a button and in action script i have :
on (release) {

gotoAndPlay(26);

}

I also have another layer with a stop action script at frame 25
when I press play in Flash Mx the stop script doesn't work but the button script will work. and when i export it or test it the opposite happens, it stops in the right place but the button will not work.
does any one know what i'm doing wrong or missing?

Gotoandplay
really easy question:

inside a movie clip on frame 2 i have a button appear which contains the code:

on (release) {
gotoAndPlay("Scene1",3);

}

because im trying to get it to navigate back to the scene 1 then onto frame 3, but i just seems to reload the movie (scene2) any1 got any ideas?

many thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved