ActionScript 2.0 :: Load Data Into An Array From An Externa File?
Jan 23, 2008Is it possible to load data into an array from an externa file..?So instead of this:
Code:
var Buttons:Array = new Array(
button1,[code].....
Is it possible to load data into an array from an externa file..?So instead of this:
Code:
var Buttons:Array = new Array(
button1,[code].....
I am trying to load a couple of .jpg files by getting array data from .txt file. I searched this forum and found some code bits I could use. When I tested the file, getting array part seems to work fine (I get output for tracing), but nothing loads onto movie clips.
Here is the code:
var dataArray:Array
var dataLVs = new LoadVars();
dataLVs.load("vars/imgName.txt");
dataLVs.onLoad = function(success){
if (success){
[Code] .....
I have an xml file (externally saved) that is similar to the following:
[root]
[main]
[title]...[/title]
[Code]....
What I like to do is to get what's in [title] tag using HTTPservice, import it into Flex, and save it as array objects, and do the same thing for [content]. This way I can later refer the array object saying title[0] or content[2].
I have an array collection of strings and integers (which I have displayed in a data grid) and I am wondering if it is possible to export the array collection into an html table? or even a text file for the user to download
I found some pages that had an export to .xls files but I want to stray away from that for now.
I'm currently working on a project that contains a lot of data, about 14.000 records. This means an xml file of about 3mb. Now my question is: Should I use the xml file to load all the data at once, or should I use a webservice, that provides the data when I need it? Keep in mind that I'm new to webservices. And if I'm going to use a webservice: How do I store the data, in a mySQL database?How fast is a webservice?
View 1 Repliesi want to load the data in a xml file into a array this is the code i have been using but its not working
Code:
stop();
var my_array = new Array();
var my_xml = new XML();
[Code].....
I'm trying to format JSON data without using brackets for an array.
To start off with, this works (to be followed by what doesn't)[code]...
Goal: load XML data (it parses automatically), parse through the XML tree and assign the values to an array of my choosing for access later in the movie. Problem: I can load the XML data, but the only time I can access the XML functions, i.e. XML.firstChild, or XML.getChildNodes(), is when I am within an XML.onLoad function.
[Code]...
I'm simply looking to convert the data in a CSV file into a 2-dimensional array (columns, rows, like so: data[row][column]).However, the parsing must take into account double quotes with commas inside.For instance, a sample of the data of 3 rows of 3 columns:
"Test, 1",100,150
"Test, 2",200,250
"Test, 3",300,350
It's got to correctly drop the quotes around the data in the first column, but also understand that the comma within is not delimiting. Everything I've seen so far does not seem to be able to do this.
I notes that a lot of programmers on this site use xml to load data into swf file??
Can you explain me why??? For all of my years of work i never found a xml to be a good solution. And now I have to remake such file, who was made by some XML freak, to work on my new web project. What |I could write whit 5 lines of simple php loadVars() - from database... I have to use some XML parser ... And that will strech about to 250 lines of parsing...
I need to load in some data from a relatively simply .ini file, but its not turning out as straight forward as I thought it would be. The data in the ini file always takes the form of:
Code:
[OTM]
LastName=smith
FirstName=peter
TrainingID=123TG678
[Code].....
I'm new in the forum,i want to make a photo gallery which loads images, thumbnails and description from XML file , no problem with that [url]... i made the Gallery in one column, want to add dynamic text field beside each thumbnail in order to display description[code]...
View 3 RepliesI have Flash website, and I load data from XML file with urlLoader. If I change data in XML-file, refresh doesn't update data in site. I need to publish it again! How can I make this automatic, that I only need to refresh when data is changed? I can't allways publish when I change somethin in XML-file.
View 3 Repliesi'm trying to load data from an xml file in to my flash file, but i'm getting this error
ActionScript Code:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
[code]......
it works fine, but i want the file data.txt, to be in a different domain than the swf. When i write loadText.load[URL] the swf doesn't work. How can i solve this problem?
View 5 RepliesI want to know "is it possible to get the files names into an array from a specific path".
The flow go like this..
When i open the swf file --> browse the specific folder -> read the file names into an array --> show the file names.
I have text file containing list of words.
//sample textfile
textfile.txt
apple
orange
banana
How can I load it in my flash and put it on array. what I saw in my research about this, I gonna use split("/n") //is this right?, /n is for next line?
I would like to load the content of a texte file (i.e : value.txt)
in a Array.
I use :
onClipEvent (load) {
_global.testLoad = new Array()
gStartFrame = _root._currentFrame;
[Code].....
there is a another code below this one , where i want to get the value of testLoad to use it.
but I can't get the value in the second trace !! i known that the variable is declare in function (so as, local) but i can find how to get the content of testLoad in the second trace, to use it later on in script.
I'm working with a Flash gallery that loads picture description from the actionscript that looks like this:
import mx.controls.CheckBox;
function title_name() {
bigname_arr = new Array();
[code]....
I'm trying to display web links loaded dynamically through a XML file.
I've achieved to display text and I'd like to display a specifical link to each part.
Here is the AS2 code :
my_xml = new XML();
my_xml.load("news.xml");
my_xml.onLoad = my_function;
[Code]....
there is a 10 arrays in my root and everyone contains 2 inputs: new arrays = myresult1["1","2"]like this one, when i got a new result i change it in all arrays in the fla file and play it to get the swf which i'll use it in my screen.is there any way to make it load from txt file i'll put in it the final result and if i do this will it load the final one or i've to add refersh method in the swf file.
View 3 RepliesI've been trying to work on a web portal for updating a website I am creating. I originally duplicated a write-to-.txt php script and duplicated it for each of my pages, but for some reason it isn't working out very well as I assume they are fighting with each other. I am looking into creating what I assume is called an array, so that I can store 5 separate data pieces in one text file but I can't seem to find a tutorial that is close to this. the closest I can find is a guestbook tutorial but it is very out of date. I would like to be able to store multi-line text (so that paragraphs and breaks are preserved) from 5 different input boxes and then retrieve that data upon loading of the input boxes and in a different page which would be the actual content of the website.
View 2 RepliesI am trying to get my flash file to load data from multiple sources/domains. It works perfectly in the development environment, but as soon as you launch the swf locally or online, it doesn't load the xml data from external domains.
[Code]...
Is it possible to load data from another shared object from another flash file? if so how?
View 1 RepliesI'm using LoadVars to load variable data into flash from a .txt file.Pretty simple - when uploaded onto a server, I can see the data loaded but no one else can, not even other accounts on my computer!Could this be a CHMOD permission problem? Could this a problem with my AS? A problem with directories? A problem with URLs?Anybody have a good method that simply loads vars from a .txt file and can also do it online?
View 2 RepliesHere is the full code that i want to use.it is for synchronise a mouth with the value of sound ( in level)that doesn't work as indicated below.
onClipEvent (load) {
_global.testLoad = new Array()
gStartFrame = _root._currentFrame;
_global.valueSon = new LoadVars();
[coder]....
I have this Simple Flash banner, that loads text, colors, and entire banner hyperlink from external .txt file into flash.For importing text into dynamic text fields with �vars� set i use
loadVariables("http://www.mysite.com/DIR/data.txt","");
For importing hyperlink onto flash button i use two layers:On blank layer i use:
loadVariables("http://www.mysite.com/DIR/data.txt","");
On button itself i use:
on (release) {
getURL(link1, "_blank");
}
Button has instance set also.Everything works fine and nicely.I use this HTML script to use banner in any website i like:
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
id="name" width="468" height="60">
[code]....
Ok So everything works nicely. I load flash i load text, and i also load hyperlink. So after a happy job i went to sleep and other morning i tried to enter website with HTML code, that shows flash and i noticed:
1. Some times flash loads animation, but doesn't load my data.txt and places where dynamic text should be are blank, also hyperlink doesnt work, because it also seems to fail to load.
2. So i press "Refresh" on explorer and data loads perfectly.
3. So i keep pressing refresh some times try to turn of explorer and i noriced that some times it fails to load data and only non dynamic flash animation is played, and some times it loads it nicely.
I trying to load indivual strings of text from an external file. example: I have a movie that navigates from frame to frame. on each frame I'd like a line of text to load into the movie. When the user navigates to the next frame the text loaded vanishes and is replaced by another line of text. This can be done with separate txt files, right but I was wondering if and how it could be done using one external text file.
View 2 Repliesaccess raw file data as FileReference.load() loads it in memory?
View 2 RepliesI wrote this script a while ago and it's worked extremely well for me ever since. I use it in nearly every project I do. But the other day I was asked to do a project where I could only use Flash 7.
This is a class I made to easily handle multiple file preloading by passing it an array of files to load. It only has two useful methods. One gets you the current total progress (total of all the files 0-100%) and an onLoadComplete. The actual usage is in the top of the file. It works great under Flash 8, so go ahead and use it.