Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding a URL button from XML file

Explorer ,
Apr 25, 2008 Apr 25, 2008
I'm making a photo slideshow that pulls info from an XML doc--including a URL. What is the code to add a link on a Flash button from an XML document?

Here's my XML code for each photo: <url> http://www.yahoo.com</url>

My Flash doc pulls all xml url's in an array like this:

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
url = [];
delay = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
description = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
url = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
delay = xmlNode.childNodes.childNodes[3].firstChild.nodeValue;
}
TOPICS
ActionScript
648
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2008 Apr 25, 2008
what's the problem?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 25, 2008 Apr 25, 2008
The problem is that my button (url_btn), when pressed, doesn't go to the url indicated in the xml doc.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 25, 2008 Apr 25, 2008
Set the button function in your loop where you're assigning xml values to arrays.

Cheers,
FlashTastic
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 25, 2008 Apr 25, 2008
Thank you! :)

Do you happen to know how to open the link into a new browser window using the dynamic link? Putting "url" for the url returns a browser error "url not found on server".
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2008 Apr 25, 2008
LATEST
use trace(url+" "+url.length) to see what you're doing.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines