Onclick Load Text File Into Textbox
Hi all, could anybody tell me how i can make a textbox display a .txt file when a button is clicked ie. when button1 is clicked the textbox would display the data in button1text.txt, when button2 is clicked the textbox would display the data in button2text.txt etc.
thankyou very much to anyone who could help me
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-28-2004, 02:49 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Textbox From External Text File.
i want to load the text into a textbox.
This is the button.
on (RollOver) {
loadVariables("Tes1.txt", "_root.Scene10.text_menu5");
tellTarget ("text_menu5") {
gotoAndPlay(2);
}
}
The Textbox contains:
onClipEvent (load) {
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
}
onClipEvent (enterFrame) {
if (frameCounter%speedFactor == 0) {
if (scrolling == "up" && this.daTextBox.scroll>1) {
this.daTextBox.scroll--;
} else if (scrolling == "down" && this.daTextBox.scroll<this.daTextBox.maxscroll) {
this.daTextBox.scroll++;
}
frameCounter = 0;
}
frameCounter++;
}
i can put the file on as it is to big.
Your prompt response would be appreciated.
Many Thanks,
Trent
Scrolling Textbox MC Won't Load External .txt File...HELP PLEASE
Can anyone figure out why this attached file won't work??
I have a scrolling textbox that won't load the external text file...the scrolling works fine...but no dice on the text.
I set my text file up in notepad correctly, so I know it has something to do with the flash file.
thanks for your help...this place is great!
tony
Can't Load External Xml File String Into Dynamic Textbox
Why won't this work?
I have a movie with a single frame. There is a dynamic textbox named "xmlDisplay". Set to multiline.
There is also a button with these actions:
on (release) {
function myOnload () {
xmlDisplay = myXML.toString();
}
myXML = new XML;
myXML.onload = myOnload;
myXML.load("xmlIntoFlashText.xml");
}
When the button is pushed, nothing is displayed in the textbox. Checked the spelling of external filename. Tested locally through Flash as well as from server, results in the same behavior.
Any ideas?
Thank you very much!!
Load Text Into Textbox In A Different Frame
I have two frames. In my main frame I have a textbox. In the other frame I have my navigation. Now I want to load text into my textbox by clicking on one of my buttons in my navigation frame. Is this possible?
[F8] Load External Text To Textbox
I need to setup a news system for my website, and it would be very annoying to have to upload the FLA every time we update news. It would be much easier to make a document that we can edit the content of easily (like a separate .txt page or something).
How do I go about doing this?
~Zippy Dee
Ted Newman
Load External Text In Dynamic Textbox
I have this code below but it will not work unless I have my text variable hard coded in there:
[as]
addressVars = new LoadVars();
addressVars.load("ticker.txt");
addressVars.onLoad = function() {
//_root.myText = addressVars.news;
isItBold = 'true';
myFontSize = 30;
myTextHeight = myFontSize + 10;
myTextWidth = 400;
//scrollIt(_addressVars.news, 0xFFFFFF, 0, 0, myTextWidth, 3);
function scrollIt(textToWrite, theColor, x, y, width, speed)
{
//trace(addressVars.news);
//trace(textToWrite);
this.createEmptyMovieClip("marquee", 1);
marquee._x = x;
marquee._y = y;
marquee.createEmptyMovieClip("theText", 2);
marquee.theText._x = 15;
marquee.theText._y = 1;
marquee.theText.theWidth = Math.round(addressVars.news.length * 8) + 10;
marquee.theText.createTextField("theTip", 0, 0, -1, marquee.theText.theWidth, myTextHeight);
marquee.theText.formatIt = new TextFormat;
marquee.theText.formatIt.font = "Arial";
marquee.theText.formatIt.align = "left";
marquee.theText.formatIt.bold = isItBold;
//marquee.theText.formatIt.color = theColor;
marquee.theText.formatIt.size = myFontSize;
marquee.theText.formatIt.html = true;
marquee.theText.theTip.html = true;
marquee.theText.theTip.htmlText = addressVars.news;
trace(marquee.theText.theTip.htmlText);
marquee.theText.theTip.setTextFormat(marquee.theTe xt.formatIt);
//textFieldWidth = theText._width + 10;
marquee.theTextFieldWidth = marquee.theText.theTip._width + 10;
marquee.createEmptyMovieClip("backgroundBox", 1);
//marquee.backgroundBox.lineStyle(1, 0xCCCCCC, 100);
marquee.backgroundBox.moveTo(10, 0);
marquee.backgroundBox.beginFill(0x444444, 10);
marquee.backgroundBox.moveToHere = width;
marquee.backgroundBox.lineTo(marquee.backgroundBox .moveToHere, 0);
marquee.backgroundBox.lineTo(marquee.backgroundBox .moveToHere, myTextHeight);
marquee.backgroundBox.lineTo(10, myTextHeight);
marquee.backgroundBox.lineTo(10, 0);
marquee.backgroundBox.endFill();
marquee.theText.setMask(marquee.backgroundBox);
marquee.theText._x = width;
marquee.theText.returnTo = width;
marquee.theText.onEnterFrame = function()
{
returnX = 0 - this._width;
if(this._x > returnX)
{
this._x -= speed;
} else {
this._x = this.returnTo;
}
}
}
}
{/as]
Please let me know what I am doing wrong.
Load Multiple Text Files In A Single Textbox On Click
Hi,
I'm trying to build an online learning experience for children and i have a set of 7 characters: princess, alien, caveman, clown, dr, chaplin and hippie. I have a dynamic textbox named infotext and i want to be able to load a different text file when the user clicks on the corresponding character. "readthis" and "area" are just graphics that will have to appear no matter where the user clicks. I have managed to get it to work with the first character and I'm stuck somewhere about there. I'm new in flash so if you could make it as detailed as possible that would be great. My code so far for this is:
Quote:
readthis.visible = false;
area.visible = false;
infotext.visible = false;
princess.addEventListener ('mouseUp', function() {
infotext.visible = true;
readthis.visible = true;
area.visible = true;
var url:String = "princess.txt";
var loadit:URLLoader = new URLLoader();
loadit.addEventListener(Event.COMPLETE, completeHandler);
loadit.load(new URLRequest(url));
function completeHandler(event:Event):void {
infotext.text = event.target.data as String;
Thanks in advance,
- Theo
URL In Textbox Loaded From External Text File
Hi!
Lately, I have trying very options about working with dynamic contents in Flash, and I confess that I already got a lot of cool tricks...
Well, I know that I CAN load an external text file to a textbox. Ok.
Now, I was thinking if is possible to store URLs (links) in this external file.
Once that it IS possible when writing the text directly in the textbox, setting the "Render to HTML" option and using the proper link field, I cant see why it wouldnt be possible with an external text.
I tried to enable the "Render to HTML" option and just put the HTML tag in the text (e.g. <a href=http://www.myurl.com>click here</a>) but it dont works and Flash reads my tag as straight text.
Anyone knows how to do that?
Thanks!
Insert Text From File Into Input Textbox, Is It Possible?
Hello,
Is it possible to insert text from a text file into an input textbox?
I tried the following code but it made the input textbox stop being functional:
// textBox.textBox is my input textbox.
openText("hello.txt");
function openText(file) {
var format = new TextField.StyleSheet();
var path = "flash.css";
format.load(path);
format.onLoad = function(loaded) {
if (loaded) {
textBox.textBox.styleSheet = format;
myData.load(file);
} else {
textBox.textBox.text = "Error loading CSS file!";
}
};
myData = new LoadVars();
myData.onLoad = function(){
textBox.textBox.htmlText = this.content;
};
myData.load(file);
}
If anyone could shed some light on this that would be great. As a reward I may give you a copy of my flash update program that I'm making.
Thanks,
Anders
No Hyperlink In Textbox Via Exyernal Text File
hi, i have followed the loading of the external textfile into my flash movie from this excellent site, and it works...but the hyper links don't work.
my textbox actionscript is :
loadText = new loadVars();
loadText.load("work.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
and my textfile is :
myNews=<a href="www.bricktaylor.com" target="_blank">Brick Taylor</a><br>
<a href="www.qaommunications.com.au" target="_blank">Q and A Communications</a>
does anyone have any idea why the links don't work in the flash movie ?
thanks for any help
Loading A Text File Into A Dyanmic Textbox
http://www.kirupa.com/developer/mx/dynamic_scroller.htm
I followed that tutorial, it didn't work and I followed one on macromedias website. Both are giving me the same error. I'm using flash mx 2004 professional version 7.2
Quote:
**Warning** Scene=news, layer=actions, frame=1:Line 1: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
loadVarsText = new loadVars();
Total ActionScript Errors: 1 Reported Errors: 1
It shopws me that and in the text box there all it says is 'undefined'
The code on the layer that contains the textbox:
Quote:
loadVarsText = new loadVars();
loadVarsText.load("test.txt");
scroller.text = loadVarsText.var1;
I've also tried w/o that last line of code. Also the sample file off the kirupa tutorial gives me the same error. What's going on?
No Hyperlink In Textbox Via Exyernal Text File
hi, i have followed the loading of the external textfile into my flash movie from this excellent site, and it works...but the hyper links don't work.
my textbox actionscript is :
loadText = new loadVars();
loadText.load("work.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
newsBox.html = true;
newsBox.htmlText = this.myNews;
}
};
and my textfile is :
myNews=<a href="www.bricktaylor.com" target="_blank">Brick Taylor</a><br>
<a href="www.qaommunications.com.au" target="_blank">Q and A Communications</a>
does anyone have any idea why the links don't work in the flash movie ?
thanks for any help
How To Read A Specific Line From A Text File Into A Textbox
Hi,
I need textbox1 show whatever text it may find on line 3 in textfile.txt
The textfile.txt must contain only the text I want it to (e.g. a poem), no scripts! No "textbox1=", "&" or other variables - just the plain text that needs to be read unto the textbox1
I need also to know how to make textbox1 show whatever text it may find on line 3 and line 5 in textfile.txt
Thanks..
Loadong Variables Into A Dynamic Textbox From An External Text File
i am trying to load variables from a txt file into a dynamic text box. The textbox has a variable name "textfield" and is located in a movievclip, instance name "text", within another movieclip, instance name "pan1".
The "pan1" movieclip is located on the main timeline and i am using an onClipEvent (load) command to populate the dynamic text box with information from a txt file held in the same folder as the swf, called "firstText.txt".
The code i am using is as follows
//code starts here
onClipEvent (load) {
loadVariables ("firstText.txt", "_root.pan1.text");
}
//code ends here
The information does not see,m to load into the dynamic text box
can anyone help me here please?
Load Jpg/swf Thru XML List, OnClick
Hello people!
I've been looking thru the forum but can't find a very simple way to do this.
Have a look at this quick illustration:
What I want to happen is:
When you click a thumbnail (button) on the right side, a jpg (or swf) loads into the light grey field on the left. It has to have a preloader bar aswell. The files are loaded from an XML file.
I would assume the XML Photo Gallery Tutorial is a good start, but I'm not very good at actionscripting so a little help would be very nice
Thank you!
Onclick -- Go To New .swf File
I am creating a fairly large product demo site.
I don't want a viewer to sit there for an hour while the thing loads.
Question: Should I make about 4 or 5 (short) different .swf files and then onclick, play them??
When do they load?
or should I make them so small that they do not have to load.
Is this the correct way of making a large scale movie??
I would appreciate some suggestions
Thanks
Onclick Plus 1 In Txt File
hi all, i have a falsh button, how would i make flash plus 1 in a text file each time i clicked the butn hope this amke sense, big thx to all who reply..and have a great xmas and new year to all
Load Variables From Text Then Loading Image File With The Filename Given In Text File
The problem is, that i need flash to load variable from text file, eg: info.txt, with image=gt.jpg in it.
Then I want flash movie to load a gt.jpg into a blank movie.
The point is that after i change filename in txt file, i want movie to load that img.
I wrote AS:
loadVariablesNum("info.txt", 0);
loadMovieNum(image, 0);
but it's not working
After i traced variable image, debugger showed that this variable undefined, but if i put textbox with image as variable, it shows "gt.jpg".
Please help
Movie Clip, Onclick Load Mc.home
Hey guys I got a realy dumm question about movieclips. And I just can find anything to help me. Im making my portfolio site with flash, and I want to open a movieclip when someone clicks on a button...
Ok here's my question, how can I make a button that when you click on it it loads a movieclip and it has to stay there until you click on a other button?
And how do give that button a fade in fade out effect?
The fade in fade out is for this.
O - O - O - O <--buttons)
-----------|
| Contact |
-----------
When your mouse goes over a button the text "contact" has to fade out and the text for a other button should fade in the box.
Well thats about it, I hope you can help me with this please!
Load Text File Data (No Variable In Text File )
Hi everyone,
In Flash Mx,
How can i load data from the text file ??
I know its easy using variables but..
There is only text, no varibales like -- Name=bla bla
in the text file
So, how can i load all the data from the text file in a varibale(I am not getting any variable from the text file, getting only data) ??
Thanx in advance,
$hailesh Mewada
Text - Can I Set OnClick Functions?
Can I set the function for the onClick event (what's it really called in Flash?) of a text object dynamically using AS?
I've got 56 text objects.
I've got one function for all the objects but the parameters will be different for each one.
I'm loading the Names (the text) into vars from an XML document. Can I set the onClick event proc for each one while going through that loop?
Or is there a better way?
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.
[F8] Can Flash Load Text Without Changing It And Display Whats Raw In The Text File?
just curious... I just want flash to read a txt file and do nothing to it... just echo it out loud and display it in Flash...
is there a way to do this?
like if the text file had "the quick brown fox jumped over the lazy dog" in it and NOTHING else... no variable syntax or anything..
is there a way this can be done?
I appreciate anybody who can help
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 ?
Load Text From Text File, INSIDE A Movie Clip...
Hi, I'm making this website, and I want to have a news section on it, and therefore I have to load some text from an external text file. This works fine when I try it out in a new, blank movie, but on my page, I have to have the whole Text Field inside an MC, and this is where it all goes wrong....
Nothing shows up at all when I do exactly the same in the MC as I do on the mainstage...
I don't blame u if you didn't understand what I was talking about
Hope someone has an answer!!
Thomas
3. Multiple Load Text From A Single Text File
I have two dynamic fields and i want them to load information from the same text file, like if u read the other post their profile. Their profile looks like this:
Neo
AIM: KoTr Neo
MSN: kotrneo@hotmail.com
E-Mail: kotrneo@hotmail.com
In the first text field i want their name to show in it and then the rest of the information in the other text field. In other words I want to have ONE text fiel to load into TWO dynamic fields.
How To Load Text From A Text File Using Dynamic Textfield?
is there a way that i can load text from a textfile using dynamic textfields? i can use an alternative where if the textfield's name is 'poetry', i'll just make a button that changes the text like
on( release )
{
poetry = "blafhlanflh lnalfhafl af";
updateAfterEvent();
}
but what if i have many poems to load? it will make the file bigger so im thinking that maybe ill just load text from a text file so even if i have many poems or other data, i can just load them from text files making load time faster...is there any way? hope you understood my dilemma...thanks in advance!
How Do I Load Text From A Text File Into A Dynamic Textfield?
is there a way that i can load text from a textfile using dynamic textfields? i can use an alternative where if the textfield's name is 'poetry', i'll just make a button that changes the text like
on( release )
{
poetry = "blafhlanflh lnalfhafl af";
updateAfterEvent();
}
but what if i have many poems to load? it will make the file bigger so im thinking that maybe ill just load text from a text file so even if i have many poems or other data, i can just load them from text files making load time faster...is there any way? hope you understood my dilemma...thanks in advance!
How To Load Text From Text File To Falsh Movie
How can we load text from text file to flash movie, so that next time you just modify the content of text file without modifying the movie for different text message on the same movie clip.
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?
Load A .swf Within .swf File As Per Text File Value
I just want to load a .swf file withing my current .swf file as per the value the external text file.
I have done few experiments too.
1) I have writter below code on the first frame of my movie. here "myMC" is my target movie clip inside which i want to load another swf file.
loadVariables("myData.txt", "_root.myMC");
2) the code of my external text file is as below
sm=one.swf;
Now my doubt is where and how i should write the loadmovie command to load my swf file.
can anyone please give me the logic or can send me sample files.
my email id is : sanjay2211@rediffmail.com
Load A .swf Within .swf File As Per Text File Value
I just want to load a .swf file withing my current .swf file as per the value the external text file.
I have done few experiments too.
1) I have writter below code on the first frame of my movie. here "myMC" is my target movie clip inside which i want to load another swf file.
loadVariables("myData.txt", "_root.myMC");
2) the code of my external text file is as below
sm=one.swf;
Now my doubt is where and how i should write the loadmovie command to load my swf file.
can anyone please give me the logic or can send me sample files.
my email id is : sanjay2211@rediffmail.com
How To Choose Which Text To Load From A Text File.
I posted this recently without a response but I think my subject line was misleading..
I am trying to pass a variable to choose which text to load, with multiple variables in the text file. This works if I replace the _global.curTxt with just Pic0001, it loads the text but I want to be able to pass which portion of the text I want loaded from the text file.
Here is the code:
_global.LoadText = function() {
PhotoTextVar.load(_global.curPath+"PhotoInfo.txt") ;
PhotoTextVar.onLoad = function (success){
if (success){
_global.curTxt = ("Pic"+_global.curPic)
trace (_global.curTxt);
PhotoInfo.text = this._global.curTxt //PROBLEM HERE!
}
}
};
My Text file looks like this:
Pic0001=Testing 01
&Pic0002=Testing 02
&Pic0003=Testing 03
The output is this:
Pic0001
Pic0002
Pic0003
Thanks in advance
Prototype To Load Text From Text File
Please help, I'm still trying to get to grips with prototypes.
I want to load in text variables (pic1, etc) from an external text file (bike.txt).
The following code works fine when attached to a movieclip.
on (release) {
myData = new LoadVars();
myData.onLoad = function() {
_root.pic_txt.text = this.pic1;
};
myData.load("bike.txt");
}
But as I have lots of pics, I would like to have the bulk of the code on the first frame and just have the "_root.pic_txt.text = this.pic1;" attached to each button.
Any ideas???
|