Hi,
I’m an art director trying to find my way through actionscript, so forgive me if this is an obvious question.
I have an mc calling in data from XML, but I would like to have the whole thing move across the screen like in a slide show. And then I would like to add buttons that for each image allowing me to click and go to that image.
This is the code I have:
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
function loadXML(success:Boolean):Void
{
if (success)
{
var xmlPath:Array = xmlData.firstChild.childNodes;
var xmlLength:Number = xmlData.firstChild.childNodes.length;
for (var i:Number = 0; i < xmlLength; i++)
{
var myMc:MovieClip = _root.attachMovie("holder_mc", "holder_mc" + i, i, {_x: (i * 126)});
myMc.id = i;
myMc.img_mc.loadMovie(xmlPath*.attributes.img);
myMc.onRollOver = function():Void
{
trace(xmlPath[this.id].attributes.url);
}
myMc.onRelease = function():Void
{
getURL(xmlPath[this.id].attributes.url);
}
}
}
else
{
trace("XML COULD NOT BE LOADED");
}
}
xmlData.load(“data.xml”);
Thanks