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.