Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Close-Button inside swf File

New Here ,
May 21, 2015 May 21, 2015

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!

TOPICS
ActionScript
980
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 21, 2015 May 21, 2015

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);

Translate
Community Expert ,
May 21, 2015 May 21, 2015

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.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2015 May 21, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 21, 2015 May 21, 2015

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);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 22, 2015 May 22, 2015

That was exactly what I needed. Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 22, 2015 May 22, 2015
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines