Reading Hex Numbers From External File
I am trying to read in color values from an external text file to set the color of text. I am using a color object and all works fine if the value is set in the script. I am trying to read the value in from an external .txt file but it does not recognize the 0x###### values as real Hex numbers.
Does anybody know how to successfully pull Hex numbers into Flash from external files?
I have tried converting the value that is pulled in, to a number using Number(), I have tried using eval(). So far no luck.
Any pointers would be appreciated.
FlashKit > Flash Help > Flash MX
Posted on: 11-04-2003, 07:58 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
External File Reading Help
i just wanted to know if there is anyway in flash you can read a text file without having all that assigninments of variables? I am making a word count program, where given a text file i want flash to count the words, the only thing thats stopping me is the fact that i have to put "text=" in any text file i want to word count.
Reading External Txt File
hey fk'ers
i'm trying to make flash read from an external file to make updating easier. but when i wanted to read a variable from the txt file, and use that variable in a for loop, it won't work
the txt file:
code: PSTotal=3
the actionscript:
code: var totalNum;
PSData = new LoadVars();
PSData.onLoad = function() {
totalNum = this.PSTotal;
};
PSData.load("externalText.txt");
this.onEnterFrame = function() {
if (totalNum != undefined) {
for (var i = 0; i<totalNum; i++) {
trace("A");
}
delete this.onEnterFrame;
}
};
any idea why?
*edit*
when i change i<totalNum to i<3, it works...
Reading An External AS File
Hi,
I have some code that I don't want it to appear on the main actionscript file,
I see it is possible to create a new -> Actionscript file.
How do I embed the code written there in to an existing AS class file?
Thanks in advance,
Guy
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?
Flash Not Reading My External Txt File When....
Flash dose not read the text file all the way if I have an & in the text. His there a way that you can write the text and having the & symbol withing the text also and it would show up in flah?
Reading Buttons From External Txt File?
Ok, this is going to sound complicated, but it should work out fairly well.
I have this image: http://dan.blizzgamers.net/IO/site/images/index_03.jpg
What I need is buttons in the headline box. They will be simple text-over buttons. Probably white, then fade to blue, then off back to white.
I want to have three or four buttons in that box. When I move the mouse over I want an image to appear in the left box pertaining to the button I am on.
example:
I have three buttons. "Will this game be good?" "Interview: (Name)" "Inside Story: Cheating"
Something like that. When I go over the "Will this game be good?" button I want to have an appear for that button in that box next to it. Then when I go down to the interview button I want the image from the "Will this game be good?" button to fade out and fade in to the Interview button.
Sounds complicated and confusing when reading it back. I hope you understand what I am trying to say.
Ok, now, I need all of this read through an external txt file. The button text and the images it loads.
Anyway, I would really appreciate some help on point me to a tutorial on how to do it or some personal help. Thanks alot guys.
Reading Text Or Variables From An External .txt File
Ive been looking around FK for a tutorial or basic explanation on loading variables from an external .txt file and I havent found anything. Can someone point me towards a tute or an explanation on this.
Is it true you can also update the content of a movie clip with an external .txt file?
Thanks in advance
Don Rhodes
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
Reading Variables From An External Text File
Hi, I am trying to load variables from an external .txt file into flash.
So far I have the following code in flash:
Code:
flag1 = 1;
flag2 = 0;
flag3 = 1;
loadVariables("flags.txt","");
trace(flag1);
trace(flag2);
trace(flag3);
The content of "flags.txt" is:
Code:
&flag1=1&flag2=2&flag3=3
This should then display the values 1, 2, 3 in the traces, however it is displaying the values 1, 0, 1. This means that the values from the text file are not being read into flash.
Can someone please explain to me why it is not working and how to make it work
Any help will be greatly appreciated
Reading Lines In An External Text File
Hi out there!
I have the following problem :
I created an interface -> interface.fla
When I press the pictures button a new swf is loaded(into a movieClip) with pictures. Those pictures are buttons and when I press one again a new swf is loaded(into the smae movieClip) with the foto of the person and its personal information like name adress and age. I call this person.swf
What I want is that when the person.swf is loaded into the movieClip it dynamically loads the particular information of the person into the dynamic textfields of the person.swf
When the picture is pressed some variable has to be instantiated with a kind of person number.
When I know this number I could jump to a linenumber in the external text file containing all the persons information by line.
The file's structure is like :
name=John&adress=Hill Road 7&age=34
So is there a way to read lines in a extrenal text file?
I know it is possible in Java but didn't find such a method in Flash MX.......
thanx, Joeri
How To Load Numbers Not Text From External File
Then i'm loading data from external file i get text, not numbers.
For example then i load two variables a=2 and b=3.
And then i'm try to do this
c=a+b
trace(c);
i got "23" !but i need to get 5.
Please help me.
[CS3] Working With Lots Of Random Numbers (external Txt File, X And Y Positions, Etc)
Okay so I have a flash cs3 project I am working on. I am very new to the whole thing, especially to working with Actionscript. Essentially what I want to achieve is this: I have a text file full of quotes- I want to randomly load a quote from the file, say, every 100 frames, have it appear at a random position, fading in over the course of 25 frames, remaning for fifty frames, and fading out over the course of 25 frames. I have found a few things that load from a text file into a text field whenever a button is pressed, but my knowledge is too limited to manipulate that code into what I want. Any help?
I am much better with PHP, I am curious as to if it is possible (and not extremely difficult) to execute a PHP program which loads a random quote and stores it into a variable, and then call that variable into the flash file.
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 External Swf Value
Hello guys first time post.
Today I came across this site http://graffiti.vidavee.com/ where you can add funny animations to youtube videos. I understand how everything works, except how they synchronize their own timeline with the youtube player timeline.
I created an fla as a test:
Code:
var container:MovieClip = _root.createEmptyMovieClip("container",_root.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("http://www.youtube.com/v/j93QURK4Yjs", container);
function onLoadInit(mc:MovieClip) {
_root.onEnterFrame = function() {
debug_mc.tekst_txt.text = mc.tube.controller.slider;
}
}
When I run this in Flash, it displays the movieclip name.
When I run it standalone or in a browser, it displays undefined.
Anyone have an idea what could be causing this?
Thank you,
Joe
Flash File Reading A Swf File
I was wondering if there was a way to make a flash file obtain data from another swf file. What I have is a swf that contains a datagrid and I want to make a flash file that can read the swf and find the number stored in a given cell.
Thank you.
Reading File Dimensions (wxh) Of A Swf File
Hello All,
I am uploading some banners to my server on an application, I am using ASPUpload.
Everything works fine, I am using the component properties: File.ImageType, File.ImageWidth, and File.ImageHeight.
My problem is that this properties only support file types:GIF, JPEG, BMP and PNG.
I am using also Flash banners on the site (SWF)...
How can I determine the banner dimensions (width and height in pixels) after uploading the .swf file?
Thanks in advance?
Reading From File
Can somebody help me in code to read a file and put them in variables. Right now I can do that by creating Dynamic text boxes. When I use "loadVariables()" it loads in the dynamic text box variable only not in frame variables.
Your help will be appriciated.
Reading From A File
Hi there,
How can I read a variable that is on a text file.
Thnks.
Example.
1. I´ve got the text file myfile.txt
2. There is a variable in that text file called myvar, and it looks like this ---> myvar=This is a text test.
3. I want to put the value of that variable into a dinamic text variable inside the flash code.
4. Did I make myself clear?
5. Thnks a lot...
Reading A PHP File
Hi, i do flash games for a virtual pet site and as a sucrity thing the PHP coder wnats me to make it so when it sends the score flash will take a code from a PHP file. This is what coder says:
[Sunday September 15 03:01 PM] _Tommy _: You get the text from flashsc.php
put that text into a variable
lets call the variable... skvar
you then send the score to
flashsc.php?page=submit&sk2=[skvar]&score=[scorevar]
So can someone please help? And go easy, im not exectly the best actionscripter ever
Reading From A .txt File
Does anyone know how to display a "+" sign within a .txt file to be displayed in a textfield within flash?
Reading .txt File
Hey,
I want to make an app that reads special lines (SO NO VARS) from a .txt file...
So the code loads the first line of the .txt file, loads sum code depending on what stands on that line, and then moves to the other line untill it has completed all lines...
READING # Of File
I'm trying to get flash to read the number of images files in a specific folder on the server. Anyone have any ideas where to start?
Reading A File. Help
I was wondering if there was a way for flash to read the contents of a text file and throw it into a specific text box.
Quick example: Say I had a complete flash web site and wanted to update the "terms and conditions" for the site. Well could I have the terms and cons in a text file and have flash import contents of the file into the movie. That way I would only have to update the text file and not have to completey re-save and upload the complete movie.
Thanks for your replies.
Reading Xml File Name
i am reading in many different xml files. the names will be similar, but not the same. How do i get flash to get the file name dynamically at run time? Any suggestions or refers to a site somewhere would be wonderful
Reading From Txt Or Csv File
i'm using ftooltext to create files and i'm wondering whether any of the other ftools or any other program are able to read the words inside a .txt (or .csv) and store the variable in flash 5.
Basically, there already exists a text file with a words in it and when I run the flash program, I want to store each word from the text file as a value of a variable in the flash program. Is this possible and how would I do this?
Thanks very much!
dartagnan
Reading File With PHP
Hi all, I have the following PHP script that receives two parameters: folder name and file name.
On the Flash side, I verified that the arguments are being passed correctly. I also made sure the path to the file on the server is correct. On the PHP side though, I noticed that the variables receive no value and the function
returns "undefined". What am I doing wrong? :(
Attach Code
$a = $_POST['a'];
$b = $_POST['b'];
$fp = fopen("Temp/".$a."/".$b, "rb") or die("Temp/".$a."/".$b);
$contents = fread($fp, filesize("Temp/".$a."/".$b));
fclose($fp);
echo "&data = ".$contents;
Reading .as File
I'm designing a Flash website for very low bandwidth in order to do that i want to keep the actionscript in a .as file. Since the scroll bars used in different sections use the same ActionScript coding I want to maintain a single .as file from which will be loaded into each scroll bar, but the dynamic textbox inside each section has a different name. Therefore how can i achieve what is wanted when each dynamic textbox (where the text needs scrolling) has a different variable name ?
Reading In Actionscript From External?
hello all,
How can i read in my actionscript from an external file such as a text file? I would like to do this rather than hard code it into my page because it contains an array that i will need to change the properties of quite regularly.
i think it can be done but i'm not 100%
thanks.
Reading External Files....
Hello everybody,
Can anybody tell me what are the different type of external files that we can read from Flash MX. I know that we can read a .txt file and a .xml file. Is there any way to read a .ini file or .dat etc... ?
Thank You :-)
Scrollbar Reading External XML
I don't know much actionscript envolving XML, but I know that there is code handling it. Is there a way to change a scrollbar that loads an external text file and make it a scrollbar that loads an external XML attribute holding text?
External SWF Reading Problem
I got some problems regarding loading SWF files externally, I can explain more via my PDF file located at http://www.sendspace.com/file/2mh2oc .
Whenever my main menu file, is loading another SWF file (Exp : Arts page), the hotspots in the main menu are still functioning rather than turned off. It's a simple script that I use, after clicking the link, I order it to go back to the main menu gotoAndStop(3), the first 2 frames are preloaders. Frame 3 are the hotspots and actions while the rest of the frames are animations, if I don't apply that gotoAndStop(3) action, the problem looks like it's solved, but unfortunately, if I exit my Arts page, the main menu file is already gone. The main menu is in a blank frame, that's why it looks like gone, that's the problem.
According to the PDF file, I was using simple scripts. I wonder if anyone know how to use If & Else, I'm not good at those. And I wonder if that helps to solve the problem, because I'm trying to achieve to do something like this.
http://www.stephaneguillot.com/index_uk.htm
My website is based on that website, where main menu at Frame 3, while the rest of the frames are animations. It loads the SWFs externally, if I'm correct and hides the main menu completely, most of all, the hotspots in the main menu are gone, when I exit the arts page, the main menu comes back. Please help, thank you.
PS : This one is for my Web Design project in my college, please help to solve it as quickly as possible. ;) Thank you.
Reading External Variables
I have a question:
I have a page in which the user will click on a watch video buton. This button is controlled via JavaScript (another programmer did this). He asked if it would be possible to have a swf with two buttons on it (on the same page where the JavaScrpt is): Low and high. The user should be able to choose one of the the two types of video (low or high resolution).
The problem:
1 - The javaScript is sending the two variables with the low and high values. How my swf can access these variables.
2 - On youtube.com, as I noticed, when you click on a link for a video, i.e: http://www.youtube.com/watch?v=65N_1eSkKWg, it seems to me that the swf read that address and reacts acordingly.
3 - What kind o method inflash should I look into in order to start my programming?
loadVars() or something like that?
Thanks.
Reading External Flv Properties
Does anyone know how I might be able to read the height/width of an external .flv file I am playing as a netStream? I have a player window that needs to remain a specific size but cannot control the size of the .flvs, and the client has asked that they just be centered, but they will be coming from other vendors in various dimensions.
Thanks,
Greg
Reading External Data
If a SWF was placed in a PHP file, does it have the ability to read any of the PHP file's variables? I would like to re-use a SWF on multiple PHP pages and have it behave differently based on certain conditions.
An example is a a PHP URL like showAnimation.php?picURL=http://www.site.com/image.jpg and the embedded SWF would do some crazy animation with the picture. How would the SWF be able to read $_GET['picURL'] ?
If this is not possible, what other languages could Flash coordinate with? All I need is for Flash to read data from the page it's embedded in.
Numbers In Txt File Var?
i dont get this!
mw = Number(moviewidth);
mh = Number(movieheight);
jim._x = (500-mw)/2;
jim._y = (400-mh)/2;
loadMovie(movie, "jim", "GET");
if i set moviewidth var in flash as eg: 123 or "123" it works
but cant get it to work if i load var from txt file?
eg: &moviewidth=123
cant work it out...
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
LoadVariables Reading From A ASP File
LoadVariables will load a normal .txt file fine, but if its a serverside scripted file which is outputting exactly the same stuff, then LoadVariables just wont load it.... at all!
Why?
here is the ASP file: http://www.tns.co.uk/dev/t/inc/ticker.asp
here is the SWF file: http://www.tns.co.uk/dev/t/inc/ticker.swf
this is the code i am using to load the variables from the ASP file:
loadVariablesNum("ticker.asp", 0);
if (aaa ne "")
{
gotoAndPlay(9);
}
this is inside a loop, so it will keep running until the variable aaa equals something... if i change ticker.asp to ticker.txt it works fine, but it wont read the scripted file at all!
Why oh why oh why?? Is this a limitation of flash or am I doing something wrong? If someone could help this would be much appreciated because Im really starting to tear my hair out abotu this!
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
Php Reading File On Server
ok i was wondering if there is a way to have a php file read what is in a certain folder on your server and then display a link to them using the file name, i am sure there is a way i am just clueless how
Reading Txt File From Flash?
If somebody could please help me with my problem, I'd be so happy, I'm new at this.
I currently have an HTML news page that reads the news via PHP from a text file. The php code is below. I want to have that page do that SAME exact thing, but in Flash! How?!?
<?php
$fd = fopen ("txtlist/news.txt", "r");
$content = fread ($fd, filesize ("txtlist/news.txt"));
fclose($fd);
$line = explode(";;", $content);
echo "<table cellpadding=4 cellspacing=9>";
foreach ($line as $lines) {
if ($lines) {
$linestr = explode(";", $lines);
$date = $linestr[0];
$body = $linestr[1];
echo "<tr>";
echo "<td align=center><b>$date</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>$body</td>";
echo "</tr>";
echo "<tr>";
echo "</tr>";
echo "<tr>";
echo "</tr>";
}
}
echo "</table>";
?>
</p>
Reading Variables From Php File
Hi,
All I want is to read three variables from php, in flash.
For example, I have the index.php file :
<?php
$x1 = 3;
$x2 = 16;
$x3 = 49;
?>
And I want to take the variables values in Flash, and trace them.
Can anyone give me the fla file doing this?
Lots of 10x!
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?
|