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

loader, unloading in AS3

Participant ,
Aug 22, 2010 Aug 22, 2010

hi all

very basic question:

if I load a swf using a loader, and that loaded swf covers my original load button, can I create a new button in the loaded swf that will be able to unload it?  in other words, can a swf unload itself?

thanks!

TOPICS
ActionScript
927
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
Engaged ,
Aug 22, 2010 Aug 22, 2010

sure, add the button and have it:

myLoadedSwf.parent.removeChild(myLoadedSwf);

HTH

-Ted

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
Participant ,
Aug 22, 2010 Aug 22, 2010

thanks for the quick help

cheers

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
Participant ,
Aug 22, 2010 Aug 22, 2010

looks like I need a bit more info...when I follow zeroskillz tip:

myLoader.parent.removeChild(myLoader);

I get an "access of undefined property 'myLoader'" when I publish the (child) swf

and that swf doesn't work then, once loaded....

any ideas?

thanks again

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
Participant ,
Aug 22, 2010 Aug 22, 2010
LATEST

....well, here's how I just got it to work--but it's not elegant:

this.parent.parent.removeChildAt(this.parent.parent.numChildren-1);

that's ugly!  and I imagine, not very flexible... any suggestions?

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