1 / 17

Advanced Actionscript for Flash 5 by Dr SC Li

Advanced Actionscript for Flash 5 by Dr SC Li. Exercise 1 (Creating sound objects). Download and unzip the file sound1-ex.zip Open the library window by clicking Windows > Library

thea
Télécharger la présentation

Advanced Actionscript for Flash 5 by Dr SC Li

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Actionscript for Flash 5by Dr SC Li

  2. Exercise 1(Creating sound objects) • Download and unzip the file sound1-ex.zip • Open the library window by clicking Windows > Library • To establish a linkage for the sound symbol, highlight “technoloop” and right click it and choose the “Linkage” option. • To create an action for Frame 1: Highlight Frame 1 and right click it, then choose “Actions”

  3. Exercise 1(Creating sound objects) • Select the “Expert Mode” for the script editor and type in: • function mysound(music){ • soundobject=new Sound(this); • soundobject.attachSound(music); • soundobject.start(0,50); • soundobject.setVolume(100); • } • mysound("soundtrack")

  4. Exercise 1(Creating sound objects) • To select buttons from the Common Libraries, click Windows > Common Libraries > Buttons > (Oval) Button Set • Drag the “Oval-stop” and the “Oval-play” symbols on to the main stage • To create an action for the stop button: highlight and right-click it, then select “Actions”. • On the script editor, type in: • on (press){ • _root.soundobject.stop("soundtrack"); • }

  5. Exercise 1(Creating sound objects) • Save and preview the file.

  6. Exercise 2 (Creating simple controls for sound object) • Download and unzip the file sound2-ex.zip • To select buttons from the Common Libraries, click Windows > Common Libraries > Buttons > (Rectangle) Button Set • Drag two “Grey-button Play” symbols (volume-up; volume-down) on to the main stage • To create actions for the buttons: highlight and right-click it, then select “Actions”.

  7. Exercise 2 (Creating simple controls for sound object) • For the volume-up button, type in: • on (press){ • dummy=_root.soundobject.getVolume; • _root.soundobject.getTransform(); • mySoundTransformObject.ll= • mySoundTransformObject.ll+10; • mySoundTransformObject.rr= • mySoundTransformObject.rr+ 10;

  8. Exercise 2 (Creating simple controls for sound object) • if(mySoundTransformObject.ll <= 100 && mySoundTransformObject.rr <= 100){ • _root.soundobject.setTransform( • mySoundTransformObject); • } • }

  9. Exercise 2 (Creating simple controls for sound object) • For the volume-down button, type in: • on (press){ • dummy=_root.soundobject.getVolume; • _root.soundobject.getTransform(); • mySoundTransformObject.ll= • mySoundTransformObject.ll-10; • mySoundTransformObject.rr= • mySoundTransformObject.rr- 10;

  10. Exercise 2 (Creating simple controls for sound object) • if(mySoundTransformObject.ll >= 0 && mySoundTransformObject.rr >= 0){ • _root.soundobject.setTransform( • mySoundTransformObject); • } • } • Then save and preview the file

  11. Exercise 3(Creating sound preloader) • Download and unzip the file sound3-ex.zip • Create a pre-loading animation while the sound movie clip is being downloaded. • Open the “attachsound.fla” file and insert a key fame for Frame 1. • Drag the preloading symbol onto the stage and name the instance as “preloader”. • Insert an action for the preloader instance:

  12. Exercise 3(Creating sound preloader) • onClipEvent(load){ • loadMovieNum("soundsource3.swf",1) • } • onClipEvent(enterFrame){ • percentloaded=Math.floor( • (_level1.getBytesLoaded()/ • _level1.getBytesTotal())*100); • percentdisplay=percentloaded + "%”;

  13. Exercise 3(Creating sound preloader) • if(percentloaded == 100 && !initialize){ • _level1.mysound("soundtrack") • initialize=true; • _visible=false; • } • } • Save and preview the file

  14. Exercise 4(Creating smart MC movie clip) • Download and unzip the file smart-mc-ex.zip • Open the file “smart-mc.fla”and create a smart MC flash movie clip as shown in http://ited.hkubu.edu.hk/hkbu-ited/session5/actions/smart-mc/smart-mc.swf

  15. Exercise 5(Creating simple scrolling text) • Download and unzip the file scrolltext1-ex.zip • Open the file “scrolltext1.fla”and create a movie clip with scrolling text as shown in http://ited.hkubu.edu.hk/hkbu-ited/session5/actions/scrolltext1/scrolltext1.swf

  16. Exercise 6(Creating auto scrolling text 1) Download and unzip the file scrolltext2-ex.zip • Open the file “scrolltext2.fla”and create a movie clip with auto-scrolling text as shown in http://ited.hkubu.edu.hk/hkbu-ited/session5/actions/scrolltext2/scrolltext2.swf

  17. Exercise 7(Creating auto scrolling text 2) Download and unzip the file scrolltext2-ex.zip • Open the file “scrolltext3.fla”and create a movie clip with auto-scrolling text as shown in http://ited.hkubu.edu.hk/hkbu-ited/session5/actions/scrolltext2/scrolltext3.swf

More Related