martedì, febbraio 07, 2006

Creating Web forms in Flash is an interesting new arena! I’m sure it will soon become even more interesting/robust as soon as ActionScript 3 and FlashPlayer 8.5 are released.

To create a form, you can either choose the Flash Form Application item in the Create New menu item when you launch Flash, or simply create the action of interest on a keyframe. Here is a simple illustration, I just created using the latter method:

  1. Drag a TextInput component onto the stage and name the instance GOOGLE.
  2. Drag a Button component onto the stage and name the instance gogglesubmit_btn.
  3. Create ActionScript to instruct the button, when clicked, to go to the google search page, with the text of the input box (GOOGLE) appended to it.

gogglesubmit_btn.onRelease = function() {
getURL("http://www.google.com/search?q="+GOOGLE.text);
};

For an exampleof a more complicated form example, check out the Creating forms with UI components in Macromedia Flash MX tutorial at Adobe’s site.

Note: I was a little surprised/annoyed to learn that the tab order for form fields in the Flash player determined is controlled entirely by the Flash player. There is currently no way to specify your own tab ordering. (Boo.)