View Full Version : URL inside XML
biztaty
October 27th, 2008, 04:06 PM
hi,
how could I store link url inside the xml and use this url inside flash with actionscript 3 ?
bonh
October 27th, 2008, 04:16 PM
Unless there was a change from AS 2.0 to AS 3.0 for that, I am 99% sure you can put a URL in an XML file and import it into flash as a variable and use it to create a link.
Felixz
October 27th, 2008, 04:28 PM
You can use <![CDATA[ link ]]>
biztaty
October 27th, 2008, 04:29 PM
thank you for the quick reply, im sorry but could you give me a little hint on the process
Felixz
October 27th, 2008, 04:36 PM
<node><![CDATA[http://www.kirupa.com/forum/showthread.php?p=2401436]]></node>
biztaty
October 27th, 2008, 04:48 PM
thank you very much, i will try that shortly, i will let you know, thanks
biztaty
October 27th, 2008, 05:03 PM
nice, thanks guys, specially Pfelixz,
ok i can bring the url from the xml into flash cs3 but how do i assign that url to any movie clip in the stage?
gtg236s
October 28th, 2008, 03:56 PM
movieclip.addEventListener(MouseEvent.CLICK, onMovieClipClick);
function onMovieClipClick(event:MouseEvent):void{
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank'); // second argument is target
} catch (e:Error) {
trace("Error occurred!");
}
}
Assuming you want the person to click on the movie clip to be taken to the link
biztaty
October 28th, 2008, 04:39 PM
nice :) thanks gtg236s
Thanks guy, will try this out shortly
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.