//import fl.controls.Button //import fl.controls.Label //1. create the instances //(korvaa piirrettyjen buttonien instance-nimillä kohdat 1-3 ja comment them.Do it manually. U need eventlisteners.) //You can combine the both exercices. //var about_button:Button = new Button(); //var story_button:Button = new Button(); //var images_button:Button = new Button(); //var photographs_button:Button = new Button(); //var paintings_button:Button = new Button(); //var installations_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(photographs_button); //stage.addChild(paintings_button); //stage.addChild(installations_button); //stage.addChild(name_label); //3. move them to the right position //about_button.move(20,100); //story_button.move(20,150); //images_button.move(20,200); //photographs_button.move(20,250) //paintings_button.move(20,300) //installations_button.move(20,350) //name_label.move(70,20); //4. create labels for them //about_button.label="About"; //story_button.label="Story"; //images_button.label="Images"; //photographs_button.label="Photographs"; //paintings_button.label="Paintings"; //installations_button.label="Installations"; //name_label.text="Minna Alaluusua"; //5. add event listeners to the buttons artiststatement_btn.addEventListener(MouseEvent.CLICK, loadArtiststatement); paintings_btn.addEventListener(MouseEvent.CLICK, loadPaintings); //installations_btn.addEventListener(MouseEvent.CLICK, loadInstallations); //photographs_btn.addEventListener(MouseEvent.CLICK, loadPhotographs); //performances_btn.addEventListener(MouseEvent.CLICK, loadPerformances); //drawings_btn.addEventListener(MouseEvent.CLICK, loadDrawings); videos_btn.addEventListener(MouseEvent.CLICK, loadVideos); //mediaprojects_btn.addEventListener(MouseEvent.CLICK, loadMediaprojects); cv_btn.addEventListener(MouseEvent.CLICK, loadCv); contact_btn.addEventListener(MouseEvent.CLICK, loadContact); //6. create loader and URLRequests var myLoader:Loader = new Loader(); stage.addChild(myLoader); //sijoita loader näin //myLoader.x=(800-550)/2; myLoader.x=159; myLoader.y=70; var artiststatement_url:URLRequest = new URLRequest("artiststatement.swf"); var paintings_url:URLRequest = new URLRequest("paintings.swf"); var installations_url:URLRequest = new URLRequest("installations.swf"); var photographs_url:URLRequest = new URLRequest("paintings.swf"); var performances_url:URLRequest = new URLRequest("paintings.swf"); var drawings_url:URLRequest = new URLRequest("paintings.swf"); var videos_url:URLRequest = new URLRequest("m_videos.swf"); var mediaprojects_url:URLRequest = new URLRequest("paintings.swf"); var cv_url:URLRequest = new URLRequest("cv.swf"); var contact_url:URLRequest = new URLRequest("contact.swf"); myLoader.load(artiststatement_url); //7. create functions to load the elements function loadArtiststatement(e:MouseEvent):void{ myLoader.load(artiststatement_url); } function loadPaintings(e:MouseEvent):void{ myLoader.load(paintings_url); } function loadInstallations(e:MouseEvent):void{ myLoader.load(installations_url); } function loadPhotographs(e:MouseEvent):void{ myLoader.load(photographs_url); } function loadPerformances(e:MouseEvent):void{ myLoader.load(performances_url); } function loadDrawings(e:MouseEvent):void{ myLoader.load(drawings_url); } function loadVideos(e:MouseEvent):void{ myLoader.load(videos_url); } function loadMediaprojects(e:MouseEvent):void{ myLoader.load(mediaprojects_url); } function loadCv(e:MouseEvent):void{ myLoader.load(cv_url); } function loadContact(e:MouseEvent):void{ myLoader.load(contact_url); } stop();