Jump to content

Load Url's In Flash Via Xml


tomtukin

Recommended Posts

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. 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

Link to comment
Share on other sites

Does your XML document use CDATA parsing? I'd make sure that is in place before changing too much of your underlying application if it otherwise seems to work fine.

Link to comment
Share on other sites

I must admit that I don't know anything about that. basically i work with graphics and XML, AS etc ar enot my strong side. The reason why I wanted to use XML in this project is so my client could update the text on their site themselves. In that way I wouldn't need to use my time on updating and they would have the news out any time they want.I used this AS file that I wound on the internet together with it was XML. It all works well, with a scrollbar and everyrthing but i just need thio be albe to link some of the words to URL's

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...