I am working on a navigation for a page that consists of an image container, a text block, and a navigation. I have all the content in an xml file that is loaded and parsed placing each part of the site in its respectable spot. My question is I need to have the data for this site change when a button in the nav is pressed, so that the image and desc content is passed that corresponds to its button. this is in flash 8, as 2.0.
//import xml
var x:XML = new XML();
x.load("group.xml");
x.ignoreWhite = true;
//load in xml
x.onLoad = function(success) {
if (success) {
//
/*trace(x.firstChild.childNodes[0].attributes.moniker);
trace(x.firstChild.childNodes[0].attributes.image);
trace(x.firstChild.childNodes[0].attributes.desc);*/
//
var names:Array = new Array();
var picts:Array = new Array();
var desc:Array = new Array();
var ourContent:Array = x.firstChild.childNodes;
var nav:Array = new Array();
//
yPos = 40;
for (var i:Number = 0; i < ourContent.length; i++) {
//push the content
names.push(ourContent*.attributes.moniker);
picts.push(ourContent*.attributes.images);
desc.push(ourContent*.attributes.desc);
//load onto the stage
descBlock.text = desc[0];
faceContainer.loadMovie(picts[0], 0);
nav = attachMovie('navNames', 'navButton' + i, i, {_x:70, _y:yPos});
nav.menuText.text = names*;
yPos = nav._y + 20;
//
nav.onRelease = function() {
descBlock.text = desc*;
faceContainer.loadMovie(picts*, i);
};
}
} else {
trace("error loading xml");
}
};
//
import mx.transitions.Tween;
import mx.transitions.easing.*;
//
new mx.transitions.Tween(theGroup, "_x", mx.transitions.easing.Strong.easeOut, 327.5, 20, 30, false);
new mx.transitions.Tween(theGroup, "_alpha", mx.transitions.easing.Strong.easeOut, 0, 100, 30, false);
///
thanks in advance