Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array loading from txt file 2

Status
Not open for further replies.

osmany

Technical User
May 19, 2002
9
TR
i load an array from txt file with loadvariables command;
first write a container variable and comma seperate array variables;
foo=123&den=a,b,c,d,e&foo2=345

then load it within first frame. 3. frame split container variable to an array;
larray=den.split(",");

i hope it help someone.
Osman
 
Hey - nice solution ... have a well-deserved star!
 
Thank you so much. I have been looking for a way to send an array to flash from php. Works Great!
 
I'm trying your technique right now but I seem to be having a problem. Here's my action script in my "actions" layer and the list variables output from the debug menu. The trace function outputs "undefined" for some reason. Maybe you can help.

loadVariablesNum(" 0);
//create arrays
cName=c_Name.split(",");
cColor=c_Color.split(",");
xCoord=x_Coord.split(",");
yCoord=y_Coord.split(",");
trace(cName);

// for (var i = 0; i<1; i++) {
var i = 0;

myColor = new Color(&quot;cId&quot;+i);
//myColor.setRGB(&quot;0x&quot;+cRed);
myColor.setRGB(&quot;0x&quot;+cColor);
with (this[&quot;cId&quot;+i]) {
_x = xCoord;
_y = yCoord;
}
// }

Debug:

Level #0:
Variable _level0.$version = &quot;WIN 6,0,21,0&quot;
Variable _level0.cName = undefined
Variable _level0.cColor = undefined
Variable _level0.xCoord = undefined
Variable _level0.yCoord = undefined
Variable _level0.i = 0
Variable _level0.myColor = [object #1, class 'Color'] {}
Variable _level0.c_Name
= &quot;Sesswenna,Corellian,Dufilvan,Xappyh,Orus,Jospro,Sumitra,G
lythe,Mayagil,Calaron,Atrivis,Moddell,Quelli,Churba,Kanchen,
Dolomar,Fakir,Koornacht,Farfin,Sluis,Abrion&quot;
Variable _level0.c_Color
= &quot;236877,D96C0E,FF4F4F,8B0000,695007,00F6FF,072179,64FF85,F
FB6B6,F600FF,ACB8E0,4ECD1C,FFF000,B8F8BB,FFFFFF,00AEFF,75006
9,FFFAAE,15F9C6,1EF407,546355&quot;
Variable _level0.x_Coord
= &quot;300,0,0,0,0,0,0,0,0,0,113,0,0,0,0,0,0,0,0,0,0&quot;
Variable _level0.y_Coord
= &quot;300,0,0,0,0,0,0,0,0,0,245,0,0,0,0,0,0,0,0,0,0&quot;
Variable _level0.altdisp = &quot;no\r\n&quot;
Edit Text: Target=&quot;_level0.cId0&quot;
variable = &quot;cName[0]&quot;,
text = ,
htmlText = ,
html = false, textWidth = 0, textHeight = 0, maxChars =
null,
borderColor = 0x000000, backgroundColor = 0xFFFFFF,
textColor = 0x00FF00, border = false,
background = false, wordWrap = false, password = false,
multiline = false,
selectable = true, scroll = 1, hscroll = 0, maxscroll =
1,
maxhscroll = 0, bottomScroll = 1,
type = &quot;dynamic&quot;,
embedFonts = false, restrict = null, length = 0,
tabIndex = undefined,
autoSize = &quot;none&quot;,
condenseWhite = false

Celia
 
hello,

Variable _level0.cName = undefined
Variable _level0.cColor = undefined
you see, variables undefined, so problem at loadvariables
loadVariablesNum(&quot; 0);
i think there is one more &quot;;&quot; at end of url string.

i hope works,
Osman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top