Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : Loading Text Files with Hyperlinks into Dynamic Text Field


ChuckRWD
11/24/2006 5:05:44 PM
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="http://www.mapquest.com" target="_blank">Click Here for Driving
Directions</a></html><br />

Thanks for the help,
Chuck

Novian
11/24/2006 6:33:56 PM
Hey Chuck,

dalewb
11/24/2006 6:38:06 PM
not that I am even remotely good at AS by any means, but I've watched my share
of tutorials. In your external txt file, isn't everything in it supposed to be
preceeded by "info=" and no space between the "=" and the body of the text?
ChuckRWD
11/26/2006 12:41:45 AM
I've tried using Text Format, and it did nothing, the space before and after
the "=" sign doesn't matter in this instance, it is a matter of preference, and
embedding font has nothing to do with getting the <a href=""></a> tags to
display in the dynamic text fields.

I appreciate the suggestions, but I still am i desperate need of an answer.
WHY IS THIS NOT WORKING? Please respond! I am in a bit of a jam here.
AddThis Social Bookmark Button