1. Home
  2. Computing & Technology
  3. Animation

ActionScripting Challenge: Flash Candy Heart Explained

By , About.com Guide

9 of 9

The second and final script is simple, and makes sure that Flash checks on every frame that elapses to update the value of the dynamic text field (heartmessage contained inside symbol texty) with the value that's entered in the input text field (represented by variable hmessage). You should create a controller movie clip off to the side of the visible area of the stage, so it won't show when the user runs the main Flash movie; this clip exists solely as an object to assign scripts to using onClipEvents.
onClipEvent (enterFrame) {
_root.texty.heartmessage.text=_root.hmessage;
}

This uses an onClipEvent that, every time Flash cycles through the single frame of the movie clip and "enters" that frame again, checks to see what hmessage is and changes the heartmessage.text property to match.

That should be enough to get you a working candy heart generator. I hope you took on the challenge, and enjoyed creating your own version.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. ActionScripting Challenges
  6. ActionScripting Challenge: Flash Candy Heart Explained

©2009 About.com, a part of The New York Times Company.

All rights reserved.