1 / 20


Flash . Resources. ActionScript Source Code http://www.actionscript.org/ YouTube Tutorials http://www.youtube.com/watch?v=Z7bAzxPuQME http:// www.flash-template-design.com/create_scroll.php http:// www.senocular.com/flash/source/ http ://flashexplained.com/category/actionscript /

Télécharger la présentation


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.


Presentation Transcript

  1. Flash

  2. Resources • ActionScript Source Code http://www.actionscript.org/ • YouTube Tutorials http://www.youtube.com/watch?v=Z7bAzxPuQME • http://www.flash-template-design.com/create_scroll.php • http://www.senocular.com/flash/source/ • http://flashexplained.com/category/actionscript/ • http://flash.editme.com/TryThis

  3. Key Terms • Frames • Frame rate • Key Frame • Actionscript • Buttons • Movie clips • Motion Tweening • Shape Tweening • Masks

  4. Actionscript3 - Targetting'root' or 'parent' timelines • How to target the 'root' or 'parent' timelines from within a movieclip. the old actionscript method of using [for example] "_root.gotoAndPlay("intro");" or "_parent.gotoAndStop(3);" no longer works in actionscript3. Copy this code and paste it in your HTML • // send root timeline to play frame 3 • MovieClip(root).gotoAndPlay(3); • // send root timeline to stop on frame "intro" • MovieClip(root).gotoAndStop("intro"); • // send the current timeline's 'parent' to play frame 3 • MovieClip(parent).gotoAndPlay(3); • // send the current timeline's 'parent' to stop on frame "intro" • MovieClip(parent).gotoAndStop("intro"); • // when traversing a long list of nested 'parent' timelines, just string • // as many together as you need - separated by dots. for example... • MovieClip(parent.parent.parent).gotoAndPlay(3); • //or... • MovieClip(parent.parent.parent).gotoAndStop("intro");

  5. Show & Hide a Movie Clip varmyGloves:gloves = new gloves(); clothing.glovesBtn.addEventListener(MouseEvent.MOUSE_OVER, showGloves); function showGloves(event:MouseEvent):void clothing.glovesBtn.addEventListener(MouseEvent.MOUSE_OUT, hideGloves); { addChild(myGloves); myGloves.x=50; myGloves.y=50; } function hideGloves(event:MouseEvent):void { myGloves.unload(); }

  6. Movie Clip Events

  7. Button Events

  8. Actions - changing an objects properties A property is a piece of an object. Most objects are simply collections of properties. Examples of some properties are: • how wide it is (_width) • where it is on the stage (_x and _y) • what frame is currently being played (_currentframe) • how transparent it is (_alpha) • its name (_name) • whether it's visible or not (_visible) • _xscale or _yscale • Rotation (_rotation) • Colour (text or fill)

  9. Actions - Methods • A method is something an object can do or something you can do to an object. For example, here are some things methods can do: • Stop a movie clip i.e. stop() • Go to a certain frame and start playing at gotoAndPlay(frame) • See if a movie clip is over another movie clip i.e. • Hide the mouse cursor • Set the volume of a sound being played • Turn sound off and on • For example: Let's go to frame 10 of the clue movie clip and start playing from there: clue.gotoAndPlay(10); The method here is gotoAndPlay. All methods live inside objects—they don't exist on their own.

  10. Mask Mask Shape Light Version of the Image Dark Version of the Image

  11. Drag and Drop on(press) { startDrag(this); _root.answer1="";} on(release) { stopDrag(); if (this._droptarget == "/bow") { _root.answer1="Correct"; } else{ _root.answer1 = "wrong"; } }

  12. ScrollBar • http://www.flashdesignerzone.com/tutorials/t1033.php • http://www.knowflash.com/content/view/135/27/

  13. Example: Animation Script Onload() Play sky movie clip from frame 1 Play sound clip – wind blowing (only once) Home Button OnRollOver() Plays a sound Rotate home button

  14. Example Code • For example, the following code in Frame 1 of the main Timeline scales the ball object when myButton is clicked: myButton.onPress= function () { _root.ball._xscale = 200; _root.ball._yscale = 200; };

  15. Functions • Creating your own functions to perform code that can be used over and over again and tailored to your project • A function contains a set of instructions • Functions can contain parameters (but not all Functions have parameters) • Example:

  16. Conditional Statements • If …else

  17. Loops • For(i= 0:i<10: i++)

  18. Arrays

  19. 3D in Flash • http://www.kirupa.com/developer/actionscript/3dindex.htm • http://www.gotoandlearn.com/play.php?id=92 - 3D Flash carousel

More Related