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

removing loader from another timeline

Explorer ,
Feb 13, 2009 Feb 13, 2009

Copy link to clipboard

Copied

Hello

I am designing a site and one problem has been persisting for quite some time.
I want to remove an swf once a second page has been added
here is the website design
> a preloader loads my main menu , on the main timeline of my preloader.swf I create a new loader (loader1) and tell it load the URLRequest "menu.swf"
> The menu.swf loads, on menu.swf main timeline I create a click function (instantiates once a button has been clicked) that loads my second loader (loader2) and this loads the URLRequest "cast.swf"

I want cast.swf to replace menu.swf and remove it entirely but I cant figure out how to do it,
here is what I have tried inside the click function of menu.swf
(is this possible? can you write code to remove an swf if you are actually inside that swf's main timeline? )

removeChildAt(0); ( this only removes the bottom layer of the menu.swf)
removeChild(MovieClip(root).loader1); inside the click function ( this does not remove the menu.swf )

thanks v much
matt

TOPICS
ActionScript

Views

267

Translate

Translate

Report

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
LEGEND ,
Feb 15, 2009 Feb 15, 2009

Copy link to clipboard

Copied

LATEST
If you have a pointer to any display object, you can get it to remove like this:

displayobj.parent.removeChild(displayobj);

so, if you d still have loader1 kicking around as a variable. this should work:

loader1.parent.removeCild(loader1);


Votes

Translate

Translate

Report

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