Skip to main content
cuppa_6117769
Participant
August 25, 2018
Question

trying to keep my timeline neat by creating a slideshow of buttons within a button

  • August 25, 2018
  • 1 reply
  • 185 views

so the title may be a bit confusing, but what im generally trying to do is make it so when i click this button, it turns into the next button, and that button turns into a different button when clicked, and so on. im trying to do this not on the main scene timeline though. what ive done is made a button, made a movie clip within it, then made all the different buttons and linked them with actionscript in the moveclip. but when i test it and try to click the first button, nothing happens. im pretty confused, so any help at all would be appreciated. thanks.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 25, 2018

use a movieclip with the first 'button' (actually just the shape/text you want) on frame 1 and subsequent shapes/text on subsequent frames.  put a stop() on frame 1 and use something like:

yourmovieclipbutton.addEventListener(MouseEvent.CLICK,clickF);

function clickF(e:MouseEvent):void{

switch (MovieClip(e.currentTarget).currentFrame){

case 1:

//do whatever

MovieClip(e.currentTarget).nextFrame();

break;

case 2:

//etc

}

}

cuppa_6117769
Participant
August 26, 2018

thanks, i figured it out though.

kglad
Community Expert
Community Expert
August 26, 2018

you're welcome.