Skip to main content
Participant
Oct 30, 2021 6:01 PM UTC
Answered

simple play button

Hi.  I have an animated story for children.  I simply want the animation to stop at different points and continue when I click a play button.   I've placed stop actions on the main timeline stop(); and I have a play button (instance name PlayButton)with the script below that works fine

//Play Function
function ClickPlay(Event:MouseEvent){
play();
}

//Call Play Button
PlayButton.addEventListener(MouseEvent.MOUSE_UP, ClickPlay);

 

However a problem occurs at scene 2.  I assumed I could simply use the same button and script but it doesn't work.  Do I need to make a new button with a different script for different scenes?

I know this is very basic but it's driving me mad 

    This topic is closed to new replies. Start a new post to keep the conversation going.
    kglad
    kgladCorrect answer
    Community Expert
    Nov 1, 2021 3:14 PM UTC

    no, but you need to (re)assign an instance name/listener to your button because the first frame of a new scene is like an empty keyframe.  it doesn't include any objects from the previous scene(s).

    3 replies

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    Nov 1, 2021 3:14 PM UTC

    no, but you need to (re)assign an instance name/listener to your button because the first frame of a new scene is like an empty keyframe.  it doesn't include any objects from the previous scene(s).

    Translate
    Participant
    Nov 9, 2021 11:54 AM UTC

    Thank you

    Translate
    kglad
    Community Expert
    Community Expert
    Nov 9, 2021 4:34 PM UTC

    you're welcome.

    Translate