Help with slideshow using xml

Hello Guys!

Well my question i think its very simple for someone who works fine using flash and xml to show images and text… This code i downloaded for free and what it does it that, it creates buttons dynamically by the number of entries in the XML file, well thats what i understand of this script… it’s a banner rotator with a time interval using transition effects… my question is that every banner has its own button with a NUMBER LABEL on it, it is possible to add an entry in the XML file like “picture 1” and that instead of the number on the button, shows that entry from the XML… I hope you can understand me, i dont want the code to generates the number and label the button what i want is to type what ever text i want and flash show it on the button!!

Here’s the AS2 code:

import mx.transitions.easing.*;
import mx.transitions.*;

_root.imageNum = 1;//know the position of an image at a moment

//menu coordinates
var __x:Number = Stage.width-(14+8);
var __y:Number = 235;

var timer:Number = 0;
var selectMenuItem:MovieClip;
var n;//transition number


var xmlFile:XML = new XML();
xmlFile.load("images.xml");
xmlFile.ignoreWhite = true;

var nodes;
var nTransition;
var tPlay:Number = 0; //time in milliseconds for the next image to display
var circleColor;
var normalColorItem;
var hitColorItem;
var image = [];
var description = [];
var titles = [];

xmlFile.onLoad = function(success:Boolean):Void  {
    if (success) {
        nodes = this.firstChild.childNodes;
        var a1 = this.firstChild.attributes;
        nTransition = a1.transition;
        tPlay = a1.timeplay;
        circleColor = a1.circleColor;
        normalColorItem = a1.normalColorItemMenu;
        hitColorItem = a1.hitColorItemMenu;
        
        for (var i = 0; i<nodes.length; i++) {

        var attr = nodes*.attributes;
        image* = attr.img;
        
        titles*=nodes*.childNodes[0].firstChild.nodeValue;
        description* =  nodes*.childNodes[1].firstChild.nodeValue;
        }
        loadImages(nodes.length);
        createMenuNum(nodes.length);
        
    } else {
        trace("Wrong XML file");
    }
};
_root.createEmptyMovieClip("container",0);

//load the images
var largeImage;
loader._visible = false;

function loadImages(imgNum){
    for (var i=0; i<imgNum; i++){
    container.attachMovie("imgMcLarge","imgMcLarge"+i, container.getNextHighestDepth());
    largeImage = container["imgMcLarge"+i];
    largeImage["imgBoxLarge"].loadMovie(image*,1);
    largeImage.bar.desc.htmlText=description*;
    largeImage.bar.ititle.htmlText = titles*;
    largeImage._visible=false;
    
    }
        
        }

function createMenuNum(mcNum:Number):Void {
        for (var i = mcNum; i>0; i--) {
        var itemMenu:MovieClip = _root.attachMovie("menuNum", "menuNum"+i, _root.getNextHighestDepth());
        itemMenu.num.text = i;
        itemMenu.back._alpha = 0;
        var my_color:Color = new Color(itemMenu.back);
        my_color.setRGB(circleColor);
        itemMenu.num.textColor = normalColorItem;
        itemMenu._y = __y;
        itemMenu._x = __x;
        __x = itemMenu._x-(14);
        itemMenu.onRelease = pressMenuNum;
    }
    displayImage();
}

var box;
var antNum=1;

function displayImage() {
    loader._visible = true;
    loader._rotation += 5;
    
    selectMenuItem._alpha = 0;
    selectMenuItem._parent.num.textColor = normalColorItem;
    _root["menuNum"+_root.imageNum].back._alpha = 100;
    
    selectMenuItem = _root["menuNum"+_root.imageNum].back;
    selectMenuItem._parent.num.textColor = hitColorItem;
    
    box = container["imgMcLarge"+(imageNum-1)];
    
    box._alpha=100;
    box._visible=true;
    
    if(nTransition =='0'){
            n=String(random(6));
            }
            else n=nTransition;
            
    InImageEffect();
    timer = setInterval(nextImage, tPlay);

}
function nextImage():Void {
    clearInterval(timer);
    
    OutImageEffect();
    
    twOut = new Tween(box, "_alpha", Regular.easeOut, 100, 0, 1, true);
    
    twOut.onMotionChanged=function(){
            if (this.time >= 0.2){ 
                _root.imageNum = _root.imageNum>=nodes.length ? 1 : _root.imageNum+1;
                displayImage();
                delete this.onMotionChanged;
   }
            }   
    
}
function pressMenuNum():Void {
    _root.imageNum = Number(this.num.text)-1;
    nextImage();
}

