Copy link to clipboard
Copied
Hello! I have been browsing the web to find an answer for quite a while now but can’t find a solution.
I am creating a banner with as3. It requires a close-button so that the user can click the button and close the ad.
It was very easy in as2 to do so. Could anybody help me out? I have created the button and tried different code snippets (event listener, fscommand("quit"), removing from the DOM). Thank you!
that doesn't really remove anything. there's still going to be white space occupied by the swf.
but, if that's acceptable you can do that with as3, too. in your button listener function use:
MovieClip(root).parent.removeChild(root);
Copy link to clipboard
Copied
if you're making an ad i'm not sure you'll be able to do what you want because you probably don't control the embedding html of the web page that's hosting your ad.
(and it wouldn't be any easier with as2.)
Copy link to clipboard
Copied
Hey kglad, thank you for your quick reply!
In my older version of flash I was able to use:
on(release){
_root.unloadMovie();
}
that worked just fine. Same banner specifications just older version of as. If I can’t find a solution I guess I have to reactivate my old laptop with my outdated flash version
Copy link to clipboard
Copied
that doesn't really remove anything. there's still going to be white space occupied by the swf.
but, if that's acceptable you can do that with as3, too. in your button listener function use:
MovieClip(root).parent.removeChild(root);
Copy link to clipboard
Copied
That was exactly what I needed. Thank you!
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now