Skip to main content
Rik_TIAH
Participant
November 14, 2023
Answered

How would you prevent one movie clip playing while another is still playing in a parent animation?

  • November 14, 2023
  • 2 replies
  • 489 views

Hi everyone,

I'm just getting started with Adobe Animate and I've created an interface which has three sub menus which transition in/out depending on user interaction.
So, I click on option A and its sub items transition out of that to be viewable and clickable.
I then click on option B and option A's sub items transition back in while option B's sub items transition out to be clicked etc.

However, if I click on them in quick succession - ie, before the option A's sub items have fully transitioned out - then B's items will appear while A's are still in transition.

I feel like I need to set a parent variable which denotes when a transition is still happening and only allows interaction once any transition is complete. But my initial attempt to set a variable at the top level and then change it in a movie clip's javascript returned a variable definition error - likely a scope issue?

I'm going to keep trying things, but any thoughts on this would be really greatly appreciated!
Thanks in advance - my first post here, but I've read a fair few threads so far!

Notes: Project is HTML 5 Canvas, including three menu items created as movie clips to allow scale transitions and control interactions with sub items.
Menu toggling is controlled by script in the main timeline action layer, whereas sub-item interactions are controlled with script in the movie clips' action layers.

    This topic has been closed for replies.
    Correct answer kglad

    one (of several) ways; prevent rapid clicks.

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    November 14, 2023

    Hi.

     

    You can set the mouseEnabled and mouseChildren properties of your main Movie Clip instance that contains the submenus to false everytime the user chooses an option. Then you can place code in the last frame of the inner animations to set those properties back to true.

     

    Regards,

    JC

    Rik_TIAH
    Rik_TIAHAuthor
    Participant
    November 14, 2023

    Thanks both - @kglad gave me a different way of thinking about the problem and I like the idea of the mouseEnabled and mouseChildren properties you mentioned, @JoãoCésar17023019.
    While you were replying I also found this thread about disabling buttons which includes a parent function reference, which may also help me with the scope issue I was experiencing.
    Will report back when I've tested things further.
    Thanks!

    kglad
    Community Expert
    Community Expert
    November 14, 2023

    sounds good. and yes, there are several solutions to this.

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    November 14, 2023

    one (of several) ways; prevent rapid clicks.

    Rik_TIAH
    Rik_TIAHAuthor
    Participant
    November 15, 2023

    I wanted to say thanks again to @kglad and @JoãoCésar17023019.

    Once I'd found the proper syntax for referencing variables between functions and timelines in one animation, I was quickly able to disable the buttons while their transitions were playing - thus disabling rapid clicks!

    I clearly have a lot more reading to do in regards to mouseEnabled and mouseChildren and all the other properties available, but I'm greatly enjoying trying new (to me) things in Animate!

    Cheers all!

    kglad
    Community Expert
    Community Expert
    November 15, 2023

    congratulations on doing that!

     

    as you know, it's much more rewarding to solve problems yourself vs having the solution handed to you.  

     

    congratulations again.