Skip to main content
Participant
June 24, 2020
Answered

Dynamically Bring to Front in HTML5 Drag and Drop

  • June 24, 2020
  • 1 reply
  • 353 views

I am working on an HTML interactive that will teach schedules of reinforcement.  I am trying to figure out how to bring the current item selected ("mousedown") to the front.  All of the items are buttons contained inside a movie clip.  I have scoured this community and other sites and several different solutions, with no such luck.  Attached is my .fla.  Thank you for your time and help.

 

Here is a link to my .fla file: schedules interactive.fla

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    The line 47 of your code should be:

    e.currentTarget.setChildIndex(e.target, e.currentTarget.numChildren - 1);

     

    And you should also stop the main timeline even though you have only one frame. This is needed because in CreateJS 1.0 single frame Movie Clips loop continuously instead of just playing once. This causes the display list to reset over and over again.

     

    In an ideal scenario the suggestions above should work. But since when Animate updated to CreateJS 1.0 the display list seems to be very inconsistent when it comes to reorder instances, add and remove them.

     

    I reported these issues to the team once, but the problems are still happening.

     

    Please contact the devs through this link and let they know about it:

    https://adobe.allegiancetech.com/cgi-bin/qwebcorporate.dll?BPY8J4

     

    Hopefully they're gonna help us.

     

     

    Regards,

    JC

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    June 25, 2020

    Hi.

     

    The line 47 of your code should be:

    e.currentTarget.setChildIndex(e.target, e.currentTarget.numChildren - 1);

     

    And you should also stop the main timeline even though you have only one frame. This is needed because in CreateJS 1.0 single frame Movie Clips loop continuously instead of just playing once. This causes the display list to reset over and over again.

     

    In an ideal scenario the suggestions above should work. But since when Animate updated to CreateJS 1.0 the display list seems to be very inconsistent when it comes to reorder instances, add and remove them.

     

    I reported these issues to the team once, but the problems are still happening.

     

    Please contact the devs through this link and let they know about it:

    https://adobe.allegiancetech.com/cgi-bin/qwebcorporate.dll?BPY8J4

     

    Hopefully they're gonna help us.

     

     

    Regards,

    JC