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: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.