You can indeed add button paths via XML to already created buttons. I'm assuming you're pointing to external sources (i.e. not linking within the flash itself).
Create an XML like so:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<navigation>
<button link="http://www.dynamicdrive.com" />
<button link="http://www.dynamicdrive.com" />
<button link="http://www.dynamicdrive.com" />
<button link="http://www.dynamicdrive.com" />
</navigation>
Add this AS to your Flash navigation:
Code:
var xml:XML = new XML()
xml.ignorewhite = true;
xml.onLoad = function (success) {
if (success) {
parent = this.firstChild
loadPaths();
}
}
xml.load("filename.xml")
function loadPaths();
for (i=0;i<parent.length;i++) {
var btnClip = eval ("btn" + i)
var btnPath = parent.childNodes[i].attributes.link
btnClip.onRelease = function() {
getURL(btnPath)
}
}
}
For this to work, all your buttons should be named "btn#" starting with "btn0"
Warning: this was typed directly into the browser so there might be typos.
Bookmarks