Flash MX ActionScript Banner Search Macromedia.com
shim.gif
Overview

Intro - Flash History

Flash ActionScript

Building User Interfaces

Object Oriented Techniques

Beyond Flash MX

Conclusion

Recommendations

References

Appendices

Author Notes

Figure Captions

Questions?

Email Dianne

shim.gif

Using Flash MX ActionScript

Building User Interfaces with ActionScript

Button and Movie Clips

Buttons and movie clips are the two primary methods Flash developers use to make things happen in Flash movies. They are the basics for user interaction with the Flash movies. Bhangal says there are several ways you can control a Flash movie using ActionScript (p. 64-65, 2002):

  • Controlling the root timeline is used to navigate through content, and is controlled either by user input or by actions on the frame itself.
  • Property-based control consists of controlling changes in the x and y coordinates, scale, width, height, alpha, and RGB colors with fundamental ActionScript properties.
  • Timeline-based control allows different movies to have separate timelines, and to run independently of each other.

An example of using Button and Movie Clips. Example techniques were learned from Finkelstein's book, 50 Fast Macromedia Flash MX Techniques (1st Edition) (p. , 2002).

Sample Code for Button/Movie menu.

Draggable Interface Elements

A popular event in some Flash movies is to have Draggable interface elements for users to interact with in the movie. ActionScript allows the developer to code what elements can be moved, and even allow them to put in back to its original position when the user is done with the element. Bhangal gives one example of drag-and-drop control as follows (p. 65, 2002):

“The movie clip methods startDrag() and stopDrag() are used to drag an instance around the stage. The startDrag() method uses the following format: MovieClip.startDrag(lock, left, top, right, bottom);”.

An example of using Draggable Movies. Example techniques were learned from Finkelstein's book, 50 Fast Macromedia Flash MX Techniques (1st Edition) (p. 91-93, 2002)

Advanced Mouse Control

Advanced mouse control is used to help control elements in a user’s experience on a website. It essentially follows the movement of the user’s mouse, and then reacts to what the user is doing on the webpage. Bhangal says we need to keep in mind the following when using advanced mouse controls (p. 73, 2002):

  • Make sure that the part of the graphic you want to be the tip of the pointer is located at the (0, 0) co-ordinate of the movie clip.
  • Put the movie clip on the top most layer so it doesn’t pass underneath instances on the stage.

An example of using Advanced Mouse Controls. Example techniques were learned from Finkelstein's book, 50 Fast Macromedia Flash MX Techniques (1st Edition) (p. 115-117, 2002)

Flash MX UI Components

Flash MX user interface (UI) components were made to help enrich the design possibilities of Flash. Flash components are re-usable, self-contained user interface elements with customizable appearance and behavior. Some of the included components help to standardize the way elements look in Flash. Some of these elements are scroll bars, buttons, list boxes, combo boxes, push buttons, and many others. These components help designers have the time to work on other parts of their designs rather than recreating elements that would be the same over and over. A designer/developer can use pre made components or they can create their own components. Either way the components can be shared, and used over and over, thus making the time spent in development shorter.

An example of using Flash MX UI Components. Example techniques were learned from Finkelstein's book, 50 Fast Macromedia Flash MX Techniques (1st Edition) (p. 131-133, 2002)

An example of Form Validation. Example techniques were learned from Finkelstein's book, 50 Fast Macromedia Flash MX Techniques (1st Edition) (p. 139-142, 2002)

If you are interested in learning more about creating flash components, here is a good site to learn from http://www.flashcomponents.net/.

Back to Top