dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: AddChild movieclip to a frame

Threaded View

  1. #1
    Member
    Join Date
    Aug 2008
    Posts
    38

    AddChild movieclip to a frame

    I have a project with a preloader.swf which loads: buttons (a board), settings.swf and game.swf.
    I want when in preloader's frame 1, to be visible the buttons.
    when in preloader's frame 2, to be visible the settings.swf.
    when in preloader's frame 3, to be visible the game.swf.

    But, with addChild movieClips are loaded to the first frime.
    So I added in frame 1, a movieclip Container1, and the button are added to Container1 (Container1.addChild button etc).
    In frame 2 I have Container2 (Container2.addChild settings.swf).
    In frame 3 I have Container3 (Container3.addChild game.swf).

    But it doesn't set the size and position of buttons, settings.swf and game.swf.

    Code:
    function onLoaded(e:Event):void {		
    	var movie:* =LoaderInfo(e.currentTarget).content;		
    
    	//Set size
    	movie.width=1366;
    	movie.height=700;
    		
    	//Adding content to the movieClip Container3
    	Container3.addChild(movie);
    
    	//Set size again
    	movie.width=1366;
    	movie.height=700;
    
    	movie.gotoAndStop("start");
    
    	// set position
    	movie.top=0;
    	movie.left=0;
    
    		
    }
    Last edited by panoss; 05-09-2015 at 06:18 AM.

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