function InImageEffect() {
    
 switch(n){
     case '1': inFadeEffect();
           break;
    case '2': inIrisEffect();
            break;
    case '3':inBlindsEffect();
            break;
    case '4':inWhipeEffect();
            break;
    case '5':inPhotoEffect();
            break;
    default:inFadeEffect();
            break;
         }

}

function OutImageEffect() {
    
 switch(n){
     case '1': outFadeEffect();
           break;
    case '2': outIrisEffect();
            break;
    case '3':outBlindsEffect();
            break;
    case '4':outWhipeEffect();
            break;
    case '5':outPhotoEffect();
            break;
    default:outFadeEffect();
            break;
         }

}
//transition functions

//1. Fade
function inFadeEffect(){
  TransitionManager.start(box, {type:Fade, direction:Transition.IN, duration:1, easing:Regular.easeIn});
     }
function outFadeEffect(){
 TransitionManager.start(box, {type:Fade, direction:Transition.OUT, duration:1, easing:Regular.easeOut});
     }
 
//2. Iris-SQUARE
function inIrisEffect(){
 TransitionManager.start(box, {type:Iris, direction:Transition.IN, duration:1, easing:Strong.easeOut, startPoint:5, shape:Iris.SQUARE});
     }
function outIrisEffect(){
TransitionManager.start(box, {type:Iris, direction:Transition.OUT, duration:1, easing:Strong.easeOut, startPoint:5, shape:Iris.SQUARE});
     }

//3. Blinds - vertical
function inBlindsEffect(){
TransitionManager.start(box, {type:Blinds, direction:Transition.IN, duration:2, easing:Strong.easeOut, numStrips:25, dimension:0})
     }
function outBlindsEffect(){
TransitionManager.start(box, {type:Blinds, direction:Transition.OUT, duration:2, easing:Strong.easeOut, numStrips:25, dimension:0})
     }
//4. Whipe
function inWhipeEffect(){
 TransitionManager.start(box, {type:Wipe, direction:Transition.IN, duration:2, easing:Strong.easeIn, startPoint:8});
     }
function outWhipeEffect(){
 TransitionManager.start(box, {type:Wipe, direction:Transition.OUT, duration:2, easing:Strong.easeOut, startPoint:8});
     }
//5. Photo
function inPhotoEffect(){
 TransitionManager.start (box, {type:Photo, direction:Transition.IN, duration:1, easing:None.easeNone});
 
     }
function outPhotoEffect(){
 TransitionManager.start (box, {type:Photo, direction:Transition.OUT, duration:1, easing:None.easeNone});
     }

AND HERE’S THE XML FILE:

<?xml version="1.0" encoding="iso-8859-1"?> 

<root transition="0" timeplay="4500" circleColor="0x0099FF" normalColorItemMenu="0xCCCCCC" hitColorItemMenu="0xFFFFFF"> 
    <product img="images/img1.jpg"> 
    <title><![CDATA[<font size="25pt" color="#FF0000"><b>Height Peaks</b></font>]]>    </title> 
    <content><![CDATA[<font size="12pt" color="#FFFFFF"><b>Title text format easy to configure through XML </b></font>]]></content> 
    </product> 
    <product img="images/img2.jpg"> 
    <title><![CDATA[<font size="20pt" color="#167ED3">Blue Lake</font>]]>    </title> 
    <content><![CDATA[<font size="12pt" color="#CCCCCC">Description text format easy to configure through XML. </font>]]></content> 
    </product> 
    <product img="images/img3.jpg"> 
    <title><![CDATA[<font size="20pt" color="#FF0022"><b>Autumn Leafs</b></font>]]>    </title> 
    <content><![CDATA[<font size="14pt" color="#99FF66">A variety of transition animation, test them all </font>]]></content> 
    </product> 
    <product img="images/img4.jpg"> 
    <title><![CDATA[<font size="18pt" color="#FF4400"><b>Sunset Summits</b></font>]]>    </title> 
    <content><![CDATA[<font size="12pt" color="#99FFFF">You can <font size="16pt" color="#FF0000">text link</font> to any webpage you want</font>]]></content> 
    </product> 
    <product img="images/img5.jpg"> 
    <title><![CDATA[<font size="20pt" color="#167ED3"><b>Mountain Lake</b></font>]]>    </title> 
    <content><![CDATA[<font size="14pt" color="#FFFFFF">Feel free to experiment! </font>]]></content> 
    </product> 
</root>

THANKS IN ADVANCE FOR THE HELP!!!
MY EXCUSES FOR THE BAD ENGLISH :stuck_out_tongue: