Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
Cindy #1
Can an array be in an external file?
Hi.
I'm using a bunch of arrays in my flash file.
Can they be put into an external text file and loaded into flash dynamically at run-time?
If so, can the arrays text file be changed and have the flash movie updated without having to re-generate the swf?
If it can, what is the syntax? I've used external text files to load variables into flash (using
"&myVariable=something") but not sure how to code the array.
Thanks for your help!
--cindy
Cindy Guest
-
how to load external html file into mxml file
hi all plz tell me how i can load external html file in mcml file just like say when we receive mail in inbox and see our mail data .. i have... -
Loading an array from an external file
It's about "asymmetry" in LoadVars(). I want to load an array, but didn't know how to actually story it in the external file. So I used... -
Loading array from external file
Hi, I'm new to actionscript and experiencing a problem... I made ? photo gallery that I would like dynamic(not finished) but for the moment I... -
Loading list component with an array using external variables
Hey guys! I've been learning how to create Arrays using an external text file and just have one more step I can't figure out. In my text file... -
Loading External data into an array
This is driving me crazy. I have done this in the past but now I can't get it to work and I can't remember how I did it. I have the text file... -
kamalohe #2
Re: Can an array be in an external file?
like in the yourtxt.txt put:
myArray = newArray("Arraything1", "Arraything2", "Stuffhere3", "poop")
yah i think thats rightm if not change 'newArray' to 'new Array'
kamalohe Guest
-
Jack #3
Re: Can an array be in an external file?
Flash receives all external data as a string,
you can send a delimited string and split
to an array in Flash using the delimeter,
in your.txt -
&txtString=Betty,Barry,Cindy,Dana,Travis&
lv = new LoadVars();
lv.onLoad = function(){
myArray = lv.txtString.split(",");
for(var n=0; n != myArray.length; n++){
trace("myArray["+n+"] - "+myArray[n]);
}
};
lv.load("your.txt");
hth,
"Cindy" <cflorig@highmark.com> wrote in message
news:4044D7C1.60609@highmark.com...dynamically at run-time?> Hi.
>
> I'm using a bunch of arrays in my flash file.
> Can they be put into an external text file and loaded into flashupdated without having to re-generate the swf?>
> If so, can the arrays text file be changed and have the flash movievariables into flash (using>
> If it can, what is the syntax? I've used external text files to load> "&myVariable=something") but not sure how to code the array.
>
> Thanks for your help!
>
> --cindy
>
Jack Guest
-
Cindy #4
Re: Can an array be in an external file?
Thanks guys. I'll try both ways and see which one works best for me.
Have a great day!
--cindy
Cindy wrote:> Hi.
>
> I'm using a bunch of arrays in my flash file.
> Can they be put into an external text file and loaded into flash
> dynamically at run-time?
>
> If so, can the arrays text file be changed and have the flash movie
> updated without having to re-generate the swf?
>
> If it can, what is the syntax? I've used external text files to load
> variables into flash (using "&myVariable=something") but not sure how to
> code the array.
>
> Thanks for your help!
>
> --cindy
>Cindy Guest
-
oopiewan #5
Re: Can an array be in an external file?
You also have a file that looks like
data=
line 1
line 2
line 3
Use obj.loadVars(thetextfile). Then myarray = obj.data.split("\n"). Myarray now contains an array.
oopiewan Guest
-
Cindy #6
Re: Can an array be in an external file?
Interesting. It looks like this approach makes reading/organizing the data easier to read.
I'll give this a shot.
Is it true that I could have more than one array in this text file--just by naming one "data=" and another "data2="?
--cindy
oopiewan wrote:> You also have a file that looks like
> data=
> line 1
> line 2
> line 3
>
> Use obj.loadVars(thetextfile). Then myarray = obj.data.split("\n"). Myarray now contains an array.Cindy Guest
-
oopiewanCodeknowbie #7
Re: Can an array be in an external file?
re: cindy. I don't see why you cant have any number of arrays.
Originally, I "developed" this technique which parsed native truespace files
into 3d by simply adding the data= trick.
here is a link to that experiment.
[url]http://www.nebulouscore.com/examples/truepsace_parser5.swf[/url]
I think I put the fla out there too. Its got some 3d stuff in there.. though I
don't remember which generation of 3d I was doing at that time. If you let it
finish building the faces, then click the button, it will rotate the cube and
tell you how fast it renders the frame. (like I said.. just an experiment to
"see if it could be done")
oopiewanCodeknowbie Guest
-
kamalohe #8
Re: Can an array be in an external file?
I made a game that took like 3 different variables from a text file and randomized them in the flash. Ill dig it up and you can modify it to your needs. ^-^
kamalohe Guest



Reply With Quote

