CIM264B Flash MX 2004 - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

CIM264B Flash MX 2004

Description:

... that control the Main Timeline or movie clips, make shows ... Movie Clips - you must give it an instance name and it must be present in the Timeline. ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 20
Provided by: a1587
Category:
Tags: cim264b | clips | flash | movie

less

Transcript and Presenter's Notes

Title: CIM264B Flash MX 2004


1
CIM264B Flash MX 2004
  • Week 2

2
Action Scripting
  • Internal Programming Language
  • Action Scripting enables you to create buttons
    that control the Main Timeline or movie clips,
    make slideshows with Forward and Backward
    buttons, link to other URLs on the Internet, load
    other movies into Flash, etc.
  • ActionScript can be attached to a button
    instance, a movie clip instance, or a keyframe in
    the Timeline.
  • ActionScript cannot be attached to an instance of
    a graphic symbol
  • Action Behavior Panel are used to add
    ActionScripts

3
Action Scripting
  • Planning your Script
  • What are you trying to do with the script?
  • What is it you are trying to affect?
    (movie?frame?button?)
  • What Script is most appropriate to create the
    desired result?
  • What makes this script occur in the movie?
  • Where should the script be attached?

4
Action Scripting
  • Action Panel - build ActionScripts that control
    your movie. This is where you create edit
    object or frame actions.
  • Window? Development Panels?Actions or F9

5
Action Scripting
Insert Target Path
Action Pane
Check Syntax
Replace
Auto Format
Find
Add
Show Code Hint
Script Pane
6
Action Scripting
Script Panel
7
Action Scripting
  • Behavior Panel gives you the ability to add
    specific functionality to movies quick and
    easily.
  • Several categories
  • Data
  • Embedded Video
  • Media
  • Movie Clip
  • Sound
  • Web

8
Action Scripting
  • Frame Action Scripts
  • You place an action in a keyframe in the
    Timeline. The Stop frame action is an example of
    a frame-based script which stops the playback
    head on the frame it is placed on.
  • Object Action Scripts
  • You can add actions to an object (the object
    must either be a movie clip symbol or a button
    symbol). They are attached to button and movie
    clip symbols as well as components. These actions
    usually require user interactivity to function
    (i.e. clicking a button).

9
Action Scripting
  • Creating a Dedicated Action Layer
  • You should keep your scripts organized on one
    layer dedicated to ActionScripts only. Name this
    layer "actions" and place it at either the top or
    bottom of your layer stack
  • The Stop Action
  • It allows you to stop the playbackhead on a
    frame. To begin playback, the user must click a
    button, key, etc. that starts playback again. Add
    the stop() action by selecting a frame in
    timeline and place a blank keyframe (F7) if
    required - if you don't, Flash will find the
    first previous keyframe to attach it to. In
    Global Functionsgt Timeline Control dbl. click
    stop. The action will be added to the scripting
    window.

10
Action Scripting
  • Using Frame Labels vs. Frame Numbers
  • GotoAndPlay and GotoAndStop can be scripted to
    go to a frame number or frame label.
  • Use unique frame labels that can be easily
    found in movies with multiple scenes .
  • Adding a Frame Label
  • Select the frame you wish to name and in the
    Frame field in the Property Inspector, type in
    the unique name.
  • Frame labels should not contain any special
    characters. Avoid spaces (or use an underscore)
    and keep them short and sweet.

11
Action Scripting
  • ActionScript Syntax ActionScripting is CASE
    SENSITIVE.
  • Naming Button Instances
  • You must name each button or movie clip instance
    you plan to control with scripting.
  • These names also need to be unique and should
    follow similar naming conventions as frame
    labels.
  • Name the instance of your button symbol by
    selecting the object on the stage and typing in a
    name in the Properties panel.
  • Instance names are NOT the same as a symbols
    library name. You may use the symbol's name but
    only once if you are bringing multiple instances
    of the same symbol to the stage.

12
Action Scripting
  • Interactivity and Actions
  • Events- actions, such as press, release,
    releaseOutside, rollOver, rollOut, dragOver,
    dragOut, keypress.
  • Event Handler Manages the event
  • Events fall into four catagories
  • Mouse events occurs when the user interacts
    with button instances.
  • Movie Clip events occurs when something happens
    with a movie clip
  • instance
  • Keyboard events occurs when the user presses a
    key on the keyboard
  • Timeline events occurs when the playhead
    reaches a keyframe
  • containing
    actions in the Timeline.

13
Action Scripting
  • Mouse Event Handlers the button reacts to a
    specific key on the keyboard rather than the
    mouse.
  • Parameters include onPress, onRelease, onRelease
    Outside, onKeyPress (), onRollOver, onRollOut,
    onDragOver, and onDragOut. Buttons may be set up
    to respond to multiple parameters.

14
Action Scripting
  • gotoAndPlay and gotoAndStop
  • these two scripts allow you to jump to a
    different part of a movie's timeline and either
    play from or stop at the specified frame.
  • Global Functionsgt Timeline Controlgt gotoAndPlay
    (or stop) and type theframe label name within the
    parentheses provided using QUOTES.
  • Example gotoAndPlay("intro")

15
Action Scripting
  • Loading New Files Flash allows you to link to
    another web site with the Get url script from
    Browser/Network list. Type the url (again using
    quotes) within the parentheses beginning with
    http//. A target such as _blank (opens the url
    in a new window) may be specified as well which
    is separated with a comma.
  • Example getURL("http//www.yahoo.com", "_blank"
    )
  • Editing the Actions List retype, select delete
    an action from the list but be careful

16
Action Scripting
  • Movie Clips - you must give it an instance name
    and it must be present in the Timeline.
  • Go to URL you can use the behavior panel to add
    the actionscript for links and email
    (mailtomedia_at_yahoo.com)
  • Relative Address html files reside in the local
    folder (index.html)
  • Absolute Address files located outside the
    local folder (http//www.yahoo.com)

17
Action Scripting
  • Scenes
  • Way to break up large projects into smaller, more
    manageable pieces.
  • You can have multiple Timelines which play one
    right after the other by adding more scenes to
    your movie.
  • Insert ? Scene
  • Window ? Design Panels ? Scene or Shift F2
  • Flash will play all scenes in order unless you
    use ActionScript to tell it otherwise.
  • You need a stop action to prevent your movie
    going from one scene to the next.

18
Action Scripting
  • Scenes
  • Scene Panel
    Currently in Scene 1

Edit Scene
Double click To rename the scene
Duplicate Scene
19
Action Scripting
  • Frame Labels
  • Identify a frame by name, rather than by a number
  • Content in its own timeline yet divided out into
    sections
  • Steps for adding a Frame Label
  • Create a new layer called Labels
  • Select the frame
  • In the PI, insert a name in the Label Field.
Write a Comment
User Comments (0)
About PowerShow.com