Accessibility
 
Home > Products > Flash > Support > Symbols and Interactivity
Flash Icon Macromedia Flash Support Center - Symbols
Writing and evaluating expressions in Flash

This shopping cart example is based on several draggable movie clips: the hats, a movie clip on which to drop the hats-the shopping cart, and a movie clip that evaluates variables and runs a calculate script-the orderform. The focus of this article is to provide and explain a practical example of a Flash movie that uses expressions to build its core features.


To view this demo, you need the latest version of the Macromedia Flash Player.
Download the free Macromedia Flash Player now.

Get Macromedia Flash Player

This sample e-commerce site makes use of several features of Flash including draggable movie clips, variables, expressions, conditional logic, and movie clip properties. The order form is a simple example that displays the items dragged to the shopping cart and calculates their prices.

To make the best use of this article, you should understand the basic principles of drawing, using layers, creating symbols, using movie clips, and adding actions to buttons and frames in Flash.

To create your own version of the shopping cart, download the source file, open it in Flash, and follow the steps in this article. Optionally, you can create your own artwork and file as you read this article, using the source file as a reference.

Download the Windows source file hatshatshats.zip (96K)
Download the Macintosh source file hatshatshats.sea.hqx (264k)

Step 1: Create the hat and shopping cart movie clips
Step 2: Create the orderform movie clip
Step 3: Make the hat movie clips draggable
Step 4: Make the fader hat movie clips
Step 5: Create an expression using conditional logic
Step 6: Use Set Variable to record the hats' positions for snap-back
Step 7: Use Set Properties in the movie clip buttons to snap the hats back


Jody Bleyle

Jody Bleyle writes instructional documentation for Macromedia Flash and has served as the Flash Technical Support team lead.


14 February 2000

Call action, conditional logic, draggable object, droptarget, else, expression, Expressions Editor, if, order form, shopping cart, Tell Target, variable

9208