magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1999 > 03 > Lab Note

How to Implement If/Then Logic In Macromedia Flash 3

By J. Scott Hamlin

Blessing and curse. That's how one could describe Macromedia Flash's lack of internal scripting support. Many Web designers have embraced Flash's relatively user-friendly development environment ("user-friendly" at least in comparison with Macromedia Director) in part because of the absence of an intimidating scripting language. On the other hand, if you want to push the envelope, the lack of an internal programming capability in Flash becomes a substantial liability.

If you've been following the product, you know that version 3 added features that made it easier to control Flash movies with external scripting languages like JavaScript. Unfortunately, the types of functionality that you can implement with Flash 3 internally are still very limited -- but are sufficient. Two new features in Flash 3, Movie Clips and Tell Target, provide the basic tools to implement a crude form of if/then logic within Flash. That is, with Movie Clips and Tell Target you can make something happen after a certain number of key events take place. Another way of putting it is: If events A and B occur, then event C will be initiated. This sort of if/then logic can be the basis for simple applications that you might wish to use on any Flash applications on your Web site. For this example, we'll use the if/then logic to implement a classic "concentration" or memory game. (The game is available online as an executable file; see "Source-Code Availability" on page 3.)

Mix and Match, If and Then

In the classic, physical concentration game, several pairs of matching playing cards are arranged face-down on a table.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2