Connecting Tech Pros Worldwide Forums | Help | Site Map

movieclip.gotoAndPlay

chunk1978's Avatar
Familiar Sight
 
Join Date: Jan 2007
Posts: 226
#1: Feb 7 '08
ok... i've been trying to make this work for 2 days:

i have a scene with a button and a movie clip. the movie clip is called "MovieClip1". within the movie clip i've labeled a frame late in the clip called "Near End". i want my button to make the playhead goto that labeled frame within the movie clip but it does not.

the button has the following actionscript 2.0:

Expand|Select|Wrap|Line Numbers
  1. on (release) {
  2.     _root.MovieClip1.gotoAndPlay("Near End");
  3.     }
  4.  
what am i doing wrong?
nomad's Avatar
Expert
 
Join Date: Mar 2007
Location: CA.
Posts: 570
#2: Feb 7 '08

re: movieclip.gotoAndPlay


Quote:

Originally Posted by chunk1978

ok... i've been trying to make this work for 2 days:

i have a scene with a button and a movie clip. the movie clip is called "MovieClip1". within the movie clip i've labeled a frame late in the clip called "Near End". i want my button to make the playhead goto that labeled frame within the movie clip but it does not.

the button has the following actionscript 2.0:

Expand|Select|Wrap|Line Numbers
  1. on (release) {
  2.     _root.MovieClip1.gotoAndPlay("Near End");
  3.     }
  4.  
what am i doing wrong?


try this instead
on (release) {
this.gotoAndPlay("Near End");
}

nomad
chunk1978's Avatar
Familiar Sight
 
Join Date: Jan 2007
Posts: 226
#3: Feb 7 '08

re: movieclip.gotoAndPlay


Quote:

Originally Posted by nomad

try this instead
on (release) {
this.gotoAndPlay("Near End");
}

nomad

nope, doesn't work... i've tried this. _root.this.gotoAndPlay("Near End"); _root.MovieClip1.gotoAndPlay("Near End");... nothing works... i'm wondering if i need to somehow change the properties of the MovieClip1 MC, so that actionscript can use it? i've called the MovieClip1 instance onstage "MovieClip1" but it's just not being called.
nomad's Avatar
Expert
 
Join Date: Mar 2007
Location: CA.
Posts: 570
#4: Feb 7 '08

re: movieclip.gotoAndPlay


Quote:

Originally Posted by chunk1978

nope, doesn't work... i've tried this. _root.this.gotoAndPlay("Near End"); _root.MovieClip1.gotoAndPlay("Near End");... nothing works... i'm wondering if i need to somehow change the properties of the MovieClip1 MC, so that actionscript can use it? i've called the MovieClip1 instance onstage "MovieClip1" but it's just not being called.

is the MovieClip1 MC in the same scene?

nomad
chunk1978's Avatar
Familiar Sight
 
Join Date: Jan 2007
Posts: 226
#5: Feb 7 '08

re: movieclip.gotoAndPlay


Quote:

Originally Posted by nomad

is the MovieClip1 MC in the same scene?

nomad

yes, it's in the same scene... i have no idea why something so simple is not working... it's making me crazy
chunk1978's Avatar
Familiar Sight
 
Join Date: Jan 2007
Posts: 226
#6: Feb 7 '08

re: movieclip.gotoAndPlay


Here is a small FLA file which shows you what i'm trying to do:

essentially there's an if/else statement block on the button, but the main timeline stops at frame 40.

i'm trying to make the button direct the playhead to the "Red" frame label within the MC movie clip, but anyway i try to write it it just isn't working. i know i can do this by not making a MC in the first place and just use the main timeline, but this is a small example of a much larger project, so i have to have it work this way.

so any thoughts of what i'm doing wrong?
chunk1978's Avatar
Familiar Sight
 
Join Date: Jan 2007
Posts: 226
#7: Feb 23 '08

re: movieclip.gotoAndPlay


it seems my flash install is crazy... i switched my movie properties from AS2 to AS3, and then back again, and now everything works as expected... strange...
Newbie
 
Join Date: Feb 2008
Location: Sweden
Posts: 2
#8: Feb 25 '08

re: movieclip.gotoAndPlay


Hello...Chunk ..

I did notice that you managed your problem, now am wondering if you could be kind enough to help me...

I made a flash photo gallery with( thumbnail,xml). now the problems is that I have to implement zoom in / out buttons on in the gallery. How do I go about?

thanks in advance!!

(am a student, beginner with flash)
Reply


Similar Flash / Actionscript bytes