Reading A Text File And Modifying It.
Ok I am new to all of this so bare with me.
I have a text file that contains news, it it in the same directory and works great here> http://www.mattladner.com/lbsd/home.php
so the site admin takes it and writes a cgi script to modify it so more news can be added and now nothing is showing up? here> http://www.lbsd.k12.ms.us/~working/
any ideas?
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 07-14-2004, 05:34 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
External Text File Modifying And Reading
Hey,
I have a .swf file that i want to have modify text on a txt file on my server (news.txt).
I have on the two frames a input form (variable: 'news') and a button on the bottom right.
On the first frame i have these actions:
loadVariablesNum("news.txt", 0);
On the 2nd frame i have these actions:
stop();
Now the buttom is on the bottom right and the text file from the news.txt is shown. Now this is fine, it loads the text perfectly, however when i try to edit it i got.
// For the button
on (release)
{
gotoAndPlay(3);
}
On third frame:
fscommand("SAVE", "news.txt");
Then fourth frame stops.
However when I refresh the swf on the server, the old news.txt loads! I want it to change to what I had!
Please help!!
Danny
Making, Modifying And Reading XML Docs
Hi. I'm currently trying to make a simple XML program that does the following to a(n) XML Object(s):
Creates an XML Object already parsed with a set format. (Checked)Take the XML parsed in flash, and make an external XML doc. (Unchecked)Modify the new external XML doc through flash. (Unchecked)Read all the information through the external XML doc. (Checked)
Bold = Highest priority
If anyone can help me out with the bolded subject I would most appreciate it.
Modifying A Variable Loaded In From A Text File
Is it possible to modify a variable such as &number=5 that was loaded in from a text file?
Can you do something like:
newNumber = number + 4
Thus making 'newNumber' equal to 9.
The following code was provided to me but would not validate in flash:
(the text file used was called number.txt and the variable was &myNumber=2
---
var curNumber.Number = 0;
var numberInfoLV.LoadVars = new LoadVars();
numberInfoLV.load("number.txt");
curNumber = Number(numerInfoLV.myNuber) + 4;
---
Does anyone know how i can make this code work? I would greatly appreciate your input. Thanks
Modifying A Variable Loaded In From A Text File
Is it possible to modify a variable such as &number=5 that was loaded in from a text file?
Can you do something like:
newNumber = number + 4
Thus making 'newNumber' equal to 9.
The following code was provided to me but would not validate in flash:
(the text file used was called number.txt and the variable was &myNumber=2
---
var curNumber.Number = 0;
var numberInfoLV.LoadVars = new LoadVars();
numberInfoLV.load("number.txt");
curNumber = Number(numerInfoLV.myNuber) + 4;
---
Does anyone know how i can make this code work? I would greatly appreciate your input. Thanks
Reading External Text File Into Movie Text Boxes
So I'm trying to read a simple text file into an array and then putting that text into the dynamic text boxes of 6 movie clips
the MC are instances of 'CategoryBox'. Each instance is name cat1, cat 2, so on.
In the parent movie file the dynamic text box instance is called 'catText' and variable 'catText'.
Code:
// load the text file for Titles Questions
this.loadVariables("title.txt");
//Lets get the game going
this.onEnterFrame = function(){
//Titles loads? FIRE!
if(titles!=null &&titleArray==null){
titleArray = titles.split(";"); //makes new_ARRAY into an array having values of strings separated by a semicolon
trace (titleArray);
//title generations
for (z = 0; z < titleArray.length; z++) {
this.cat[z].catText = titleArray[z];
}
}
}
now trace shows the titleArray is getting it's goods, but the text in the clips is "_level0.cat2.catText"
text files reads as such:
titles=blah;blah; so on
Reading Text File
I am able to read a text file using actionscripting in a Flash 5 movie. I am looping the movie so it will continuously check the text file to see if it has been updated. This file will actually be updated about 10 to 15 times an hour and I need to be able to display the updates to people who keep the browser window open. Netscape loads the new text file everytime it loops, meaning that the browser displays the updated text file info when the file is changed. Internet Explorer - on the other hand - never shows the updated text file.
Any ideas how to get IE5 to check for the updated text file in a Flash movie and automatically display the changes?
Thanks a million for any ideas you may have!
Reading A Text File
In order to keep my swf files down as low as possible (for low bandwidth users), is it possible to load or "read" text or html files into a swf?
Thanks.
Reading From A Text File
i have the file tickerheads.txt placed in the C:
It reads as follows
-----
item1=This is the first item of news 2002
item2=This is the second item of news 2002
item3=This is the third item of news 2002
item4=This is the fourth item of news 2002
item5=This is the fifth item of news 2002
-----
When I run my movie with the following actions attached to it and all the relevant dynamic text boxes with their variables named as above with the following line-
loadVariablesNum("C:\tickerheads.txt", 0);
---
The movie runs and yet the text doesnt load into the boxes! Anyone any ideas?
Thanks
Reading From Text File
Dear Friends
I want flash to read from a text file, so i did it, and it read from the text file, but when i published the movie, i found that flash had taken the text from the text file and included it in flash, i need flash to always read from that text file, so that when i change the text file, the new information automatically comes to flash. How to do that?
Thanks
Help With Reading Through Text File
I have a MC called BioInfo and my text files are in side it. What I'm trying to do is read through the txt file and display the variables accordingly. For example,
name1=Jim&title1=Suprv&text1=blablablah...name2=Ri ck&title2=Manaager&text2=blablablah...name3=Bob&ti tle3=Flunky&text3=blablablah...
now I have some code I found that I want to use on a button, but I'm sure I am missing some and would really like to get it working. I would appreciate any help.
Code:
on(release){
BioInfo.name.text = eval("name"+i);
BioInfo.title.text = eval("title"+i);
BioInfo.city.text = eval("city"+i);
BioInfo.state.text = eval("state" +i);
BioInfo.scroller.text = eval("text"+i);
BioInfo.BioPic.Image = eval("BioPic + i")
i++
}
Reading Text From A File
Hrm, since nobody seems to be able to tell me how to make a dynamic panel...
Is there a way for Actionscript to parse text from a file? =D
Thanks!
Reading From A Text File
Hi,
I've got a movieclip called : nmc, nmc is in another movie clip called wwptcmc. wwptcmc is on the main stage with an instance name of wwptc.
In the movie clip nmc there is a dynamic text box, where shoud I put the code to read the text file : loadVariablesNum("users.txt", 0);
Should it be on the main stage or should it be in nmc. the dynamic textbox has the var set to userlist.
The text file is in the following format :
userlist=jht sam master
Thank you
Reading Text From A .txt File
I want to use a .txt or .htm file to hold text for a flash project. Does anyone know how to set up a text box to grab the text from a file and insert it into the text box?
Reading In Text From File Into Swf
Hello first time poster here,
I just started working with flash about a month ago and i'm creating the flash for a webpage at this internship im working at. One of the sections i have to make is a "Whats New" a section that gets frequently updated, but once I am gone, the other workers are going to have to update this themselves and don't want to mess w/ the flash.
i figured the easiest way for them to update is to edit a simple text file w/ html. so basically the question is how do i read text from an external file into the swf? I know there is a way to do this (i've seen other flash pages w/ calendars etc ) but i have no idea where to start with this implementation, can someone help me out? thanks in advance!
Reading From A Text File
Hi all,
As you can see I am new to this forum. I have recently been getting into Flash, and would class myself as an beginner/intermediate.
I need to create a presentation that runs at the reception area of my workplace (fair enough). However, one of the requirements is that the receptionist can enter weather details into a text file which my flash presentation will read, and output things based on this text file.
For example, she would put in the next 5 days weather like
monday, 24C, Sunny
tuesday, 17C, Cloudy
etc
Then my presentation would read this file and display the day, temperature and a picture of a Sun or a Cloud etc. And if she forgot to put anything in the text file it wouldnt mess anything up, it just wouldnt display anything.
I have searched a few sites, and scanned through all the tutorials on this site, but i cant find anything that could help me to learn how to do this..
Any ideas or pointers?
Reading Text From A File
Hi,
I am going through the tutorial found in here
The spinning text effect draws the string from the variable inputString
code: inputString = "some text to be animated";
I want to load the string from a text file instead, how do I do that?
I tried loading my text file by adding the code below:
code: loadVariablesNum("data.txt", 0);
where data.txt is the text file containing the string I want to animate,
but the movie just came up with a blank screen.
Please help. Thanks.
Melissa
Reading From A Text File
Hi,
I've used the shared concept to read and write to files, but I really need to know how to read from an ordinary text file.
mySO = SharedObject.getLocal("filedata");
for (a in mySO.data) trace(a+": "+mySO.data[a]+" printing");
This code only recognizes data that's written to the file using sharedObjects.
Anybody, please......is there a way to read pure string or numeric data from a text file (a text file whose path I specify, rather than look it up in some bizzare temporary folder of flash)
Please help me with this.....I need this functionality badly...
Thanks
Help With Reading A Text File
hi there . im quite new to actionscript , and im not really sure where to start on this script.
what i want to do is read a line in a text file and split the varibles and put them in to a grid ( listview ect )
example textfile ::
example artist1|example album1|example details1
example artist2|example album2|example details2
example artist3|example album3|example details3
-----------------------------------------------------
so the string seperator is |
any example scripts to get me started would be great
thanks
luke
Reading A Text File
Hi
I am new to actionscript, but I know C,C++ some Java, Javascript ASP, PHP.
Since I have learned many different programming languages in the past I have not a little list of short programs I want to be able to in any language ( I have discovered these programs are a good basis to start).
List Item Read a text File:
OK I have read the book(s) and I am afraid too late saw your tutorial when I had already got that far with the usual blood and tears.
I can read a a text file and pop one record of 4 field of data onto a Flash form - but my file has more records and I only see the last one reported.
It looks like actionscript does not deal in records as return/enter is just passed as data.
This is my text file:
&Name=Pat Proggie&Email=pat@hotmail.com&Header=About this 'er Flash feedback form&Msg=This Flash feedback form is the bees knees&
&Name=Andy Handy&Email=andyHandy@yahoo.com&Header=Your site stinks&Msg=Your site stinks carry on I like it!&
&Name=Able Cable&Email=able@cabel.net&Header=Great Site&Msg=Tell me more.&
The Code:
//-------------------------------------------------
// I expect to read a text file called
// "feedbackFile.txt" and place data fields into
// the display form "Reporting Text from a File
// this code only displays the last record
// so only 1 record on this file
// would be OK for input variables like rates/discount values
//
feedback_lv = new LoadVars();
feedback_lv.onLoad= onText;
feedback_lv.load("feedbackFile.txt");
var sometext = feedback_lv.toString();
//
function onText()
{
name_txt.text = feedback_lv.Name;
email_txt.text = feedback_lv.Email;
header_txt.text = feedback_lv.Header;
msg_txt.text = feedback_lv.Msg;
}
Code/form view/notepadview in pdf attachment called "The File"
Reading Text File
Please see whats wrong with this code:
Code:
onLoad=function()
{
my_text=new LoadVars()
my_text.load("C:\Documents and Settings\Wrkspace\Desktop\flash_wordlist.txt");
my_wordlist="";
}
my_text.onLoad=function(success)
{
if(success)
{
my_wordlist=(this.var_wordlist).split(" ");
trace(my_wordlist)
}
}
the trace dosent showup at all....by the way, this is in the first frame of the timeline, and i am trying to load a wordlist and then use the words in my program separately.
Is it because flash loads the text file slowly? and what is the solution to what i am trying to do?
PS: I am using flas8, as2
Reading A Url From Text File
Hi
I have a url in a text file which I would like to read as the source file for my flv playback component. I am not sure how this is done, can anyone help?
thanks
Reading Text From A Text File & Assigning It To A Variable
Plzz tell me how to read text from a text file & assign it to a variable.The actual thing i need to do it is that the text file contains a value & i have to get that value & according to it i have to change the color of the background.for eg if the text file contains a no below 10 then the bg color should be blue & if it is above 10 it shud be some other color( the text file contains only one value).
plz help me in this regard.this is urgent
luv
Andrew
Reading A Text File From Flash 5?
Hi folks.
I'm trying to find a way to read the contents of a text file into Flash. I checked out the LoadVariables(), but that is not quite gonna do it. Here is what I'd like to do:
Create a basic page-turner in Flash that displays each block of text from a "--" delimited text file on page turns.
Here is a sample of the text file:
page 1 text
--
page 2 text
--
page 3 text
I'd like to read in the whole contents of the text file on launch of the Flash file, then use subStr() to strip out and display each pages text as the user clicks the next button (there will be alot of pages...possibly up to 100). I'd like to build a "player engine" that I can reuse as to not rebuild the thing each time I need to create a new one.
Any way to do this? I used to use ReadExtFile() in Authorware and strip out each line using the page # as the parameters to obtain the correct line # from the text files contents...I'm lost on this one...Flash has got to do this, eh?
Thanks in advance for all your help.
.:::::: READING A TEXT FILE PROBLEM ::::::.
Problem!
I want to read in a whole text file but not as name value pairs but as straight text. Any ideas on how this can be done??
http://www.infoco.com.au
Thinking outside the circle
Reading From External Text File
Hello,
I'm having problems with reading from external text files. The text files are in fact help files that a user of my flash movie can read if he/she clicks the 'help'-button in my movie. At home, on my own pc everything works ok but when I saved the files on a server, seems that sometimes some variables are not read.
Here is the code for the help-button
on (release) {
loadVarsText = new loadVars();
loadVarsText.load("Help"+nHelp+".txt");
loadVarsText.onLoad = function (succes){
if (succes) {
setProperty("Help",_visible,true);
Help.Titel.text = unescape(this.Titel);
Help.Info.text = unescape(this.Info);
gotoAndPlay(2); // Play transition effect
}
}
}
nHelp is a global variable that sets de number of the help-file that should be read. f.e. nHelp = 2 ==> read the contents of Help2.txt.
the lay-out of my Help2.txt file is
&Titel=iVal 1.0 - Login
&Info=Om iVal te gebruiken, moet je jezelf aanloggen aan het systeem. De leerling moet een gebruikersnaam en paswoord ingeven. Op onze school gebruiken wij een systeem als volgt:
Gebruiker: 4F01
Paswoord : 4F01
Now if I test this on the internet-server, the title field is not displayed, the Info-field works ok. At home, on my local hard drive, bith title and Info-fields are displayed as it should be.
What am I doing wrong? Kan anyone help me pls.
Thx in advance.
P.S. I noticed a similar problem with the use of a PHP-script on reading from an external text file. Seems not all data is read in time into the flash-file? Can this be the cause of my troubles and how should I work around this problem?
Reading A Text File Problems
Hi,
I am using Flash 5 to read in a text file full of questions for an interactive quiz.
I use a variable at the end of the text file which the Flash movie checks for in a loop on the first 3 frames of the movie. Only when it finds a value for this variable will the Flash movie proceed and display the questions. This works fine most of the time.
However occasionaly it doesnt work and the movie proceeds to a page full of blank questions.
Now Im pretty sure the actionscript in the flash movie is OK. The occurance seems to coincide loosely with the first time the browser accesses the movie, although this is by no means always the case. Hitting F5 will always load the questions if they dont load fisrt time.
My question is has anyone else encountered this problem? ... I cant for the life of me work out why its happening.
Thanks ...
thesquirrel
Reading Content From A Text File?
I was wondering how to read content from a text file? I have some collegues that are very Flash Affraid, but like the Flash designed sites. Does any have a sample site which has the content read from text files?
Thanks,
Reading Javascript From A Text File
Not exactly working with Flash but trying to modify a text file that Flash reads in. Currently reading in HTML embedded in a text file. I tried to insert some simple javascript to create a sized pop-up window from the anchor link that is rendered in a Flash window but it was seemingly unrecognized by Flash. The original anchor tags were OK until I inserted javascript. I've also searched around for a bit for an answer without success. Help??
Cheers!
Problems Reading Text File
So here's the deal. I'm making a chronological timeline with Flash MX which receives info from a text file and moves a movie clip to its position depending on its day, month, and year. On the first frame of the root level I have:
code: function yearPosition(month) {
if (month == "feb") {
addDay = 31;
} else if (month == "mar") {
addDay = 59;
} else if (month == "apr") {
addDay = 90;
} else if (month == "may") {
addDay = 120;
} else if (month == "jun") {
addDay = 151;
} else if (month == "jul") {
addDay = 181;
} else if (month == "aug") {
addDay = 212;
} else if (month == "sep") {
addDay = 243;
} else if (month == "oct") {
addDay = 273;
} else if (month == "nov") {
addDay = 304;
} else if (month == "dec") {
addDay = 334;
} else {
addDay = 0;
}
return addDay;
}
loadVariablesNum("info.txt",0);
When called upon, yearPosition will adjust the movie clip's x-position depending on its month. Each variable in the text file is named &entries, &day1, &day2, &year1, &year2, etc.
In the next frame, on the root level, i have:
code:
for(i=1, i<=entries, i++)
data.duplicateMovieClip("data"+i,i)
This duplicates the movie clip for however many entries there are in the entries variable. One of the problems is that the variable "entries" isn't identified as a number. I tried parseInt(entries) and Number(entries) to try to convert it, but neither of those work either.
The movie clip that gets duplicated is assigned a unique number "i" and looks for its corresponding data from the text file.
code:
onClipEvent(load) {
day = _root["day"+i];
month = _root["month"+i];
year = _root["year"+i];
addDay = _root.yearPosition(month);
day += addDay;
this._x += ((parseInt(year) - 1816)*182.5) + parseInt(day);
this.date = _root["date"+i];
this.event = _root["event"+i];
}
When this movie clip calls on the function yearPosition, it's supposed to input the month that it's assigned to. But for some reason the function doesn't recognize the month that's input. Also, I can't do mathematical operations with the variables from the text file. I tried to convert them to numbers with parseInt() and Number() but they still won't work.
I know this is a lot of problems and a lot to read but I'd greatly appreciate someone's help on this. Thank you.
[F8] Reading String From Text File
I have a string inside my text file.
Code:
var_strng=www.something.search?=query&nav=2
When I try to read the above set of string from my flash file(using LoadVars), the string stored in var_strng is broken into 2 parts and only the first part(ie.,)
Code:
www.something.search?=query
is alone read and the remaining part(that comes after '&' is omitted). How do i read the whole string? i also tried putting the whole set inside " ". Did not work
I thought of using split("&"), but there is a problem. The content inside the text file is subjected to changes. so it can have any number of links appended repeatedly and that means the text that contains var_strng (for now), can also be appended with var_strng1, var_strng2....... etc., each seperated by '&'. So using a split function doesnt help
Reading Data From A Text File
Hey All. I'm a newbie to Actionscript but have a fair amount of experience with OO programming and server-side scripting. A project I'm working on is a Flash quiz that gathers it's questions and answers from a text file. I've written a class to get the qusetions but am unsure how to get it to read more than one question and its answers. My code is below.
Any help would be great.
John
P.S. I wouldn't mind using seperate text files for each question but others may want to use a single text file.
Class Code
-------------
Code:
package
{
/**********************************************************
* This class is used for loading and displaying questions *
* in the Flash language project. *
* *
* Authors: Roisin Bradley and John McLernon *
**********************************************************/
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class Questions extends MovieClip
{
// Declare question and answer variables
private var question:String= null;
private var answer_one:String = null;
private var answer_two:String = null;
private var answer_three:String = null;
private var answer_four:String = null;
private var correct_answer:String= null;
private var question_clue:String= null;
// Contructor class to set the intitial properties of the class
public function Questions(question_file:String) {
// Get information from file
var questions:URLLoader = new URLLoader();
questions.dataFormat = URLLoaderDataFormat.VARIABLES;
questions.load(new URLRequest(question_file));
// Set variable values
question= questions.data.txtQuestion;
answer_one= questions.data.txtAnswer_one;
answer_two= questions.data.txtAnswer_two;
answer_three= questions.data.txtAnswer_three;
answer_four= questions.data.txtAnswer_four;
correct_answer= questions.data.txtCorrect_answer;
question_clue= questions.data.clue;
}
}
}
Calling Class Code
------------------
Code:
// This actionscript uses the Questions class
import Questions;
// Declare a new instance of the class
var question_one = new Questions("question_1.txt");
// Add question and answers to the Flash Project
addChild(question_one);
Number In Text File Not Reading
Hi y'all,
it should work, but it does not.Declare the variables:
Code:
var limit:LoadVars= new LoadVars();
var winnings:Number=0;
And in the body:
Code:
winnings=parseInt(limit);
limit.load("craps_limit.txt", GET);
The text file contains a number and nothing else. The result is NaN.
All searched threads say this should work; I tried nesting the winnings in a function, to wit:
Code:
limit.onLoad=function() {
winnings=parseInt(limit);
} etc
Help is appreciated.
Reading Data From Text File
Hey All. I'm a newbie to Actionscript but have a fair amount of experience with OO programming and server-side scripting. A project I'm working on is a Flash quiz that gathers it's questions and answers from a text file. I've written a class to get the qusetions but am unsure how to get it to read more than one question and its answers. My code is below.
Any help would be great.
John
P.S. I wouldn't mind using seperate text files for each question but others may want to use a single text file.
Class Code
-------------
Code:
package
{
/**********************************************************
* This class is used for loading and displaying questions *
* in the Flash language project. *
* *
* Authors: Roisin Bradley and John McLernon *
**********************************************************/
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class Questions extends MovieClip
{
// Declare question and answer variables
private var question:String= null;
private var answer_one:String = null;
private var answer_two:String = null;
private var answer_three:String = null;
private var answer_four:String = null;
private var correct_answer:String= null;
private var question_clue:String= null;
// Contructor class to set the intitial properties of the class
public function Questions(question_file:String) {
// Get information from file
var questions:URLLoader = new URLLoader();
questions.dataFormat = URLLoaderDataFormat.VARIABLES;
questions.load(new URLRequest(question_file));
// Set variable values
question= questions.data.txtQuestion;
answer_one= questions.data.txtAnswer_one;
answer_two= questions.data.txtAnswer_two;
answer_three= questions.data.txtAnswer_three;
answer_four= questions.data.txtAnswer_four;
correct_answer= questions.data.txtCorrect_answer;
question_clue= questions.data.clue;
}
}
}
Calling Class Code
------------------
Code:
// This actionscript uses the Questions class
import Questions;
// Declare a new instance of the class
var question_one = new Questions("question_1.txt");
// Add question and answers to the Flash Project
addChild(question_one);
Not Reading A Number In A Text File
Hi everyone,
this should work, so of course it doesn't. Declare the variables:
ActionScript Code:
var limit:LoadVars= new LoadVars();
var winnings:Number=0;
var newlimit:String="";
And then the code
ActionScript Code:
limit.onLoad = function() {
winnings=parseInt(limit.newlimit);
}
limit.load("craps_limit.txt", GET);
It should say 100, but it reads 0. The text file says only:
&newlimit=100
Well, help is appreciated.
Reading In Text File Question...
I have a bunch of X Y values in a text file. I want to read each one and draw them to a movie. Basically like a line graph. I've been reading about loadVars however it seems that the text file has to be in a special format.
The text file I'm dealing with just looks like.
1 3
2 45
3 42
4 1
5 39
etc etc.
I want to load this in and then loop through it line by line to extract the numbers into X,Y coords and draw connecting lines.
Could someone help me get started with this.
Cheers
Robert
Reading In An Array From A Text File
I'm trying to use a text file to load in some configuratin data (using actionscript 3) I have it working ok for simple stuff like gamename=Chess&gamescore=100 , etc... but some of the data needs to be in an array. Can someone please point me in the right direction to how I can read in an array from a text file?
Thanks!
Reading Link/ URL From Text File
Hi, I am new to flash Action scripts.
Is there way to dynamicaly use the URL reference (File Link path ) from a external text file on any button events, ?
Plz let me know if flash support this dynamic code linking at run time...
Thanks
Saliq
Reading And Writing To A Text File
is it possible to write to a text file in flash?! one that is kept on the server?
I can do the whole read from part but really wanna be able to write to.
Reading Html From A Text File?
Hi
I've read somewhere that html can be displayed in dynamic text fields in a movie. So I want to ask is how can I read html stored in a text file & display that html as it would appear in any browser.
can any one help??
Reading Variable From Text File
Hello,
I am communicating with a database through flash and an asp page. I query the database and output a variable to a text file. For some reason I CANNOT read the variable from the text file. I've done this before and it has worked fine, but I'm not getting anything now. The text file reads "energy=5000", but the energy variable in flash does not get set to this value.
I am trying to use
loadVariablesNum ("C:energy.txt", 0);
if I use
loadVariablesNum ("energy.txt", 0);
I get
Error opening URL "file:///C|/Inetpub/wwwroot/energy.txt"
Why does it add all that stuff to the path? Which way should the slashes go?
please help!
How do I do this properly? I've made sure that there the text files are there and they are not Read Only.
Thanks,
Emily
Help.. CreateTextField And Reading A Text File
hi,
i have a movieclip and it's action creates a textfield:
onClipEvent(load) {
this.createTextField("words", 1, 0, 0, 400, 300); //words.autosize = "left";
words.type = "dynamic";
words.multiline = true;
words.wordWrap = true;
words.border = true;
words.background = false;
words.html = false;
words.embedFonts = false;
formatStyle = new TextFormat();
formatStyle.color = 0xff0000;
formatStyle.font = "Verdana";
formatStyle.size = 10;
formatStyle.textColor = 0x000000;
//words.text = "This is a test of the emergency broadcasting system."
words.setTextFormat(formatStyle);
}
i want to read a text file in my created text field, words. i am confused as to where to place the loadVariables("words.txt", words);
i tried doing words.text = this.loadVariables("words.txt", words); inside the clip load event.. i tried placing it at the beginning before creating the text field, and after creating the text field.. under formatStyle... those didn't work.
any help would be appreciated. thanks. my text file is in the same directory as the .fla
Reading Passwords From Text File
I am trying to write an Action script that will read a single password from a text file(obviously i want to read more than one later on) it will be made a little simpler because there is no login just a password any help would be greatly appreciated.
Problem With Reading A Variable In A Text File. Please Help.
How can I get a button to read the text inside a variable that is in the _root level. right now it won't read it, it keeps going to the else statement, which in terms its not seeing the variable please help me =P.
Code:
on (release) {
if (U == "Admin") {
tellTarget ("/Update Window") {
gotoAndStop(2);
}
}
else if (_root.level33 eq "News Poster") {
tellTarget ("/Update Window") {
gotoAndStop(2);
}
}
else {
tellTarget ("/Un-authorized") {
gotoAndStop(2);
}
}
gotoAndPlay(11);
}
I'm not sure if thats right if someone can point out where and what I'm doing wrong that would really be apperaitated(sp?). Thanx
Oh yah the U Variable is reading the user33 variable which is for the username in the password window
[Edited by Mdeitz on 11-08-2001 at 04:51 PM]
Reading _visible Variable From Text File
hi
i have a SWF that reads a variable for the _visible property from a string in a text file that looks like this:
s1visible=false
the 'false' part is whether it is visible or not (it would be 'true' if it is visible of course). but when i have this code in my SWF to read the variable:
MC1._visible = s1visible;
it doesn't work, the object is still visible if the variable is set to false. i have tried a bunch of ways to fix this including using:
MC1._visible = Boolean(s1visible);
OR
MC1._visible = (s1visible == "true") ? true : false;
and those don't work...any ideas? thanks!
Reading Special Characters From A Text File
hi,
i'm loading variables from a text file and it works fine except for some special characters which are not read correctly by flash mx. i'm using the codes from http://www.macromedia.com/support/fl...l_encoding.htm but most of the codes for special characters do not work!!
i especially need to be able to show the spanish "ñ" and the letters with an accent "é","á", etc.
my textfield property "render text as html" is enabled.
does anybody have an idea?
Reading From Text File And Displaying Variables.
Hey,
I am trying to load some variables from a text file and then display them in a dynamic text box.
In the text file called data.txt I have:
membername=Marc+von+Brockdorff
In the first frame of my flash movie, I have the following action:
loadVariables("data.txt", 0);
And in the 3rd frame, I have a dynamic text box trying to display the variable: membername
Unfortunately, nothing gets displayed
Does anyone have any idea what the prob might be?
Thanks,
Marc
Reading Lots Of Variables From A Text File
I am using FlashMX. I have just learned to use the loadVariable and about getting variables from a text file.
Initially, my file has these fields:
&name=James&studnum=1&age=20&textloaded=OK
what if i want to put more than one person into the file? In the above example, everything works fine with a single James entry. How do I use an external file which contains the fields of a lot more than one person?
Any help would be greatly appreciated. And I hope someone can answer this real soon. Thanks a million!
|