Finally getting back into web banners. I made a banner with a dynamically created disclaimer at the end. (clicking on the 'important info' button attaches a new div to the stage that can scroll the really long disclaimer).
The timeline is set to loop after a few seconds. Once it loops, though, the close button of the disclaimer no longer works. Any idea why?
I've uploaded a reduced file with the issue.
can access the .fla file here:
(Forum will not allow me to attach the file directly for some reason)
you're probably re-adding that listener creating more and more copies of that div each time you enter that frame.
prevent that by using:
//add your listener here
this.alreadyExecuted = true;
It looks like the issue was actually with the function creating the listener that creates the popup div and not the one adding the listener to the close button. (It's funny that the div-creator button still worked, but not the close button!) I used your check on that first function and it seems to work.
I'm still so confused by how variables work locally v globally in Animate!
the issue was you were probably creating multiple objects with the same reference because of the multiple listeners and the close button couldn't reference multiple objects with the same reference.