gotoAndstop

  • classybird
  • Born
  • Born
  • classybird
  • Posts: 1

Post 3+ Months Ago

hi im trying to do a gotoAndStop on a movie clip called "cardone", based on variable (is it called a variable? ) called "card" which is a random number

its on the main time line and from there i have tried:

cardone.onEnterFrame = function () {
this. gotoAndStop (card);
}

ive tried this and it doesnot work but it works with a number inside of "card" so it must think "card" itsnt a number. ive also tried ([card]) and [card] does anyone know why it doesnt work? and what to do?

regards Steph
:( :(
  • stev_ro
  • Beginner
  • Beginner
  • User avatar
  • Posts: 61
  • Loc: ro

Post 3+ Months Ago

You must give card a value. If you need to be a random value then type this :
Code: [ Select ]
card = random(your_last_frame_number+1);
your_last_frame_number is the last frame from inside your cardone mc.
  • rockafromhell
  • Student
  • Student
  • rockafromhell
  • Posts: 70
  • Loc: Erie,Pa

Post 3+ Months Ago

cardone.onEnterFrame = function () {

this. gotoAndStop ("card");

}

im pretty sure u jsut needed it to be an expression beause its thinking your calling a frame number and you not your calling a framelabel.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

Code: [ Select ]
cardone.onEnterFrame = function () {
var card:Number = Math.round(Math.rand()*this._totalframes);
this. gotoAndStop (card);
}
  1. cardone.onEnterFrame = function () {
  2. var card:Number = Math.round(Math.rand()*this._totalframes);
  3. this. gotoAndStop (card);
  4. }

Your code doesn't work most likely because card is not defined in movie cardone. So either use this. gotoAndStop (_root.card) or a relative path to wehere it exist.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.