Hello,
I have an issue. Here is the code:
[color=purple]var totalPic:Number = 15; [/color]
[color=purple]var num:Number = 1;[/color]
var cheerXML:XML = new XML();
cheerXML.ignoreWhite = true;
cheerXML.onLoad = function(success) {
var cheerArray:Array = new Array();
if (success) {
var xmlLength = this.firstChild.childNodes.length;
for (var i = 0; i<xmlLength; i++) {
var tempArray:Array = new Array();
tempArray.label = this.firstChild.childNodes*.attributes.name;
tempArray.picture = this.firstChild.childNodes*.attributes.pic;
tempArray.age = this.firstChild.childNodes*.attributes.age;
tempArray.major = this.firstChild.childNodes*.attributes.major;
tempArray.years = this.firstChild.childNodes*.attributes.years_cheering;
cheerArray* = tempArray;
}
} else {
trace("Not Success at all!");
}
profiles_lb.dataProvider = cheerArray;
[color=red]imageViewer.loadMovie(profiles_lb.selectedItem.picture+num+".jpg");[/color]
[color=red]age_txt.text = profiles_lb.selectedItem.age;[/color]
[color=red]major_txt.text = profiles_lb.selectedItem.major;[/color]
[color=red]years_txt.text = profiles_lb.selectedItem.years;[/color]
};
cheerXML.load("profiles.xml");
var comboListener:Object = new Object();
[color=darkorange]comboListener.change = function() {[/color]
[color=darkorange]imageViewer.loadMovie(profiles_lb.selectedItem.picture+num+".jpg");[/color]
[color=darkorange]age_txt.text = profiles_lb.selectedItem.age;[/color]
[color=darkorange]major_txt.text = profiles_lb.selectedItem.major;[/color]
[color=darkorange]years_txt.text = profiles_lb.selectedItem.years;[/color]
[color=darkorange]};[/color]
profiles_lb.addEventListener("change", comboListener);
[color=seagreen]back.onRelease = function() {[/color]
[color=seagreen]if (num !== 1) {[/color]
[color=seagreen]num--;[/color]
[color=seagreen]imageViewer.loadMovie(profiles_lb.selectedItem.[/color][color=seagreen]picture+num+".jpg");[/color]
[color=seagreen]}[/color]
[color=seagreen]};[/color]
[color=seagreen]next.onRelease = function() {[/color]
[color=seagreen]if (num !== totalPic) {[/color]
[color=seagreen]num++;[/color]
[color=seagreen]comboListener;[/color]
[color=seagreen]imageViewer.loadMovie(profiles_lb.selectedItem.[color=seagreen]picture+num+".jpg");[/color][/color]
[color=seagreen]}[/color]
[color=seagreen]};[/color]
The [color=darkorchid]purple[/color] area are the variables of the images.
The [color=red]red[/color] area is when I go through the XML and I get the pictures for the first time.
The [color=seagreen]green[/color] area are the back & next buttons, which work as they should at first. (If I leave my mouse over it, it should stay hover! In that way I don;t have to retire the way and then click again but click many times and therefore, change the picture in the movieClip.)
The [color=darkorange]orange[/color] is when I use the comboBox to change a label (in this case, of name).
The thing is that it does extract the other values of the XML and it works just fine but the buttons. For some reason when I click the first time, the button does change the picture but then it comes itself into the normal mode, not hover(I leave my mouse and it doesn’t respect the command of hover) I have to move the mouse away and THEN click it to change the picture.
What could be the problem?
Is there a way to make the buttons respect their behavior as they should?