Loading A Different File For Each Button In A Single Dynamic Text Field
Hi,
I'm trying to make something where I have many buttons associated to a different file. Each time a button is clicked it should load the text from that file into the dynamic text field. Also in future, just to be able to open any file associated to the button dynamically
------
This is the code I put in for each button:
on (release) {
_root.gotoAndPlay(1);
}
This is the code I got from Kirupa.com so that the file text can be displayed in the dynamic text field:
/****************************************
*********************
****************************************/
ranFile = new LoadVars();
ranFile.onLoad = function(success) {
if (success) {
ran = this["txt"];
file_txt.text = ran;
}
else {
file_txt.text = "The text failed to load due to an error";
}
}
//need to figure out how to get fileNum to be able to determine which file Number //from which button was clicked
fileNum = "1"
//fileNum represents the number in the file name
ranFile.load("\assets\button_load_file" + fileNum +".txt");
stop();
------
Thanks!
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-22-2005, 04:27 PM
View Complete Forum Thread with Replies
Sponsored Links:
Txt.file Loading In To Dynamic Text Field Problem.
My problem is that the field wont show some symbols like Ää and Öö. What to do? please help.
��rrrgrhr���hh <-- Text shows mostly like that... Ääärrrghööööh :P
Quote:
text_lv = new LoadVars();
text_lv.onLoad = onText;
text_lv.load("lam.txt");
function onText() {
yritys_txt.htmlText = text_lv.lamText;
}
Thats my code...
View Replies !
View Related
Loading An Image Into A Dynamic Text Field Via .txt File
I am attempting to load an image into a dynamic text box that scrolls. I have the textbox set to render as html and in the .txt file I have the following code:
[html]
scrolltext=<img src='images/bioPhoto.jpg' align='left'/><br/><br/>Rob began playing guitar in t......
[/html]
The above works but only when I view it flash and doesn't work when viewing over the web. I have even put in the absolute path to the image to load so I know it isn't a path issue.
Does anyone know a way to get this to work or a better way around it?
Thanks in advance
View Replies !
View Related
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
View Replies !
View Related
Loading Var. From Ext. File Into A Flash Variable (not Into A Dynamic Text Field)
Hi!
I'm trying to load a simple variable &myVar from a php file into my flash movie, that's a blank movie with just actionscript in it.
I tried to load this &myVar into a dynamic Text field and it works fine, but I can't get this value into a flash variable to manipulate it with actionscript.. Must be simple.. My actionscript it
PHP file:
PHP Code:
$x = "abc";print "&myVar=$x";
ActionScript:
ActionScript Code:
loadVariables("http://www.sywebspace.co.uk/cleveland/new/analog.php", this, "GET");
How to get the myVar value into a FLASH VARIABLE?
not into a dynamic text field, please, because I did this already but it's not what I want.
Many thanks for any help!!!
View Replies !
View Related
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.
View Replies !
View Related
Loading Text Into Mulitple Fields From A Single Text File
Hi there. I am trying, and failing(so no soucre) to make text load dynamically into multiple fields.
I am trying essentially to load text using only one text document- into several fields. This is so I can run a very primitive cms system in flash. (all the fields need to call different portions of the text.
If anyone understands what I mean and how it could be done, it would be great
View Replies !
View Related
Multiple Dynamic Text Variables In A Single .txt File?
Hello... I was wondering if it was possible to store multiple variables in a single .txt file?...
e.g. lets say i have a dynamic text field (main_txt) and I want the text to change with the press of either button (A_btn) or (B_btn)... my code on buttons is:
for a:
on(release){
main_txt.variable = "somevariableA"
}
for b:
same with change being "somevariableB"
ok...so on my main frame I want to have just a
loadVariablesNum("somefile.txt", 0);
where somefile.txt looks something like this:
somevariableA=blah blah blah
somevariableB=halb hlab halb
... when I try to do it like this, the whole of somefile.txt loads in my field when I click on A_btn and nothing happens when I click on B_btn... to solve the problem I have been loading two seperate .txt files, each containing a single variable... I can do what I want to do, I just want to know if you can store multiple variables in one .txt file?...thanks.
View Replies !
View Related
Loading Different Text Files Into A Single Dynamic Text Box... Help
Still suffering a serious confusion here...
I have one dynamic text box and two buttons... and two remote .txt files....
All I want to do is be able to click "info" button.. and have the text from "info.txt" load into the single dynamic text box... and click the "bio" button and have "bio.txt" load into the dynamic box instead.
This may seem so simple.. but other posters talk "variables" etc... and dont really xplain the simple bit!!! so could someone please give me a simple answer!!!
Im stuck.. and Ive only had this one day...!!!
littledannyp™
View Replies !
View Related
Loading A Txt File Into A Dynamic Txt Field
hey guys, ive been working on this for a while...trying to get flash to import some text for me from w/i the same file that the movie is in, im usualy very horiable at explaining stuff, so i took some screenshots to show you whats happening:
here is all i have set up for my dynamic text, and i have no scripting in the timeline, simple as this
this here shows you that they are both in the same folder, and what i have in for the txt file that im trying to get it to load....
what am i doing wrong here, could someone please tell me?
View Replies !
View Related
Loading External File To Dynamic Txt Field
hello,
does anybody know how to load external file (preferably XML, but I don't know what it is (^ ^ into dynamic textt field when the frame was loaded?
e.g, you click on ' flight schedule' from home page, go to flight schedule section, and there you have the flight infomation! so I want to load flight info as external file, but i want to show that info on one page, no button to go to another page.
please help!
View Replies !
View Related
Loading Info From INI File Into Dynamic Field...
Folks,
I have a Flash Projector application that is a frontend for an electronic Catalog (PDF'S). I have incorporated an install and web updater feature on the CD so the user can install on their system. After installing, I have a web updater feature that goes out and checks for newer versions. This version information is contained in version.ini on the users system and is updated as they update the latest version. IN the ini file their is only one line of text...i.e. 4.1.0 I am wonder if it is possible to create a dynamic text field on my splash page (Flash portion) that would go out and read the INI file and place the version number in teh text field. I have been researching and no luck so far.
Thanks for the help
View Replies !
View Related
Loaded Text File Wont Show All Of The Text In Dynamic Text Field
When I load an external text file into flash and display the string in a dynamic text box, not all of the text will show in the text box; and using scroll button to scroll the text doesnt help.
The text that is in the text file is as follows, and as far as I can see there is no reason why all this text shouldnt show in the dynamic text field; by the way all my targets are correct, I know that for fact.
message=Code: Cheat:
BEEPSAGONER Deactivate the censor beeps
DRACULASTEABAGS 50 lives
DUTCHOVENS Frying pan mode
XFYHIJERPWAL IELWZS Debug mode
BOVRILBULLETHOLE Shoot all objects
EASY Easy mode
VERYEASY Very easy mode
SPUNKJOCKEY New death animation
SEXYMANN Birdy & Squirrel scene
Code: Unlock chapter:
PRINCEALBERT Barn Boys
CLAMPIRATE Bats Tower
ANCHOVYBAY Slopranos
MONKEYSCHIN Uga Buga
SPANIELSEARS Spooky
BEELZEBUBSBUM It's War
CHOCOLATESTARFISH The Heist
WELDERSBENCH All chapters and scenes
Code: Unlock Multiplayer character:
WELLYTOP Conker
EASTEREGGSRUS Neo Conker
BILLYMILLROUNDABOUT Gregg the Grim Reaper
CHINDITVICTORY Weasel Henchmen
EATBOX Cavemen
RUSTYSHERIFFSBADGE Sergeant and Tediz Leader
BEEFCURTAINS Zombies and Villagers
View Replies !
View Related
Loading A .txt File Into A Text Field
http://www.cccsystems.com/alternate/
In feedback I loadfeedback.swf in to the main movie, and it doesnt show the text. If I load feedback.swf on its own, outside of the movie I can see the text. How can I run it so I can see the text once its in the main swf?
View Replies !
View Related
Using Buttons To Change The Text File A Dynamic Text Field Loads?
I have a text field that loads text from a text document which works great for the news section of my site. However, is there a way I can keep that same text field and change it's content based on what button is pressed? For instance, if someone is viewing the "news" section of my site, and then they click on the "links" button, can I unload news.txt and load links.txt into that text field?
View Replies !
View Related
Dynamic Text Field: Swap Text With Diff Variable In Same Ext. File
I'm using the recommended
Code:
loadText = new LoadVars();
loadText.load(_global.text_url2);
loadText.onLoad = function(success) {
if(success){}
etc..
which is working well. I just want to attach an action to buttons which will switch the text for different variables in the same text file, in a single text box named archivetitle.
ie.
Code:
archivetitle.text = this.title1;
when button one is pressed
Code:
archivetitle.text = this.title2;
when button two is pressed.
Basically, how do i access an already loaded text object to refresh to a new variable? Thanks!
View Replies !
View Related
Dynamic Text Field: Swap Text With Diff Variable In Same Ext. File
I'm using the recommended
Code:
loadText = new LoadVars();
loadText.load(_global.text_url2);
loadText.onLoad = function(success) {
if(success){}
etc..
which is working well. I just want to attach an action to buttons which will switch the text for different variables in the same text file, in a single text box named archivetitle.
ie.
Code:
archivetitle.text = this.title1;
when button one is pressed
Code:
archivetitle.text = this.title2;
when button two is pressed.
Basically, how do i access an already loaded text object to refresh to a new variable? Thanks!
View Replies !
View Related
Select Text File From Dropdown List, Content To Show In Swf Dynamic Text Field
I have a php page where there is a form with a dropdown list of all text files in my site. The name of the dropdown is $filename.
The action script in my swf is this:
loadVariablesNum("<?PHP echo $filename; ?>", 0);
but I get nothing. It displays correctly when I replace
<?PHP echo $filename; ?> with the actual value of $filename, for example:
loadVariablesNum("ui_websites.txt", 0);
Any ideas what I'm doing wrong?
View Replies !
View Related
Loading A Html-tagged Text File Into A Text Field...it's Just Not Working For Me...
hi,
i'm trying to load news.txt into a textfield using loadvars.
news.txt:
-----------------------------------
&news=<p font face="Verdana" size="12"><b>Recent Achievements:</b><br>Congratula etc. etc.
the as:
----------------------------------
loadnews = new LoadVars();
loadnews.load("flash/news.txt");
loadnews.onLoad = function(success) {
newstext = loadnews.news;
trace(newstext);
gotoAndStop(2);
}
the trace is showing that newstext is the text out of news.txt ... in the frame 2 that the onLoad function refers to is a textfield (multiline, with the html as true) which is supposed to display the newstext variable.
If i set newstext to something else ... eg: newstext = "some text" then it works fine ...
what's going on???
Cheers,
Ben
View Replies !
View Related
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.
View Replies !
View Related
Long Text Doesn't Fit Inside Single-line Input Text Field
Hi, I've been browsing these forums for a long time but this is my first post.
I'm creating an interface by which a user can design and order their own customized decal. Please see my example (I've added my script at the bottom of this post):
http://www3.sympatico.ca/sin.young/decaldesigner.html
My issues are:
1. I've set the character limit to 21, but if you were to type in 21 "W"s into the input field for whatever reason, or choose a wider font, the text shifts to the left and some of the characters become hidden as they don't all fit. I'd like to make the width of the text to always fit inside of the width of the white area. I can't figure out how to make this work.
Here's an example that does pretty much what I'm trying to describe: www.stickerjunkie.com.
2. I have the Standard Colors combo box working perfectly but can't seem to get the Fonts combo box working.
Any hints or links to actionscript tutorials/help that might be useful to my predicament is extremely appreciated.
// display colors and formatting
decalColor = new Color(decal);
color1 = new Color(decalColor);
//
function changeColor(comp) {
decalColor.setRGB(comp.getSelectedItem().data);
}
//Standard Colors array
standardcolors = [{label:'STANDARD COLORS'},
{label:'White', data:0xffffff},
{label:'Black', data:0x000000},
{label:'Silver', data:0x9c9c9c},
{label:'Gray', data:0x636b73}];
collistStandard.setDataProvider(standardcolors);
collistStandard.setSelectedIndex(0);
collistStandard.setChangeHandler('changeColor');
//
//Fonts array
myfonts = [{label:'FONTS'},
{label:'Arial', data:'Arial'},
{label:'Serpentine', data:'Serpentine'},
{label:'Enviro', data:'Enviro'},
{label:'Forte', data:'Forte'}];
fontlist.setDataProvider(myfonts);
fontlist.setSelectedIndex(0);
fontlist.setChangeHandler('');
View Replies !
View Related
Dynamic Text Field Not Loading...
Alright, this works perfectly on my computer (internet) or while testing, yet doesn't work from a few other test computers.
Code:
var i = 0;
var j = 0;
var qna:LoadVars = new LoadVars();
qna.onLoad = function(success:Boolean) {
if (success) {
trace("Worked");
questionNum = randRange(1, 207);
questionText = qna["Q"+questionNum];
answerText = qna["A"+questionNum];
} else {
trace("Load Failed");
questionText = "An error has occured.";
}
};
qna.load("http://www.briancomeau.net/questions.txt");
nextBut.onRelease = function() {
if (inputText == answerText) {
statusText = "";
questionNum = randRange(1, 207);
questionText = qna["Q"+questionNum];
answerText = qna["A"+questionNum];
inputText = "";
} else {
statusText = "Incorrect.";
inputText = "";
i++;
}
};
answerBut.onRelease = function() {
inputText = answerText;
j++;
};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
return randomNum;
}
The questions.txt is at the address that I'm pointing to. It used to be a relative reference but that wasn't working either. Any suggestions?
View Replies !
View Related
Loading Img In Dynamic Text Field
Hello,
I am facing very weired problem. I have tried and had success loading an img into a dynamic textField at run time. But sometimes it takes littile long to load img and gives me an impression that image is not getting loaded.
My textFields html, multiline, autoSize, wordWrap properties are set to TRUE. But still sometimes i dont get my image loaded in to the textField.
Is there anyway i can handle this? Or Is there any way i can trace this issue? My images are also having size of max 7kb.
Any help/suggession will be appreciated !!!
Ashish
View Replies !
View Related
Loading Img In Dynamic Text Field
Hello,
I am facing very weired problem. I have tried and had success loading an img into a dynamic textField at run time. But sometimes it takes littile long to load img and gives me an impression that image is not getting loaded.
My textFields html, multiline, autoSize, wordWrap properties are set to TRUE. But still sometimes i dont get my image loaded in to the textField.
Is there anyway i can handle this? Or Is there any way i can trace this issue? My images are also having size of max 7kb.
Any help/suggession will be appreciated !!!
Ashish
View Replies !
View Related
XML/PHP Loading Into A Dynamic Text Field?
At the gotoandlearn.com website, there is a tutorial on how to use flash, php and mysql. What i want to know, is how do i configure the php file to load more than one row from the database? I'm trying to use this method to create a blog. I have three rows in my database, called title, date, and article. At the moment i can only load one of the three rows. I want to load all three of them.
Also how can i load this xml/php file into a dynamic text field instead of a list component. The list component is no good to me as it doens't provide the functionality that i need.
Any help would be greatly appreciated
Thanks, from JacoX
Click http://www.jacksrambles.com/connect.php for the XML file
View Replies !
View Related
Loading XML Into A Dynamic Text Field?
At the gotoandlearn.com website, there is a tutorial on how to use flash, php and mysql. What i want to know, is how do i configure the php file to load more than one row from the database? I'm trying to use this method to create a blog. I have three rows in my database, called title, date, and article. At the moment i can only load one of the three rows. I want to load all three of them.
Also how can i load this xml/php file into a dynamic text field instead of a list component. The list component is no good to me as it doens't provide the functionality that i need.
Any help would be greatly appreciated
Thanks, from JacoX
Click http://www.jacksrambles.com/connect.php for the XML file
View Replies !
View Related
How Can I Load A .txt File Into A Dynamic Text Field?
It's essential I know how to load a .txt file from my server into a dynamic text field in flash mx. I'm designing a site that has both flash and html versions and I need to be able to update both at the same time through one txt file.
If anyone can direct me in the right direction, I'd appreciate it a lot. Thanks in advance,
Draegos.
View Replies !
View Related
Tutorial Fo' Y'all: .txt File Into Dynamic Text Field
Tutorial: .txt/ HTML file into dynamic text field:
My HTML file is working, because the .txt file is loading into my dynamic text field called: content_txt, with in the var field set (of the property inspector): content_var. The .HTML file begins with: &content_var=
After the equal sign, you might use html tags such as:
<b>Welcome</b>
// Welcome appears in bold text
// only some HTML tags work, eg tags that don't work:
// <html><head><title><body>
// also <font color="red">Text</font> doesn't work when i tested just now.
Put in the first frame of your .fla file:
// create a file called: home.txt/ home.html, then target it like so:
loadVariablesNum("home.html", 0);
Test movie, it would seem the text loads into the dynamic text field.
Mission success
View Replies !
View Related
External File Into Dynamic Text Field?
I've got to be short several thousand brain cells. I've been trying for an hour to get an external text file to load into a dynamic text field without any luck at all. I've Googled all over the place and tried several examples, but none of them seem to work.
Here's what I'm working with:
Flash MX 2004
external file = "/aboutus.txt"
stylesheet = "/includes/style.css"
I've tried loading the external file directly into the text field.
I've tried creating a movie clip and loading it into that.
I just can't get the hang of this. I don't know what I'm screwing up. I'd post my AS code, but I've changed it so many times now there's nothing really coherent there.
If someone could give me some help, I'd appreciate it.
View Replies !
View Related
External File Into Dynamic Text Field?
I've got to be short several thousand brain cells. I've been trying for an hour to get an external text file to load into a dynamic text field without any luck at all. I've Googled all over the place and tried several examples, but none of them seem to work.
Here's what I'm working with:
Flash MX 2004
external file = "/aboutus.txt"
stylesheet = "/includes/style.css"
I've tried loading the external file directly into the text field.
I've tried creating a movie clip and loading it into that.
I just can't get the hang of this. I don't know what I'm screwing up. I'd post my AS code, but I've changed it so many times now there's nothing really coherent there.
If someone could give me some help, I'd appreciate it.
View Replies !
View Related
Dynamic Field Info To Text File
Can someone help?
Here's what I need:
I have users placing information into a series of fields which combine the info in one dynamic text field.
How can I create a text file directly using the text in the dynamic text field? Is there a brief (preferably one-line) actionscript trick to do this?
Here's what I need:
Fields filled in by user --> Submit button clicked --> Dynamic field populated (up to this point done already) --> text field created after dynamic field populated.
Thanks for any help you can give.
View Replies !
View Related
Loading Text Into Dynamic Text Field With Full Justify - Can It Be Done
Hi!
Trying to load in text into a dynamic text field that is html formatted and "full" justify the text.
Cant seem to full justfiy the text.
"full justify": spreads text out to fill up a whole line by automatically setting the spacing between words.
1)
I have tried using html formatting to align the text: <p align="justify"></p>
justify isnt accepted by flash
2)
set the text field in flash to full justify
works fine if text inputted into the dynamic text field before compiling
But if text is loaded in, then the formatting is lost.
Anyone got any ideas how to do this?
I'm thinking of using php's GD lib to create a jpg using text retrieved from a database with the text fully formatted in the jpg image and loading in the jpg image, but then I lose my html formatting.
any other solutions? or have I overlooked something here?
cheers
xiang
View Replies !
View Related
Loading Text Files With Hyperlinks Into Dynamic Text Field
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
View Replies !
View Related
Loading Text Files With Hyperlinks Into Dynamic Text Field
Describes the mood or content of the topic posted 11-22-06 04:41 PM
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
View Replies !
View Related
Loading Text Files With Hyperlinks Into Dynamic Text Field
Describes the mood or content of the topic posted 11-22-06 04:41 PM
I am using Flash 8 and loading external text files in dynamic text fields on my webage. These texts contain html links (<a href="page.html" target="_blank">Click Here</a> and I have "render as HTML" on and "selectable" off in my dynamic text field. Also, I am loading a CSS file. Not only do I not have a hand cursor, but I do not even have any of the text from that piece of html code down. What is going on with this? Please respond asap, as I have been struggling with this for a day now. Here is the Actionscript for loading the CSS:
var flash_css = new TextField.StyleSheet();
flash_css.load("styles.css");
flash_css.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.styleSheet = flash_css;
} else {
trace("Error loading CSS file.");
}
};
var zloc_lv:LoadVars = new LoadVars();
zloc_lv.load("zloc.txt");
zloc_lv.onLoad = function(success:Boolean) {
if (success) {
zloc_txt.text = this.content;
} else {
trace("unable to load text file.");
}
};
zloc_txt.html = true;
zloc_txt.editable = false;
_global.styles.TextArea.setStyle("backgroundColor" , "transparent");
_global.styles.TextArea.setStyle("border styles" , "solid");
Here is a sample of the text file code:
&content=<span class="headline">Northwest Arkansas Locations</span>
121 Main St.
Russellville, AK 77801
(626) 111-1111<br />
<html><a href="
View Replies !
View Related
Problem Loading Text Into Rotated Dynamic Text Field
Hi there
With help from Stratification, I've sorted out my previous problem, but alas it grew into a more insidious and tedious mire. Especially, I am sure, for people who know what theyre doing: I'm still rather daunted by Actionscript.
SO, I'm trying to load a text file, one.txt, into a dynamic text field. Simple enough, but this time I wanted to have the field rotated to a specific angle, and this requirement defeats my meagre knowledge. I've got a rotated dynamic text field, but I can only fill it with text typed into the actionscript (I don't know the term for this) as opposed to loaded from an external text file.
Strat kindly gave me the following code:
stop();
loadText = new LoadVars();
loadText.onData = function(src:String) {
if(src != undefined){
my_txt.text = src;
}
else{
trace("Woops, didn't load");
}
}
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "verd";
this.createTextField("my_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
my_txt.wordWrap = true;
my_txt.embedFonts = true;
//If this text is what we see then something didn't happen correctly.
my_txt.text = "Not Loaded";
my_txt.setTextFormat(my_fmt);
my_txt._rotation = 45;
//Now that everything is set up, load our text
loadText.load("one.txt");
But when I try it, the "Not Loaded" text appears, so something went wrong, and it's beyond me to see what.
If anybody can offer any help I'd really appreciate it.
Cheers!
N
View Replies !
View Related
Exporting Text From A Dynamic Text Field To A .txt File
Hi
I posted a plea for help about a month ago on how I should go about searching text in another swf file. I solved that, with a little help from the forums, but I still need to do one more thing. Only 1 swf file (or page, since this is a website) is loaded at a time so I cannot search every page for a word or phrase. So what I want to do is somehow export the text in all my dynamic text fields when I export the swf file (only when I export it) which my main frame for the website can read. But I don't have a clue how to do this. I have written some code to read a .txt file so all I need is to somehow put the text from my pages into a .txt file on export. Alternatively I could copy and paste the text from each page into a readme file, but I don't want to have to update 2 sources for my website at once!
Thanks for your help; I wouldn't be able to survive without these forums
James
View Replies !
View Related
Calling A Text File Into Dynamic Text Field
I'm relatively new to Flash so please forgive any obvious questions! I've searched for ages and come up with lots of results about loading XML into Flash, but my problem is more basic than that.
I'm creating a site where each page is pretty much text. I want to achieve this by loading text files into dynamic text fields, since it's easier for me to maintain text files that regenerate movie clips etc.
I have figured out how to load a text file into a dynamic text field and how to use the 'read as HTML' option to invoke HTML formatting - but I've hit the (apparently common, judging from Google) problem about whitespace. As soon as I have a carriage return in the text file, all subsequent text is ignored.
I'm detailing what I've done below and would really appreciate any help
1. Create flash document
2. Add a dynamic text field
3. Set the instance name of this text field to be 'Text1'
4. Set the 'var' for this text field to be 'Text1'
5. Created a text file in Notepad named 1.txt and saved in same location as the .fla
5. In frame 1 (which also happens to be where the text field is placed) I have the following code:
Code:
loadVariables("1.txt", this);
I THINK I need to add some code somewhere about whitespace but I'm not sure what it is or where it should go...
Most of the above has been achieved through trial and error, copying things I've found online - not through any detailed understanding of what I'm doing so it is quite likely I've been stupid somewhere along the line!
Many thanks
View Replies !
View Related
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!
View Replies !
View Related
Single Line Text Field Scrolling Bug...
Whatever I do... It seems like this problem just won't go away. A few of my single line text fields scroll downward when there is text in them, and you click and pull the mouse downward.
It's causing problems for my users.
And, it's only random text fields that do it...
Type in some text, and then pull downward, some of the fields scroll down, some don't. I just re-created every single one... Didn't help!
http://www.designermichael.com/fbApp...eds/cpanel.php
*Note, this fla was converted from a previous version.
View Replies !
View Related
Content Of A Single Line In A Text Field
I am loading a hundred string values from a text field (each with a <br> after them) into a multiple line Dynamic text field set to display html. When a user clicks on any one of the lines, I want the content of that line only to be set into a variable for further processing.
any ideas on how to do this simply assuming that the loaded in data will be changing quite often?
thanks
View Replies !
View Related
Single Line Text Field Scrolling
I've got some single line text fields that are limited in size. When the cursor reaches the limit of the text field the cusor continues and the text scrolls off the left side and dissappears.
How can I stop this happening? I've thought about limiting the number of characters but these text fields sizes change dynamically according to how much space they need to fill. Is there a simple way around this problem?
Thanks
View Replies !
View Related
Dynamic Text Field Variable Loading
Okay, so this is driving me up the wall.
I have dynamically-generated instance names and variables, and I need to be able to fill dynamic text files with the content of those variables.
So, what I have right now is very simple:
_root["variable" + _name]
This traces fine, it parses the variable (variable4, for instance) and returns what I want it to return. But THE TEXT FIELD WILL NOT READ IT. Every variation I've tried on it, the text field still returns blank. The text field is running on the same level as the trace I did, not that this should matter anyway.
Oh please help me...
View Replies !
View Related
Loading A .swf With A Dynamic Scrolling Text Field
I have been fighting with this thing for the last two weeks, and I am getting no where. I really want to get my site finished before I leave for Japan next Wednesday, so I am in a bit of a hurry, and would appreciate any help you guys could give.
I have a movie that loads a .swf that loads a .txt document. The problem is, no matter what I do, I cannot get the bloody thing to scroll....
View Replies !
View Related
|