ActionScript 2.0 :: Loading External Variables From TextFile With Mac
Mar 2, 2004
I'm trying to load variables from an external .txt file into Flash MX and this is the code I'm using:
links = new LoadVars();
links.load("assignLinks.txt");
links.onLoad = function(success){
if(success) {
diovan = links.diovan;
diovanhct = links.diovanhct;
}}
trace(diovan);
trace(diovanhct);
(The text file has the following content: diovan=whatever&diovanhct=whateveragain&)
The trace outputs "undefined" for both variables. I also tried loadVariables instead of loadVars... same result. If this is a problem specific to Macs, whats the work around?
View 10 Replies
Similar Posts:
Dec 21, 2009
I have scoured the internet in search of an answer but everything I find doesn't work. Take this example:
Code:
myData = new LoadVars();
myData.onLoad = function(done) {
if(done){
var wordsArray:Array = words.split(",");
[code]....
When I run the above code the Output window displays Undefined.
View 3 Replies
Feb 29, 2004
I'm making something like a dynamic Picture Viewer, wich should display Pictures named by photo1, photo2, etc. dynamically from an url I give the viewer as a parameter. Thats not my problem by now, my problem is that I try to give the viewer few "parameters" through a text-file
NumberOfPictuers=12
I load this file like this
loadNumber = new loadVars();
loadNumer.onLoad = function()
{
[Code].....
View 2 Replies
Feb 29, 2004
I'm making something like a dynamic Picture Viewer, wich should display Pictures named by photo1, photo2, etc. dynamically from an url I give the viewer as a parameter. Thats not my problem by now, my problem is that I try to give the viewer few "parameters" through a text-file
NumberOfPictuers=12
I load this file like this
loadNumber = new loadVars();
loadNumer.onLoad = function()
{
[Code].....
View 2 Replies
Oct 20, 2009
In have an application that uses buttons t0 load different text files. The problem is when I load the second text file I still get variables from the first one showing. To clarify things, suppose I load a file that displays variables 1 through 5 randomly when I click one button, then I click a second button in order to load a file that displays 6 through 10. The problem is that I still get some variables from 1-5 when I want to get only 6-10. Is the first file kept in memory or something? How do I unload or clear the temp/memory where the content of the first file is held.
View 1 Replies
Jun 23, 2008
just a quick shoot here...okay I try to refresh updated textfile data every 2 seconds and it's works ok if I'm using normal delimiters and proper data arrangement in textfile such as
[Code]...
View 11 Replies
Mar 3, 2010
I'm trying to load data from an external textfile, called "config_flash.txt". It works perfectly if applying the fetched data is done within the same function where the loading is done. However, I would like to use the fetched variables in other parts of the script.
Here's what works:
Actionscript Code:
var varLoader:URLLoader = new URLLoader(new URLRequest("config_flash.txt"));varLoader.addEventListener(Event.COMPLETE,
[code]...
So, basically I want the variables/values defined inside the function to be available anywhere in the script. The error that the second code snippet causes is as follows: "1120: Access of undefined property text1/text2".
View 6 Replies
May 28, 2005
I want to load the same external textfile in two different textfields. No problem. My freaky question is: Can I adapt the text a little in one of the two fields, more specifically: leave out the last three symbols/letters? For instance: Elvis would have been dead if he was still alive >>> and: Elvis would have been dead if he was still alive The only trick I can think of is embedding the font, but not embedding the > sign. Is that possible? I am using Verdana here.
View 6 Replies
Nov 17, 2003
i'm trying to display text from a textfile in a dynamic textfield, i have a text file called "quotes.txt" wich has variables set like this:q0=text&q1=text2&q3=text3 etc.so how can i pick these q's at random and place it in my textbox?i've tried this:
loadText = new loadVars();
loadText.load("quotes.txt");
quotes="q"+Math.round(random(10))
[code]....
View 14 Replies
Jan 21, 2005
does anyone know if you can load text from an external textfile into two columns, going to the second when the first is filled?? I only found this (okay, three columns, but I mean the text here is not externally loaded)
[Code]....
View 1 Replies
Aug 12, 2009
When loading an external SWF file, can you actually use some of the variables from the loaded SWF file in the parent SWF file?
View 1 Replies
Jan 26, 2004
I had a question about loading external variables. Is it possible to load external variables from a different server other than the one that the flash site is hosted on?And if so, what would that command look like?For instance, if you load a variable from the site's own server it might look like this;loadText.load("TEXT1.txt");Would loading it from a different server look something like this;
View 1 Replies
Mar 2, 2004
WHy o why in the world doesnt this work? I've done this quite a few times at home on my PC, but now I'm on-site with a client who has nothing but Macs. "Sure, no problem" I told my AD, "I can do that...".I'm trying to load variables from an external .txt file into Flash MX and this is the code I'm using:
links = new LoadVars();
links.load("assignLinks.txt");
links.onLoad = function(success){
[code].....
View 10 Replies
Jan 23, 2011
How to load variables from an external source? For example, Lets say I have a movieclip that contains 6 keyframes, and I want flash to load the proper keyframe when the main swf is opened. Flash knows what the proper keyframe is, because that variable is stored in a MySQL database, or txt file, or xml file, or whatever. Also, how could i have flash write to an external file, so that i can save the changes.
View 2 Replies
Oct 14, 2009
I've been attempting to load an external .swf within a parent .swf. The problem is that the external .swf requires additional variables to pull it's content from a database. This code of course works just fine if the .swf doesn't contain any additional variables or if it's requesting an image.
Is it possible to do this using the GET method, or is there an alternate method while using Loader()?
parent.php as3:
ActionScript Code:
var loadit = new Loader();
addChild(loadit);
loadit.load(new URLRequest("gallery.swf?xmlUrl=http://localhost/gallery/api/rest/get_gallery/1/json"));
The external .swf is obviously gallery.swf while the variable that is necessary for it to function is [URL]
View 3 Replies
Oct 14, 2009
I am doing the website for this artist...so she has the permission to post this html code on her page but we are doing a full flash website and I want this swf file to load inside the main.swf..but I cannot wrap my head around how to get it to go with the ?wid variable attached.I have tried numerous combinations.URL...ABOVE is the link i am trying to get to load into my main.swf file and play the way it plays here.URl...
View 0 Replies
Apr 8, 2002
ok.. I really feel like pounding my head against a wall here. I'm importing variables from a regular txt file. I have dynamic text fields on the main timeline that pick up and show these variables. I know that they are coming into the player at _root, or _level0
rows="5"; is one of them. When I do a debug/List variables, that's what it shows me.
[Code]...
View 11 Replies
Apr 22, 2009
I'm migrating an old project to AS3 and I'm having some problems make the conversion.
I have a text file called "variables.txt" formatted like this (note the jump form p9 to p11) Quote:
&p0=1|0|4|1|8|0|0|29|14|1|6|0&
&p1=1|0|4|1|8|0|0|29|14|1|6|0&
&p2=0|0|11|0|25|6|1|125|86|3|8|0&
&p3=0|0|1|0|0|2|0|26|17|0|2|0&
&p4=4|1|3|1|17|5|1|33|15|3|4|0&
[Code]....
What I'm trying to do is convert all those text variables into an array that will be accessible throughout the presentation.
View 5 Replies
Oct 30, 2010
I'am trying to load an external swf file and passing it some variables. He is my code:
[Code]...
When i load a simple swf, it work fine, but when i try to give him some variable it does not work anymore.(i'am also muting sound)
View 1 Replies
Jun 2, 2004
I want to make a small flash animation in which the user can specify what text and what font/color will be used throughout the animation, by typing in the text file.On with the code which is of interest:
Code:
//Mouse.hide();
since1_txt = "";
since2_txt = "";
thename = "";
[code]...
Of course, the movie clips contain this text and all works fine if I specify it this way.So I have this in my "actions" layer on the first frame and apart from the fact that it works if I specify the formatting within the actions, it's all good. But now comes the fact that I want to specify my textformat options within the text (.txt) file. So I'd specify two color sets (in RGB hexa sets, 0xFF0000 for example), the font (in this case, tahoma) and the three sizes, and have them assigned to myTextFormat's dynamically through loading, using, for example,
Code:
myTextFormat = new TextFormat();
myTextFormat.align = left;
myTextFormat.color = theColor1;
[code]...
Which doesn't work because i can't seem to get the myTextFormat.font = Tahoma; to work if i use myTextFormat.font = theFont; because it is, perhaps, searching for a font called "theFont" instead of taking the reference to the variable within the text file.
View 6 Replies
Apr 27, 2006
i have a Main.swf within the _root of Main.swf, I load another external flash file called Timer.swf into a MovieClip titled 'container'Now, I lets say i want to share variables between the two. How would I do this? (Like lets say Main.swf wanted to know the value for Timer.swf's variable called xTime and Timer.swf wanted to know the value for Main.swf's variable xtimezone )
View 1 Replies
Jun 2, 2004
I have just recently joined and am enjoying the multiple forum q&a's and the tutorials around here. I want to make a small flash animation in which the user can specify what text and what font/color will be used throughout the animation, by typing in the text file.On with the code which is of interest:
Code:
//Mouse.hide();
since1_txt = "";
[code].....
View 6 Replies
Sep 25, 2009
I have a Flash movie that loads variables from an external plain text file, that a client updates themselves (from a web site which generates the file). A problem occurred when they used an ampersand symbol in the text field. Is there a way around this? I haven't seen a way to escape it that works.
View 4 Replies
Mar 20, 2009
Simple URLLoader to get a textfile into a textfield.[code]Works fine locally, not on the server. I tried replacing it to the full http: URL to no avail.
View 3 Replies
Oct 4, 2005
I just make a simple system login that the username & password loaded from textfile then I store in array..but the problem is when I doing tracing nothing was trace..?this is the code I'm using for the flash
Code:
lv = new LoadVars();
myArray = [];
lv.onload = function() {[code].............
View 5 Replies
Mar 7, 2012
hi guys! just asking how to save text to textfile using AS2.
View 1 Replies
Jun 13, 2004
Okay so I am new to using txt files, and not too great with arrays, but I think I should have this right. But when I try to trace the array, I get undefined!I found this on another thread, and changed it accordingly.
Code:
_root.textArray = new Array();
_root.text_lv = new LoadVars();
[code]...
View 1 Replies
Aug 1, 2004
I have a variable which takes a particular form of array (used with the component DataSet). It looks like this:
Code:
var recData = [{svenska:"Hej", spanska:"Hola"}, {svenska:"nej", spanska:"no"}, {svenska:"ocks�", spanska:"tambi�n"}];
I want to extract this variable from a textfile instead of writing it directly into the code-area of the flash-file, so I used the following code:
Code:
// 1) Loads the textfile, recieves the array, and puts it into a variable called txt_Data
var txt_DataSet = new LoadVars();
[Code]....
Unfortunately it seems the array gets converted to an ordinary string in the process, so I cant use it properly. Is there a way I could extract the array from this string again, and if so, how?
View 4 Replies
Aug 29, 2005
What I'm wanting to do is set the scale of a textfile (putted in an mc) at 200% and scale with a prototype on release of a button to 100 precent (its height).
View 2 Replies
Oct 16, 2005
I just load data from textfile into my flash file..so my problem is..how is it in flash I have to code so that I can edit the loaded data from textfile and then when I submit it'll update the data in textfile...of course I'm using php for writing in textfile...Currently I load the data into listbox from my textfile...is it possbile to edit the data from flash...
View 2 Replies