Forum Moderators: open
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.
XML:
XML:
<loadtext><headLine>FLASHSCROLLBARMAID</headLine><br><mainBody>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy
</mainBody></loadtext>
Action Script:
//SCROLLER
_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()
{
stopDrag();
}
_root.scrollbar_mc.scroller_mc.onReleaseOutside = function()
{
stopDrag();
}
//TEXT LOAD
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
loadtextStyleCast.load(„flashscrollbarmaid.css”);
// loads your CSS document with defined tags
tText.styleSheet = loadtextStyleCast;
// applies your new XML styles to myText
//myText.setStyle(„backgroundColor”,„fxfffff”);
// 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;
loadtextContentCast.load(„flashscrollbarmaid.xml”);
// identifies the file to be loaded
loadtextContentCast.onLoad = function(success)
{
if(success)
{
tText.text = loadtextContentCast;
// loads the file into the TextArea
}
}
-------
Thnax in advance
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:
<loadtext><headLine>FLASHSCROLLBARMAID</headLine><br><mainBody>
<![CDATA[Lorem <a href='ipsum.html'>ipsum</a> dolor sit amet]]>
</mainBody></loadtext>
See if that works... cheers