A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: can't remove child ?!

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    2

    can't remove child ?!

    I don't know why it doesn't work and I'm going crazy with my problem.

    Here comes the fakts:
    • 3 SWF movies
    • First movie starts with addChild. This contains a loader to open the second movie. The second movie also addChild with a loader inside to open the last one. So when I remove the child wich I opend in the first movie the child of the second movie doesn't remove... What are my fault?


    Here are the code:

    Fist Movie Contains a Button and the function to remove the child
    Code:
    stop();
    var loader:Loader = new Loader();
    var url:URLRequest = new URLRequest();
    var newPageToLoad:MovieClip = new MovieClip(); 
    addChild(newPageToLoad);
    url.url = "startStage.swf";
    loader.load(url);	
    newPageToLoad.addChild(laden);
    
    function PageRemove(e.MouseEvent):void {
    newPageToLoad.removeChildAt(0);
    //newPageToLoad.removeChild(loader); // ALSO TESTED
    }
    Second Movie opens another
    Code:
    stop();
    var loader:Loader = new Loader();
    var url:URLRequest = new URLRequest();
    var secondPageToLoad:MovieClip = new MovieClip(); 
    addChild(secondPageToLoad);
    url.url = "secondMovie.swf";
    loader.load(url);	
    secondPageToLoad.addChild(loader);
    Third Movie contains something

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center