[text Field] Load Text From External
Hi, in Flash MX and 5 you can save a .txt file and then load it into Flash textField as long as you give it a variable name, does it work in MX2004 textField component?
asy I have a .txt file I want to load into textField COMPONENT, how should I do??..thanks fo your help!
Ultrashock Forums > Flash > ActionScript
Posted on: 2004-02-12
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Linking External Text Files To Load Into A Text Field
hmmz.. i followed this tutorial.. http://www.flashkit.com/tutorials/In...40/index.shtml
Actionscript for Flash 5 dummies: Scrolling a text box II
so i manage to get everything to work so far minus the scroll bar which i omitted..
now i would like to be able to have different buttons to load different text files externally into the same text field..
what code shld i put for this buttons??
the movie clip of the textfield+scroller is called textbox
the textfield is called textbox2
the var of the textfield is called welcome
hope someone understands me..
Just Want To Load External Txt File Into Dynamic Text Field
I'm trying to load the contents of a .txt file into a dynamic text field. What am I doing wrong here?
I have a dynamic text field with the Var: phone
I have a text file called: phone.txt
contents of phone.txt:
pn=<HTML><BODY>1-555-555-5555<BODY><HTML>
actionscript on the timeline:
loadVariablesNum ("phone.txt", 0);
phone = pn;
This has to publish to Flash 5 player
thanks
Load External Txt File Into Dynamic Text Field
Hello! Got a huge issue with a website , and the problem is that I am not able to load in external text files into a dynamic text field...
I got a button that is suppose to:
on (release) {
loadText = new LoadVars();
loadText.load("TEXT1.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
_root.sub_mc.textHolder_mc.historia_txt.html = true;
_root.sub_mc.textHolder_mc.historia_txt.htmlText = this.myNews;
}
};
}
It is suppose to load an external text file from the same folder as the flash file is located...
the target file lies in a movieclip. Why am I experiencing problems with this ?
Would very much appreciate an answer, totaly confused
Greatings from Handyman!
How To Load External Html File Into A Dynamic Text Field
I'm using Flash mx's standard scrolling text component, but I want to be able to fill the dynamic text box with text from an external text file or html file. Please help the documentation on this from Macromedia is non-existant.
Load Text From A Text File Into A Dynamic Text Field
I'm trying to load text from a text file into a dynamic text field. The text field is on the "blog" page of the website. When I test my movie, the first time I go to the blog page, the text from the external text file (AND the CSS styles) show up fine. But when I click from the blog page to go to the "profit calculator" or "contact" pages and THEN click to go BACK to the blog page, the blog page animates back in, and right as the animation ends, the text on the blog page suddenly disappears and won't come back. PLEASE help me figure this out!
Button Function - Load Text File To Dynamic Text Field
Hey again,
okay straight into it. I have a few button named b1 b2 b3 and so on. Now these buttons i want to load a text file into a dynamic text field called myText. Now the text files which will be loaded contain html tags, so i want to have that property set.
Now current I have home.text loading into myText automically on swf loading. But when I click any of the buttons the text file won't change over.
Now my menu is seperate to the body. I have 3 swf files, one called base.swf, nav.swf and body.swf. Base.swf loads nav and body onto it.
here is what i have as the script.
Frame1 - body.swf
_root.onData = function(){
myText.html = true;
myText.htmltext = _root.myInfo;
}
loadVariables("home.txt", _root);
loadMovie("scratchy.swf", logo);
Frame1 - nav.swf - gigsbut (button)
on (release) {
loadVariables("gigs.txt", _root.body);
}
can anyone help point out where I am going wrong. I have a feeling I am not targeting the text field right from the button. If you could help point me in the right direction rather then give me the answer that would be good as I would learn better from that. Thanks
Wolfie
PS - Let me know if you want or need more info. Am happy to post it up.
External Text Loaded Into Text Field Won't Change File Attached
I have 3 textfields in 3 different frames. Each text field is for a different section of my website. I want to keep all the code that works for 1 textfield and just change the URL that is loaded. I tried so many different ways. I don't get a error so I believe the URL is being cached somewhere. When I trace it It shows that the other text doc has loaded but the text field doesn't show any change. Is there away to reload/stop cache/delete a variable?
PHP Code:
stop();var newsURL:String = "text/news.txt"//Below is other variables if you wanted to swap out the actual variable versus the url./*bioURL:String = "text/bio.txt"tourURL:String = "text/tour.txt"*///var newsURL:String = "text/news.txt"var textLoader:URLLoader = new URLLoader(); var textReq:URLRequest = new URLRequest(newsURL);var style:StyleSheet = new StyleSheet();//style defined belowstyle.setStyle("a" , {color:"#CC0000"});style.setStyle("a:hover", {textDecoration:"underline"});function textLoaded(event:Event):void{ text_mc.text_txt.styleSheet = style; text_mc.text_txt.htmlText = textLoader.data; }textLoader.load(textReq);text_mc.text_txt.autoSize = TextFieldAutoSize.LEFT;textLoader.addEventListener(Event.COMPLETE, textLoaded);function onClickNews(event:MouseEvent):void{ newsURL = "text/news.txt";// I tried including this in the button textLoader.load(textReq);// also this gotoAndStop(1);}news_btn.addEventListener(MouseEvent.CLICK,onClickNews);function onClickBio(event:MouseEvent):void{ newsURL = "text/bio.txt"; gotoAndStop(2);}bio_btn.addEventListener(MouseEvent.CLICK,onClickBio);function onClickTour(event:MouseEvent):void{ newsURL = "text/tour.txt" //var newsURL:String = "text/tour.txt" gotoAndStop(3);}tour_btn.addEventListener(MouseEvent.CLICK,onClickTour);
Please help Thanks
http://www.theofficialvip.com/testUR...RLSwitcher.zip
Loading External Text File Into Flash Using Links From Dynamic Text Field Link?
I am using a dynamic text field to load in .txt files with html tags. I have a couple "click here" type links that I would like to use to load a different .txt document into the same dynamic text field instead of a url link like it does default. Is this possible? I'm sure I could put a button over the text since its not long enough to need a scrollbar but I would like a more dynamic and flexible way to do this if its possible.
Thanks
Load Html Text Into Dynamic Text Field
Does anyone know the action script I need in order to load an external html text file (e.g. mytext.htm) into a dynamic text box. The dynamic text box has an instance name of ArticleTxt. Also where do I apply the action script, is it frame based? or do I apply it to the text box?
Load Text Into Masked Dynamic Text Field
hey ppl,
Ok I'm having some trouble here. i followed this tutorial (http://www.kirupa.com/developer/mx2004/cssfile.htm) in order to load text from an external file and apply css styles to it. BUT my problem is that the text is under a mask. Embedding the font results in an empty text box, not embedding a font results in the same thing.
Any ideas??!?
Thanks,
-atomicrabbit
Load Text File In Dynamic Text Field
Hello everybody,
I am working on a flash site, but I have a problem with it. I want to load a text file to a dynamic text Field. but my dynamic text Field in is the movie clip.
So How i can do this.
Please suggest me.
Load Text File In Dynamic Text Field
Hello everybody,
I am working on a flash site, but I have a problem with it. I want to load a text file to a dynamic text Field. but my dynamic text Field is in the movie clip.
So How i can do this.
Please suggest me.
Need To Load Text File In Dynamic Text Field
Hi I have to hand in a project tomorrow for class and have one last
obstacle I need to overcome tonight.
I am a flash novice and can not figure out how to load a text file into
a dynamic text field.
I have followed step by step instructions multiple times from the
Macromedia website and another tutorial website and each time I test
the movie the text file does not appear - the window is blank.
Help please?!? Â Any recommendations or other websites I should try?
Using Text File For Dynamic Text Field From External Domain
I have a .SWF file on a (we'll say original.com, for reference purposes)... I have a dynamic text file in that .SWF file, which is currently loading a text file using the loadVariables function. I would like the movie to start loading the text file from another server, which we'll call new.com, for reference purposes.
I'm told that Flash will not load files from external domains, but is that it - end of story? Is there any way I can somehow get this to work?
I know some stuff about PHP, so maybe that'll help?
Any help would be greatly appreciated... Thanks.
External Text File Used In Flash Text Field
hi,
I am working on an fla project that loads an external text file. The problem is, when I put a return into the external text file, I get a double return in the flash textfield. (I would like the double return in the flash textfield to take the single return from the external text file, and not create a double return.)
My question is, can I use a code in my external text file to make the flash textfield behave correctly. Or, is their some sort of flash setting that will fix the problem.
can you help?
thanks
Problem Loading External Text Into Text Field.
I've never ever had problems doing this before untill now.
Currently my home.fla has set up two scenes. ( preloader and second )
in the first frame of the second there is a dynamic text field with 'news' as the var. And in the first frame of actions layer
Code:
loadVariablesNum("news.txt", 0);
news.txt is
Code:
&news=Todays new is trying to get this thing to work!
I've also tried
Code:
news=Todays new is trying to get this thing to work!
Thanks in advance if anyone knows what is going on with this!
Is It Possible To Display The Text (from External XML File) In A Text Field?
I'm a beginner with Flash ActionScript coding. I've got to make a flash menu that takes the text and URL for the menu items from an external file and displays it on a PHP page.
I've found the code to load text from an external file on the Adobe site:
http://livedocs.adobe.com/flash/9.0/main/00000890.html
However, this code doesn't work. It gives a message "Undefined" in a box, though all the paths are correct.
However, I can't use this code since I need to anti-alias the text display.Is it possible to display the text (from external XML file) in a text field? I can then apply anti-alias and select the text characteristics. I'll embed all the possible font characters in the movie.
How do I make this Dynamic Text for text fields work?
I'm using Macromedia Flash Professional 8 for creating this menu.
Load Text Chunks Into Text Field
I wanted to have a text field and have the take load into by words... letters or chunks.
Now I am not talking about using masks, but actionscript.
Any suggestions?
Save A Text Field In MX As An External Text Doc?
Can MX export a dynamic text field as a text document?
So if users enter what they want into a standalone .exe flash movie, they can Save what they have done as a standard text doc?
Are there any tutorials knocking about?
Callint A Text From An External Text Field
I have created an animtion and in that animation i want to put text dynamically so that i can change the text from text file only whenever it is required.
Can any1 plz. guide me how to start with it?
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
***TEXT WILL NOT LOAD INTO TEXT FIELD***
I have a text file being loaded into a flash multiline, dynamic text box, with word rap.
My text file is about 800 lines and it wont fit into the flash text box, it keeps getting cut off. how would i increase the amount of text that can be held?
I have also tried to change it to an input formatted text box but it still gets cutt off...
i would appreciate any help.
thanks.
Load External Text With Html In Text File...links Possible?
hello forum.....
I loaded an external.txt file into my flash news section so it will be really easy to edit... my problem is when I try to add HTML.. as in ahref tags... the words that are supposed to show up as "links" do not!! I have the html text box checked in the character properties too... is this at all possible ?
[F8] Load External HTML Text To Use For Text Type Effect
Hi everyone,
I want to use a script which generates a cool text 'type' effect.
But instead of declaring the text where the effect should be applied on, in the actionscript, I want the text to be externally loaded from a textfile.
I got this far: (to test if the text is loaded I made a dynamic textbox called 'thankyou' and that works)
PHP Code:
myData = new LoadVars();
myData.onLoad = function() {
thankyou.html=true;
thankyou.htmlText = this.myVariable;
};
myData.load("thankyou/thankyou.txt");
var txt:String = thankyou;
var i:Number=0;
var format:TextFormat = new TextFormat();
format.color = 0x000000;
format.align = "left";
format.font = "visitor";
format.size = 8;
this.createEmptyMovieClip("conteneur",this.getNextHighestDepth());
this.createEmptyMovieClip("curseur",this.getNextHighestDepth());
this.curseur._y=this.conteneur._y=60;
this.curseur._x=this.conteneur._x=65;
this.curseur.createTextField("zone",this.curseur.getNextHighestDepth(),0,0,20,20);
this.curseur.zone.text="";
this.curseur.zone.autoSize=true;
this.curseur.zone.embedFonts = true;
this.curseur.zone.setTextFormat(format);
tempo = setInterval(placelettre, 100);
tempo2 = setInterval(affiche, 150);
function placelettre(){
conteneur.createTextField("lettre"+i,conteneur.getNextHighestDepth(),conteneur._x+conteneur._width,0,20,20);
conteneur["lettre"+i].text = txt.substr(i,1);
conteneur["lettre"+i].autoSize=true;
conteneur["lettre"+i].embedFonts = true;
conteneur["lettre"+i].setTextFormat(format);
curseur._x=conteneur._x+conteneur._width+conteneur["lettre"+i]._width;
i++;
if (i == txt.length){
clearInterval(tempo);
clearInterval(tempo2);
removeMovieClip(curseur);
}
}
function affiche(){
if (curseur._visible==true){
curseur._visible=false;
}
else{
curseur._visible=true;
}
}
This is my textfile:
PHP Code:
myVariable=Testing testing oh yes I'm testing %26 Flash and actionscripting are great fun!!! etc.
How do I tell the effect script that it should use the loaded text file?
And how do I make the generated texteffect box multiline?
I think it just needs a little adjustment, maybe you could take a quick look?
Thanks for any help!
Load External Text Into Multiple Text Fields
Can you load one (1) external .txt file into multiple text fields ?
I'm trying to create seperate variable names for the seperate text fields and reference them from one .txt file - - Is this possible ?
How To Load An External Text.txt Into A Movieclip Containing A Dynamic Text Box?
Hi Guys,
I can load text into a dynamic text box when it is on the main timeline.
But when I place the dynamic text box inside a movieclip, I can't get the text too load into the dynamic text box which is inside a movieclip.
Can anyone explain how to get "loadVariablesNum ("text.txt", 0);"
to load the text into a dynamic text box which is inside a movieclip.
Can't Load External Text Into Dynamic Text Box When Online
Hi Guys,
I have looked around google and found a script to load in an external text file. The file loads in the text fine if tested on my local computer but when I test it on a server it wont load.
I tried changing the text file to a shorter piece of text, say 2 words, and then it worked online. As soon as the text is fairly long I get an "undefined" in the dynamic text box.
Anyway, this is the code:
------------------------------------------------------------------
myData = new LoadVars();
myData.onLoad = function(success){
if (success) {
textboxx.htmlText = this.cont;
} else {
textboxx.htmlText = "error loading variables";
}
}
myData.load("up.txt");
------------------------------------------------------------------
If anyone has any ideas that would be great. I know the variables and targets are all correct.
Cheers in advance
Load External Text Into Variable? (not For Display In Text Box)
Hello,
I've having a hard time getting this to work, and I hope someone can help. I'm trying to load a value from an external text file into a variable named Q1A. Here's my text file:
&A1=correct
Basically, I'm placing quiz questions, four possible answers and whether the answers are correct/incorrect all in a text file. I'd like to make a 'submit' button that checks whether the answer is correct/incorrect (based on what's been defined in the text file). This lets me use the TXT to update all questions/answers, and it also lets me vary which statement (1st, 2nd, 3rd, 4th) will be the correct answer.
I can load external text into text fields just fine, but how do I use loadvars to define the value of a variable that I'd like to test? Any help would be greatly appreciated. Thank you.
Load External Text Into Scrolling Text Frame?
Hi, it's my first post! I just did the Kirupa tutorials on using css styles in flash - perfect! I am having trouble applying it to my flash file though. Probably because I'm using a scrolling text layer to fit a thousand words or so.
This is based on actionscript.org script for scrolling text layers (I believe it was this one I used.
The button calls an .as file
#include "about.as"
which contains all the script for scrolling the chosen text file in your assigned text box. All I want to do is tell the chosen text file to use my actionscript
<http://www.magma.ie/client/flashprospectus/flash.css>
So do I have to add something in the .as file, or in my flash doc itself? What and where do I put it?
Many thanks
ps. Here are the related files:
flash moviekirupa load css
Load Txt Into Text Field
this is pissing me off all i want is a button on release to load an exteranl text file into a dynamic text field and i can't get it to work i tried this code
code:
on(release) {
loadVariables("loadvartesttxt.txt","_root.mytextfi eld");
}
and it won't freaking work
Cant Load External Text Into Dynamic Text Box
I would like to be able to load in text from an external file.
I followed the example in the book that I have, (Flash MX Action Script for Dummies)
and it doesn't work.
I created a text file that I saved into the same directory as the flash file.
I inserted some action script to load the tesxt file, but i don't think its right
here it is anyway.
loadVariablesNum("E:\Work\TRICIA\College\Proje ct\Temp Flash\Temp Text\feas_format1.txt",1);
but i don't know how to assign the contents of the text box to this file and how to display it.
Please could someone suggest a way (that I understand) to do this.
Thanks,
Tricia
Load External Text Into Scrolling Text Box?
I'm wanting to have a text box that loads text from a .txt file I have on my website and once that's loaded, be able to scroll without having to use the filename.scroll += 1; I'm wanting it to glide and this creates that jumpy every time you press, release, rollon.. etc.
any help would be much appreciated.
dfmsguitar
Please Help Me Load Text To Field From .txt File - Thanks
***resolved***
Hi everyone, I've been struggling for a while to get a text field to load text from a text file with html and css formatting - any help would be very much appreciated - the link to the example is here.
As you can see, the text loads ok but its html tags are visible and the text isn't formatted correctly.
Here is how I'm loading my css and text files:
Code:
var flash_css = new TextField.StyleSheet();
flash_css.load("hometext.css");
flash_css.onLoad = function(success:Boolean){
if(success){
hometextp_txt.styleSheet=flash_css;
}else{
trace("error loading css");
}
};
var hometextp_lv:LoadVars = new LoadVars();
hometextp_lv.load("hometextp.txt");
hometextp_lv.onLoad = function(success:Boolean){
if (success){
hometextp_txt.text = this.content;
}else{
trace ("unable to load text file.");
}
};
Can you see if there is a problem with the code above? Could the text in the .txt fil be wrong... it reads thus:
Code:
&content=<h1>title: first post</h1> <h1>date: 18/09/05</h1> test
And here is the .css file if that is whats causing the problem:
Code:
body {
font-family: fff harmony;
color: #FFFFFF;
font-size:8px;
}
h1 {
font-family: fff harmony;
font-size:8px;
background-color: #3d3d3d;
color: #00cc00
}
a:link {
color: #00CC00;
text-decoration: none
}
thanks for reading all that and helping me if you can. much 'preciated
*edit - sorry about that middle bit - the html rendered incorrectly...
How To Load Array To The Text Field?
Someth. do I wrong
I tested it simply with this code and the textfield aslo displays only the last index c even if the array has content a,b,c and trace() outputs abc
Code:
var a:Array = new Array ();
var myArray:Array = new Array ("a", "b", "c");
for (i = 0; i < myArray.length; i++)
{
a[i] = myArray[i];
// output abc
trace (a[i]);
// fill only c
entries.text = a[i]
}
How can we fill it?
[F8] Load Image Into Text Field
Hey
I have a question about who to load an image into a text field.
I know that i can use the loadMovie function, but that only takes jpg.jpeg files.
so my question is...
How can I load an image (jpg,gif,png,swf) into a text field or a TextArea (component) ?
Trying To Load A Dynamic Text Field
I'm trying to load a data element from a mySQL database. I have constructed a PHP application that works properly. I have formatted the output to look as follows &nmpoints= <?php echo row[2]; ?> and the php app extracts the correct data.
My Action Script 2.0 looks as follows:
var lvPoints:LoadVars = new LoadVars();
lvPoints.onLoad = function(bSuccess:Boolean):Void {
if (success) {
nmpoints = this.mcCartsuccess.tdPoint2.text;
}
lvPoints.load("nmpoints.php", "this");
}
My Action Script run find, but it never populates my tdPoints2.text field.
What am I doing wrong?
Thank you in advance for your assistance.
Text Field Undefined On First Load
I am importing vars from a txt file and they come up undefined at first then when you advance the photo everything works fine
they display the gps coords for each photo,
I have been working on the for a while and cant get tit to work.
here is the file is any one can take a look at it
http://lstatic.com/junk/images.fla
How To Load Array To The Text Field?
Someth. do I wrong :rolleyes:
I tested it simply with this code and the textfield aslo displays only the last index c even if the array has content a,b,c and trace() outputs abc :confused:
Code:
var a:Array = new Array ();
var myArray:Array = new Array ("a", "b", "c");
for (i = 0; i < myArray.length; i++)
{
a[i] = myArray[i];
// output abc
trace (a[i]);
// fill only c
entries.text = a[i]
}
How can we fill it?
Load XML Node Into Text Field?
I"m at a point where I can't figure out the next step.
I'm trying to lead some of the text from an XML file into a text field.
I'm pretty sure this needs to be a dynamic text field so I can put an instance name on it.
I just dont know how to implement that.
Any help would be appreciated.
Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("http://www.kirupa.com/net/files/sampleXML.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks(xmlData);
}
function ParseBooks(bookInput:XML):void {
trace("XML Output");
trace("------------------------");
trace(bookInput.Book.author.text()[0]);
}
|