can't figure out how to have multiple endings

  • mtg131g
  • Graduate
  • Graduate
  • mtg131g
  • Posts: 238

Post 3+ Months Ago

What I am trying to do is to use a button that if the timeline is between thse numbers then go to and play this and then if it is in another part of the time line when the button is released then it needs to go here and play this.

That is what I am trying to do but i can't get the action script to work right any suggestion on how to code for this idea?
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

add a button on the stage, name it's instance myButton, and in a key frame on the main timeline (the button must exists in that frame), add this code:
Code: [ Select ]
myButton.onPress = function()
{
  if ( (_root._currentframe > x1) && (_root._currentframe < x2) )
  {
     _root.gotoAndPlay(frameX);
  }
  else
  if ( (_root._currentframe > y1) && (_root._currentframe < y2) )
  {
     _root.gotoAndPlay(frameY);
  }
}
  1. myButton.onPress = function()
  2. {
  3.   if ( (_root._currentframe > x1) && (_root._currentframe < x2) )
  4.   {
  5.      _root.gotoAndPlay(frameX);
  6.   }
  7.   else
  8.   if ( (_root._currentframe > y1) && (_root._currentframe < y2) )
  9.   {
  10.      _root.gotoAndPlay(frameY);
  11.   }
  12. }
  • mtg131g
  • Graduate
  • Graduate
  • mtg131g
  • Posts: 238

Post 3+ Months Ago

Thanks I'll give that a try

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 9 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
 
cron
 

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