Drag and Drop - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

Drag and Drop

Description:

Utah State. Topics. Drag and Drop. Using if/else and ... If the car is out of gas OR the car is broken OR the // pool is closed, then no swimming lesson. ... – PowerPoint PPT presentation

Number of Views:82
Avg rating:3.0/5.0
Slides: 7
Provided by: aew2
Category:
Tags: drag | drop

less

Transcript and Presenter's Notes

Title: Drag and Drop


1
Topics
  • Drag and Drop
  • Using if/else and nesting if/else blocks
  • Dynamic Text Fields

2
Drag and drop
  • Terminology
  • Draggable
  • Drop Target
  • Must use movie clips.
  • Instance names.

3
Nesting code blocks
  • if(car out of gas car broken pool
    closed)
  • // Can you spot the logic error?
  • // If the car is out of gas OR the car is broken
    OR the
  • // pool is closed, then no swimming lesson.
  • else
  • if(rachel chicken)
  • // Went to swimming lessons, but Rachel
  • // is chicken, so she is not swimming.
  • else
  • // Went to swimming lessons, Rachel is willing
  • // to swim.

4
Dynamic text fields
  • Text can be altered using actionScript
  • Syntax
  • ltinstanceNameOfTextFieldgt.text ltnew textgt
  • Example
  • _root.feedbackText.text Wrong! Dont quit
    your day job.

5
Getting Movie Clips to Move
  • Use the startDrag() function
  • Flash syntax
  • on (press)
  • this.startDrag()

6
Other important functions/properties
  • stopDrag() // sets a movie clip down.
  • ._x // the x coordinate of an object
  • ._y // the y coordinate of an object
  • eval(movieClipInstance._droptarget) / returns
    the absolute dot syntax reference to a movie
    clips drop target (from the top of the
    heirarchy) For example _root.semiDryBottle. /
  • .text // the contents of a text field
Write a Comment
User Comments (0)
About PowerShow.com