Skip to main content
redtangle
Inspiring
October 23, 2020
Question

Code now being attached to graphics

  • October 23, 2020
  • 3 replies
  • 226 views

In Animate 21, it now seems to be possible to have code attached to graphics if you're only changing the instance type on the stage.

I have a sequence of frame labels, and some prev/next buttons to go between them.
On the first label though, I use my prev button as a graphic, and on the last label I use the next button as a graphic, each time faded down so the user knows they can't be clicked on.

Since Animate 21 though, reaching the last frame label now has the eventListeners still attached to the graphic version from the same instance further back on the timeline when it was a button, which defies the whole point of graphics as being something less interactive.

    This topic has been closed for replies.

    3 replies

    Participating Frequently
    October 27, 2020

    @redtangle : Another simple way to handle this in your workflow could be just give different instance name on last frame(where we dont want interactivity)  so that this instance becomes different. Please try and see if it helps.

    kglad
    Community Expert
    Community Expert
    October 24, 2020

    you could check "new features" for an cc 2021 to see its listed.

    kglad
    Community Expert
    Community Expert
    October 23, 2020

    lol, another example of how enhancements/bug fixes can break someone's workflow.

     

    it's time for you to learn how to do this properly instead of using the work-around you used before:  remove the event listener (removeEventListener), when required.

    redtangle
    redtangleAuthor
    Inspiring
    October 23, 2020

    Yep ealier versions of this I had it doing the removeEventListener methods, but then thought why bother going through all that hassle, when my designer/animator can control the whole lot, just by swapping to a graphic. on the first and last sections as required. It meant we could stick with litteraly 3 lines of code to handle any eventuality, no need to add any config items to say how many sections this particular timeline has.

    I don't mind changing it back to the "proper" code using event listerners, I just can't work out if this is a bug, and therefore might be fixed in the future, or if there's some kind of intended logic behind it.