First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Jeffrey F. Hill | Website:

Setting up the Flash Client for the Language Translator

A Client in this case refers to the application that is displaying the result obtained from the service and handling the user input. In this case a string (paragraph of text) is sent from the Flash Movie, to the Service, and returned back to the Flash movie. The service translates the string from one language (for example English) to another language (for example German). So the result will contain whatever text the user entered in English with it's German Translation.

Adding the components to the Flash Client: We are going to use components to make development time a bit faster. The components are all part of the standard Flash UI Components. Two Scrollbars, one combo Box, and one push button will be used. We will add them one by one. You may want to open up the download associated with this tutorial and follow along with the completed FLA.

Let's add some scrollBars: Drag a scrollBar from the components window (In Flash -> Windows>Components). And place it in the movie. This will look like:

Give this component an instance name of "ScrollBarTop". By giving the component an instance name we can refer to it later in the ActionScript. At this point also create a text field right next to the Scroll bar component and give that an instance name of 'Input'. This can be seen below:

Notice that in the first image we specify the Target TextField as 'Input'. We then created a text field and gave it an instance name of 'Input'. This will associate the scroll bar with the dynamic text field named 'Input'. So the scroll bar will scroll any text that is in the Input text field if it's length exceeds the contents of the text field. The biggest difference here between Flash 5 and Flash MX is that we give the text field an Instance name (top left hand corner of properties box), and not a variable name. By giving Text fields an instance name we are able to treat them similar to Movie clips - and control all of their properties with Actions, instead of direct editing.

Add the rest of the components

We need to finish up by adding a combo Box, Push Button, and another text field and scrollbar for the output. This can be seen as follows:

Each Component instance name is shown in the above screen shot. For example the combo Box has an instance name of 'comboBox', the bottom scroll bar has an instance name of 'ScrollBarBottom', and the push button has an instance name of 'submit'. We now have the basic setup done - after this we use ActionScript to change the colors, properties, and actions of the components. No further editing of the FLA is needed unless you want to add some background graphics in.

» Level Advanced

Added: 2002-08-19
Rating: 7 Votes: 10
(10 being the highest)
» Author
Jeffrey Hill is a freelance web developer from Boulder, Colorado. He specializes in creating and developing dynamic database driven Flash content, applications, and content management systems. Specialty's include SQL, PHP, Perl, XML, web services, and Flash clients for web services.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.