| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Oct 2002
Posts: 1
|
Hi,
I would like to build a very simple Flash module that loads a list of string into a ListBox so that the user can make a choice. I use Flash MX. My problem is that I am unable to load the content of the data.txt file directly into the actionscipt variable. If I load it in a TextField to display it, there is no problem. My data.txt contains : var1=string1;string2;string3; My Actionscipt is at level 0 in the first layer and my ListBox is test23: var1; this.loadVariables("data.txt", 0); test23.setSelectedIndex(0); toke(var1); function toke(liste) { rotate = true; point = 0; while (rotate) { index = liste.indexOf(";",point) if (index==-1) rotate=false; else { sub = liste.substring(point,index); test23.addItem(sub,sub); point = index+1; } } } How can I load data located in text files into ActionCript ? Thank you. Jalbert |
|
|
|
|
|
#2 |
|
Registered User
Join Date: Sep 2002
Location: 5 feet over ground
Posts: 120
|
hi jalb,
if you are using flash mx you can use the new LoadVars-object. ActionScript Code:
&var1=string1;string2;string3 hope it helps i++ |
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|