ARTDM 170 Week 8: Scripting Interactivity

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    ARTDM 170 Week 8: Scripting Interactivity - Presentation Transcript

    1. ARTDM 170, Week 8: Scripting Interactivity
      Gilbert Guerrerogguerrero@dvc.edugilbertguerrero.com/blog/artdm-170
    2. Homework
      Please put your .swf file in a folder with your last name and first initial
      Put the folder in my dropbox
      Example: smith-hmyAnimation.swf
    3. Open Flash
      Create a new ActionScript 3.0 document:MyObject.fla
      Create a new ActionScript file:MyObject.as
    4. Frame by Frame Animation
    5. Frame by Frame
      Create a new Movie Clip symbol
      Add keyframes for each new frame of the animation
      Drag the animation to the stage and test your movie
    6. Using Objects on the Stage
    7. Adding Objects
      Drag an instance of a symbol to the stage
      Name the instance: myObject
      Now you have an object that you can refer to in your code:myObject.x = 100;
    8. Dragging Objects
    9. Dragging
      Use functions to both start and stop the dragging as well as to add new event listeners:
      private function startDragging(event:MouseEvent) {stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);myCircle.startDrag();}private function stopDragging(event:MouseEvent) {stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging);myCircle.stopDrag();}
      The event listeners are added to the stage just in case the user moves around too quickly or somehow is not on the object when clicking or releasing the mouse.
    10. Throwing Objects
    11. Throwing Velocity
      To throw an object you want to make sure the values for velocity (moveX and moveY) are updated according to the where the user has moved the object and it’s change in location over time.
      private function trackVelocity(event:Event):void {
      moveX = myCircle.x - oldX;
      moveY = myCircle.y - oldY;
      oldX = myCircle.x;
      oldY = myCircle.y;
      }
    12. Homework, due Oct 14
      Create a Title and Description for your final project
      Create a new frame by frame animation
      Move your animation using scripts
    SlideShare Zeitgeist 2009

    + Gilbert GuerreroGilbert Guerrero Nominate

    custom

    92 views, 0 favs, 1 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 92
      • 84 on SlideShare
      • 8 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds
    • 8 views on http://www.gilbertguerrero.com

    more

    All embeds
    • 8 views on http://www.gilbertguerrero.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories