Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Backend

Categories Building Flash clients for Web Services with Soap and Flash MX
Author: Jeffrey F. Hill | Website: http://www.flash-db.com/services/ |

 
Page 4
«prev 1 2 3 4 5 6 7 next»

The combo Box:

We keep all of the available translation modes in a separate text file from which we load into Flash and populate the combo box with. First we need to create a text file with the necessary data. How this text file is formatted is the most important aspect of populating components with external data sources. So here's a look:

&mode0=en_fr&desc0=English to French&
&mode1=en_zh&desc1=English to Chinese&
&mode2=en_de&desc2=English to German&
&mode3=en_it&desc3=English to Italian&
&numModes=4&

Ok what the data contains is not as important as how it's formatted. In the download we have a text file with all of the modes contained in it. In this example we are just using 4 possible modes so it doesn't take up to much space. Notice how the numbers work, after each mode and desc variable their is an increasing incremental number, ie 0,1,2,3. The mode in this case is a string that for example looks like 'en_fr' indicating English to French, that is all that is really needed. We added the description (desc) variable as a way to visually display the short hand.

Next we have to load this text file (called Modes.txt in the download) - into the movie. The ActionScript for that will look like the following:

// Create a New LoadVars Object
myModes 		= new LoadVars();
// This Tells the Flash movie What function to invoke when the Load Vars Is complete.
myModes.onLoad 	= addModes;
// Find the Text File - Load it - after which the function addModes is invoked.
myModes.load("Modes.txt");

We are using the LoadVars Object in this case to load the text file. This is useful because we can use the .onLoad function associated with the Load Vars object to wait for the data to load - and then invoke a function when it's done (addModes). That function will populate the combo box with the data from the Text file - and looks like this:

function addModes() {
 // Loops through the number of listings in the text file and sets them up as nodes.
 for (i=0; icomboBox.addItem(desc, Modes);
 }
}

The comments in the script above should cover about everything. Basically we loop through each record in the text file and add an item to the combo Box for each row in the text file. By creating a data provider for each we can assign as much data to each individual combo box item as needed. This function is found in the 'Functions' layer of the FLA that comes with the download. Some more examples and downloads for this type of thing can be found here: flash-db.com/Components/

So with the combo Box set up and all of the component styles and formats set - we have something that looks like:

So now it's onto the interesting stuff.

«prev 1 2 3 4 5 6 7 next»

» Level Advanced

Added: : 2002-08-19
Rating: 6.90 Votes: 10
Hits: 2105
» 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.
Download (251 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments