ActionScript 1/2 :: Reading A File And Display Its Content
Jul 1, 2011
I am calling one method at an interval of 3 sec. This method reads a file from server and then display its content. The file which is getting read is a log file which gets updated at regular interval. The issue is once some content read by AS then it is not getting updated that means after every execution of the function content of src variable below remains same even thou the source file is updated.
I turn to you for help, dear sweet Kirupa Forumites. First, let me explain the problem: I have a flash file reading an external text file for the content. Everything works perfectly for nearly everyone - you click a menu button, and the content text comes up fine. However, a couple of people have found that the text shows up as "undefined". I have checked the player versions of the people where it doesn't work, and it is the same as for those where it does work, so that ain't the problem.
I don't understand why it works perfectly for nearly everyone, but a small number of people have this "undefined" text problem. It seems to be a problem with loading the external text file, but I don't know why. I have a main flash movie, and load the text in the first frame, using the following:
var my_content = new LoadVars(); my_content.load("content.txt"); my_content.onLoad = function(success){ if (success){
[Code]...
I then have a couple of dynamic text boxes in the main movie - one called ErrorText (for displaying an error message to the user) and one called ContentText (for displaying the content). I use an external menu swf which jumps to a specific frame in the main movie, depending on which button is clicked. Actionscript on the main movie frame for the first button does the following, with the other frames similarly configured:
I've got a flash file that is reading content from an xml file. Everything is working great but I want to create a condition that says if there's no url defined in the xml file don't allow the flash to display a url when clicked. Here's my actionscript:
This code works perfect when testing, and it works perfect viewing the SWF, but when you view the HTML file with the SWF embedded, it doesn't display the text file content.
This method reads a file from server and then display its content. The file which is getting read is a log file which gets updated at regular interval. The issue is once some content read by AS then it is not getting updated that means after every execution of the function content of src variable below remains same even thou the source file is updated.
I am trying to read a XML file and display its content in a simple list component or at the console. The problem is that the event listener is triggered in an infinite loop.
The code:
var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.addEventListener(Event.COMPLETE, processXML);
I'm looking to have my swf read content from, what ever page it resides on, the noscript tag section. I believe this can be done as if reading in XML but am unable to figure out how to get the path of the current page.
I am tryin' to emulate simple button functionality and methodology.To finish, i need to emulate 'hit' framelabel, where everything you put inside will be that frame will be the active zone of all button states.But i don't know how to read that framelabel, if button is not at that framelabel.Why button is not at that framelabel?, 'cause button is either at 'up', "over", "down" framelabels, 'hit' label is and actually never played framelabel, but i need to read it once so that i can to replicate its contents to all other framelabels.I'm aware i could just use a display object with an 'hit' instance name throughtout button's timeline.But what i am trying is to, it's to emulate 'simple button' methodology as i stated
I am wondering if it is possible to use random file access for reading and writing data to file in Actionscipt 3.0 similar to that what is in Visual Basic?
I have an xml doc which works beautifully....now I want to edit the "content" so that it display html content, ie....within the text of the "content" I could add bold tags or add a links or something like that....I have looked up and down and no thread I could find has a straight forward definitive answer...not just on here either...is it that difficult...i doubt it?I will have to set the properties of my text box to accept html...right?so something like this....
theText.html = true;
THis was my attemp...(the first part)...but no deal...
Code: <icons><icon image="shoes.png" tooltip="www.shoes4crews.co.uk" content="I made this...<![CDATA[<a [code]....
I would like to have two applications communicate with each other. One app is a Flash running the browser and the other one is another app of ours that is distributed as *.exe file. We need the C/C++ application to read some info out of the SOL file, that is written by the Flash app.
Any other mean that can be used to read the SOL file from a C/C++ application? How often is the format of the SOL file being changed ?
What I have so far...sure there is a better way to do this and as I learn AS3 I will figure it out. The following is what I put together where I now have three instances of the segmented thumbnail button that shows an image when cliked on. What I figure out why it only reads the one xml file.
My XML files: images, images_a, images_b <images><image full="images/full/image1.jpg" thumb="images/thumb/image1.jpg" /> <image full="images/full/image2.jpg" thumb="images/thumb/image2.jpg" /> <image
I'm trying to read a url from an xml file and attach an onRelease event to a movieclip that opens the url when clicked.
Code:
var thelink = getValue(findNode(i, "link")).toString(); var thelink2 = "../news/Press Releases/testpdf.pdf"; if (thelink <> "") { tempMC.bat.onRelease=function(){ getURL(thelink); } }
If I use the "thelink" variable as input to the getURL function, I get a "Page not found" error.If I use the "thelink2", it works as expected.When I look in the debugger, "thelink" and "thelink2" are identical!Here is the code for the findNode function. I've had no problems before with this code, so I don't think the problem is there.
Code: function findNode(node, nodeName) { if (node.nodeName==nodeName)
I was wondering if there was a way to have a flash file read its own flash name and use it as a variable within that swf. ie, 05.swf. I would want 05 to be a variable with the page.
So take the first record and display it like I've shown and then have a couple break lines (not sure how to accomplish this either) and display the next record that was separated by the comma.I have the following AS code which works for one variable but I have more then one like above:
ActionScript Code:
files = new Array(); lv = new LoadVars(); lv.onLoad = function() {
i'm trying to read a txt file (well actually, the file has a different extension but it's a simple txt file). i have a path in that file that points to a jpg that i want to load. if that path has a plus sign (+) in it, the actionscript reads it as a space!
I am changing the flashvars variables v1=value&v2=value ect then after the flash movie runs I am changing the variables externally by javascript, so far so good.when flash first loads it reads the vars correctly.when I try to read them ( after the change ) it keeps reading the old values.[code]everything works except I cannot seem to read the changed FlashVars.
I am making a random name chooser for a class (using an array to read from 28 names). I was wondering if it is possible for flash to read an array from a notepad file. [code]Is there a way to make it so that instead of having to edit the Fla file to edit the names, I can just make a notepad file with the array and _root.NumberOfStudents variable so that it can be edited from year to year easily?
very simple question, i have this: (only a part of the complete rss file)
<item> <title>Ok, de regalo de San Valentin me pueden dar un viaje a Playa del Carmen! Digo, entre todos lo pagan! No?? #SoñarNoCuestaNada</title>
I've tried every example I could find, but nothing really worked. What I'm looking for the to actionscript code (without using classes - i'd like to do all the code in the section of the mxml file) to load in an XML file that is stored in the same location as the swf file.
I have a data file on my computer that I need my flex mobile app to read from. Is it possible to put this file in a certain location on my computer so that the app will see it when I'm testing(ex-can i put it in a folder that is linked to the applicationstoragedirectory directory)?
I have an AIR app im currently developing. And often I am reading 150+MB CSV files. To load the entire file takes a long time, and is quite a memory hog. Im currently loading the entire thing, but the software often only needs part of it, but then will need other parts later.he files are about 1.7Mill lines long, so what I am trying to do, is read the file, but just load every 1000th line. then load all the lines of just the part the person is looking at. But when the look at a different part, I need to load that part in full.