ActionScript 2.0 :: How To Read An External TXT File
Mar 19, 2010This works if I view it locally:
Code:
myData = new LoadVars();
myData.onLoad = function(){
[code].....
This works if I view it locally:
Code:
myData = new LoadVars();
myData.onLoad = function(){
[code].....
I've inherited a menu bar (www.ensim.com). You can see that when you hover over the buttons (most of them, anyway) you get a drop down with subnav links.
The way they did it was to populate the movie clip with text from an external .txt file, so you could easily add sub links and change urls and stuff. Nifty idea.
The problem is a new url I'm trying to add apparently contains an escape character that it doesn't like. The new url is "/index.asp?page=solutions&sec=voip". When that goes in there, it won't write the link lable (<a href="borked url">This doesn't show up</a>)
Sort of weird, I kind of assumed that, being a plain old txt file, it would just spit it out and move along.
Just wondering if flash is able to do this using a 3rd party app perhaps? Im creating a flash application (closed source), and I want it for others to be able to customize the program in the means of changing text colors by editing the actionscript using an external .as file. Problem is, the external actionscript works, but it will only work when I recompile or republish the fla file in flash.
Looking for a way for flash to read the external .as file without using the fla file.
I was wondering how you use Actionscript 2, to read a URL/web address in a XML file and when you click a button, or an icon, you are then taken to a page specified in the XML document?
View 2 RepliesI have an ActionScript driven flash project that displays a sequence of images. Currently I am using an array with the names of the images. Is there any way I can open a text file for reading and populate the array. Otherwise I would have to keep compiling the SWF each time.
View 6 RepliesA friend of mine has a Flash Action script running on a LAMP server that currently reads an xml config file. He's asked me if it's possible to remove the xml file, and replace it somehow with a system (lets call it an 'auto xml generator') that intercepts the request to read that file and generates an output, so it appears to all intents and purposes as if the file still exists and contains the contents that has actually been returned from our auto xml generator'
View 3 RepliesI wish to create a glossary that is read from an external *.txt file. The glossary function like a dictionary in that there is a word, its definition, and a link to a relevent page where the word appears. e.g. <label="apple" def="that thing people eat" url="apple.txt"> The reason I want it external to flash is so that new words can be added and removed manually and flash will simply update. A user can type in a word to search for in the "sorted alphabetically" list within flash.
View 2 RepliesI have below code
[Code]....
I need this application read from exteral xml file not in it.
I have a swf with the following script:
XML_var = new XML();
// now load up the url.
XML_var.load("http://www.lick.fm/tracklist.xml");
// when xml is loaded call functon displayXML
[Code].....
This ascript reads an external xml file and picks up the tracklist names for current playing and previous playing songs on my radio station website. It works and looks perfectly fine but i need this to refresh every 30 seconds to read the dynamic xml file and update flash.
When loading an external XML file into flash, is it possible to read the XML declaration and other data such as xml-stylesheet? If so, how?
XML FILE
Code: Select all<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="books.xsl" type="text/xsl"?>
<content>
<book>Hello</book>
</content>
AS3:
Code: Select all//Set XML calls
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(new URLRequest("xml/books.xml"));
function xmlLoaded(e:Event):void {
var xml:XML =new XML(e.target.data);
When tracing, the XML declaration is gone, so I am not sure how to read or target it.
trace(xml);
}
I am creating a CBT course using Flash CS4 As3. I need to capture progress information from the user as they complete each unit in the course so that the next time they access the course they can pick up where they left off. To do this I need to know how to write and retrieve this information to and from a text file or a cookie so that it can be retrieved re-enters the course.
View 2 RepliesI have a main swf file and config.xml located in the same directory. My .swf file uses config.xml to fetch config variable which it does with success.The problem appears when I put those files into Flex directory. I embed .swf file like this.
<mx:Image id="loading" source="@Embed('/blobs/visualLogo/mySwfFile.swf')"
visible="true" horizontalCenter="0"/>
I also place config.xml into /blobs/visualLogo/
This time I get an error in Flex:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mySwfFile_fla::MainTimeline/frame1()
I mean, I use dynamically changing xml-data in my app that I could get straight from the server but it is gzipped. So I was wondering is there a way to unzip it and read it as a xml file with actionscript?
View 2 RepliesI want to read in a HTML file and format with a CSS file.I'm using MX2004.From what I've read, this should be possible?I'm getting stuck at the first obstacle, I can't figure out how to read in the HTML file.THe use of the CSS styling seems to be straight forward.
View 1 Repliestrying to change a gallery that reads xml file to one that reads txt files and that also has a preloader and centrally resizes automatically. since i got no replies i tried and finally after a few months managed to get it to read txt files. unfortunately, i have realised that i require the gallery to read data from a php file and not a txt file because i dont have the permissions to create a txt file and edit it on the server.
Code:
spacing = 10;
//photo._alpha = 0;
pArray = new Array();
[code]....
is there a difference in using this
[CODE].....
for some reason i cant get it to read either one of them...the quotes is what i am referring to.
I want to create a kind of "video player" that will allow me to move a playhead accross all theses SWF that are playing back to back. What I need to do is get the totalFrames of all these swf objects that are to be loaded. I tried loading each SWF (using the Loader class ofcoarse) and on the COMPLETE event grab the totalFrames and then move to the next SWF to populate an array that will be used to create a UI piece. The problem is that it starts playing the swf once it load and you can hear the background sound of each SWF. It also slows the program down. Is there anyway of grabbing the totalFrame property from external SWF's without actually having to load each SWF?
View 2 RepliesMy problem is that all the action script contained in the musicplayer.swf seems not to work when I load the whole musicplayer.swf in the main movie.[code]...
View 9 RepliesI am trying to make an external swf load into the main swf and have the input text work.
View 5 RepliesI currently have a flash video player and I want to add some code that will update a variable in an external .as or .txt file. I then want to be able to pull this variable into a different .swf when required.
My variable I want to create will be CurrentVideo and it needs to be a number e.g. _global.CurrentVideo = 2
In my emptyMC, i'm calling a newsticker, that needs an external .as class to works propertly. But when it opens, it doesn't read my _x and _y coordinates and neither the .as.
My code to it, is in a frame:
Code:
this.createEmptyMovieClip ("noticias", 2);
loadMovie("newsticker.swf", noticias);
noticias._y = -50;
noticias._x = 0;
In my first frame I have locked the root with:
this._lockroot = true and i has been working perfectly.
Also in the root in a frame i'm loading a music.swf.
for further doubts, just ask.
I'm working with Flash CS5 and AS2, Flash Player 8.0. It's a TM template.
I have a javascript on my website that is called on any click. The script reads the name of the clicked item. This works fine for all jpg/gif images with a name, but how can I name a flash movie in such a way that this script can read it? I tried several things, the name (and id) in the published parameters, the name of the instance, of the button, etc. But nothing works?
[Code]...
So lets say I created a simple game with all of the parameters are stored in variables. At any time of the game the user can press save, and these variables will be sent to .csv file using PHP. Each time the user presses save, it will add a new line in the file. This I know how to do.
Here is what I don't know how to do. How would I make it so that when the game is started, I wanted it to load the last line of variables from the .csv file into the game? So basically the last save needs to be loaded when the game is started.
I need to read a CSV file, (text only), I am using Flash builder 4, Flex 3.5 sdk.I have found a LOT of examples, but no one is working completely..
View 7 RepliesIs there a AS function or another way a SWF file could read its own filename? The reason for that I have a FLASH chess game which can store the position of the pieces in a sharedObject. The name of the sharedObject file as well its path has to be hard-coded. If I need to have several chess-games played at a time on the same computer, to store each game position I need to compile a separate SWF with a different sharedObject filename hard-coded. A user will fill more independent if he could just save a copy of the same SWF under a different name. But in this case how shall I make each copy of the SWF use its own sharedObject?
View 3 RepliesHow we can read a Gedcom file with CS3?
View 1 Repliesi have a file called soundList.txt with some text in it, for example1.mp32.mp33.mp34.mp3e text file changes in lenght from time to time (as new .mp3s are added or deleteed)but it will be 1 thing per line .. now i want to read this into an array called "soundList" in flash..or if any of you have any better ideas im open for suggestions, but keep in mind i want it as simple as possible ( im getting to xml stuff but dont have time for it yet and i need this to work now)
View 1 RepliesIm sure this is really rather retarded, but zeros are not being read from my xml file into the dynamic text boxes. ie. if I have a 10 it reads it as 1, and if I have 101 it reads it as 11.the strings calling the nodes from the xml file look like this:this.ref["pos1"].text = nodes[0].firstChild.firstChild.toString();and the xml file is like this:
<?xml version="1.0" encode="UTF-8"?>
<nodes>
<node>
[code].....
i have a file called soundList.txt with some text in it, for example
------------------
1.mp3
2.mp3
3.mp3
4.mp3
...
------------------
the text file changes in lenght from time to time (as new .mp3s are added or deleteed) but it will be 1 thing per line .now i want to read this into an array called "soundList" in flash..
I need to save and later read some info to and from a file... I know i can do that with PHP, but how could i do that WITHOUT PHP ?
View 3 Replies