import fl.controls.Button import fl.controls.Label //1. create the instances var about_button:Button = new Button(); var story_button:Button = new Button(); var images_button:Button = new Button(); var name_label:Label = new Label(); //2. put them on the stage stage.addChild(about_button); stage.addChild(story_button); stage.addChild(images_button); stage.addChild(name_label); //3. move them to the right position about_button.move(20,100); story_button.move(20,400); images_button.move(20,600); name_label.move(70,20); //4. create labels for them about_button.label="About"; story_button.label="Story"; images_button.label="Images"; name_label.text="Mass Effect 2"; //5. add event listeners to the buttons about_button.addEventListener(MouseEvent.CLICK, loadAbout); story_button.addEventListener(MouseEvent.CLICK, loadStory); images_button.addEventListener(MouseEvent.CLICK, loadImages); //6. create loader and URLRequests var myLoader:Loader = new Loader(); stage.addChild(myLoader); myLoader.x=(800-550)/2; myLoader.y=100; var about_url:URLRequest = new URLRequest("about.swf"); var story_url:URLRequest = new URLRequest("story.swf"); var images_url:URLRequest = new URLRequest("image.jpg"); myLoader.load(about_url); //7. create functions to load the elements function loadAbout(e:MouseEvent):void{ myLoader.load(about_url); } function loadStory(e:MouseEvent):void{ myLoader.load(story_url); } function loadImages(e:MouseEvent):void{ myLoader.load(images_url); }