mi fai sapere cosa succede con questo codice??
ciao
Codice PHP:
Stage.scaleMode = "noScale";
Stage.align = "TL";
//global variables
xml_path = "";
images_path = "";
level = 1;
sections = new Array();
//load XML
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load(xml_path+"menu.xml");
my_xml.onLoad = function() {
sections = my_xml.firstChild.childNodes;
ypos = 0;
xpos = 0;
_root.createEmptyMovieClip("MyMenu", level++);
MyMenu._x = 0;
MyMenu._y = 0;
for (var i = 0; i<sections.length; i++) {
n = "bu"+i;
_root.MyMenu.attachMovie("Button", n, level++);
with (_root.MyMenu[n]) {
_y = ypos;
_x = xpos;
xpos += 110;
}
_root.MyMenu[n].loadDescr(sections[i].attributes.descr);
_root.MyMenu[n].loadCaption(sections[i].attributes.caption);
_root.MyMenu[n].hitFunction = sections[i].attributes.hitFunction;
_root.MyMenu[n].image=sections[i].attributes.image
MyMenu[n].onRelease=function(){
trace(this.image)}
}
// initMyMenuImages ();
};
function unhitAll() {
for (var i = 0; i<sections.length; i++) {
n = "bu"+i;
_root.MyMenu[n]._state = 0;
}
}
function initMyMenuImages() {
_root.createEmptyMovieClip("MyMenuImages", level++);
MyMenuImages._y = _root.ScreenHeight-100;
for (var i = 0; i<sections.length; i++) {
n = "img"+i;
MyMenuImages.createEmptyMovieClip(n, i);
with (MyMenuImages[n]) {
_x = i*_root.ScreenWidth;
loadMovie(images_path+sections[i].attributes.image);
}
}
}
_root.onEnterFrame = function() {
};
function setMyMenuImages() {
pos = _root.MyMenuImages._x;
if (pos%width != 0) {
pos -= pos%_root.ScreenWidth;
}
for (var i = 0; i<sections.length; i++) {
bu = "bu"+i;
if (_root.MyMenu[bu]._state == 2) {
pos = -(i*_root.ScreenWidth);
}
}
for (var i = 0; i<sections.length; i++) {
bu = "bu"+i;
if (_root.MyMenu[bu]._state == 1) {
pos = -(i*_root.ScreenWidth);
}
}
_root.MyMenuImages._x += (pos-_root.MyMenuImages._x)/4;
}
//functions called when user clicks buttons
hitThink = function () {
trace("hit Think");
// your action code for "Think" goes here
};
hitArt = function () {
trace("hit ArtWork");
};
hitFlash = function () {
trace("hit Flash");
};
hitMusic = function () {
trace("hit Music");
};
hitResume = function () {
trace("hit Resume");
};
hitGuests = function () {
trace("hit Guests");
};