homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Gold Sponsor 2015!
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

Loading XML in FLash with URL's

5+ Year Member

Msg#: 3910897 posted 10:13 am on May 11, 2009 (gmt 0)

Hello all.

I am a step away from finishing the website, but that last step I just cannot figure out.
I have Flash file to which XML file is loaded. This displays text and it works perfectly.
Problem is that in some of the words form XML i would like to inser links to URL's which should be open in a new window. I can't figure this out.
Could you please heltp me. Bellow you can see both AS and XML.


<loadtext><headLine>FLASHSCROLLBARMAID</headLine><br><mainBody>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy

Action Script:

_root.scrollbar_mc.scroller_mc.onPress = function()
startDrag(_root.scrollbar_mc.scroller_mc,false,0,0,0,_root.scrollbar_mc._height-_root.scrollbar_mc.scrol ler_mc._height);
_root.scrollbar_mc.onEnterFrame = function()
con = Math.ceil(100 * ((_root.scrollbar_mc.scroller_mc._y)/(_root.scrollbar_mc._height-_root.scrollbar_mc.scroller_mc._height)));
_root.tTe xt.scroll = (con/100) * _root.tText.maxscroll;
_root.scrollbar_mc.scroller_mc.onRelease = function()
_root.scrollbar_mc.scroller_mc.onReleaseOutside = function()

tText.html = true;
tText.wordWrap = true;
tText.multiline = true;
tText._alpha = 100;
tText.border = false;
tText.backgroundColor = 0xDCDBD9;
// makes it scrollable

loadtextStyleCast = new TextField.StyleSheet();
// create a new instance of a Class StyleSheet

// loads your CSS document with defined tags

tText.styleSheet = loadtextStyleCast;
// applies your new XML styles to myText

// sets the background color
// (Text color is set in the CSS.)

loadtextContentCast = new XML();
// create a new instance of an XML Class

loadtextContentCast.ignoreWhite = true;
// identifies the file to be loaded

loadtextContentCast.onLoad = function(success)
tText.text = loadtextContentCast;
// loads the file into the TextArea


Thnax in advance



WebmasterWorld Administrator httpwebwitch us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3910897 posted 4:11 am on May 12, 2009 (gmt 0)

Hi tomtukin, Welcome to WebmasterWorld!
I haven't used Flash in a while, but I recall that if you put HTML into a text area, it'll render the HTML with working clickable links. I may be wrong ;)

anyways, I'd suggest you format your XML with the HTML wrapped as a CDATA node, so it's treated as a string, not a nodeset. For example:

<![CDATA[Lorem <a href='ipsum.html'>ipsum</a> dolor sit amet]]>

See if that works... cheers

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved