aahhh I see.
I dont know how to do this in XML. I always create my flash files in 1 fla file.
I find it easier for me to do.
Printable View
aahhh I see.
I dont know how to do this in XML. I always create my flash files in 1 fla file.
I find it easier for me to do.
Oh, my God.... I will never find a solution...
Maybe it's possible to create a fla and remote the xml file ??
providence0630 : I found the code. in the fla, MENU and Menu_mc... the first frame is for to load XML and the second for to put many xml in the frame one with (i++).... I think we can put some code here, no ?
first code (frame 1 ) :
//Load XML Data
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
categoryName = [];
subNum = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
categoryName[i] = xmlNode.childNodes[i].attributes.Name;
subNum[i] = xmlNode.childNodes[i].childNodes.length;
}
gotoAndStop(2);
} else {
trace("Error loading XML");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("menu.xml");
stop();
and code 2 (frame two) :
//Get button height
bttnHeight = this.lev1_mc.lev1_bttn._height
//Build first level buttons
for (i=0; i<total+1; ++i) {
this.lev1_mc.lev1_bttn.duplicateMovieClip("lev1_bt tn"+i, i);
this.lev1_mc["lev1_bttn"+i]._y = bttnHeight*i;
this.lev1_mc["lev1_bttn"+i].originY = this.lev1_mc["lev1_bttn"+i]._y;
this.lev1_mc["lev1_bttn"+i].destY = this.lev1_mc["lev1_bttn"+i]._y;
this.lev1_mc["lev1_bttn"+i].ID = i;
this.lev1_mc["lev1_bttn"+i].bttnName = categoryName[i];
this.lev1_mc["lev1_bttn"+i].subNum = subNum[i];
if (i == total) {
this.lev1_mc["lev1_bttn"+i]._visible = false;
}
//Apply Accordion Script to each button
this.lev1_mc["lev1_bttn"+i].onEnterFrame = function() {
menuScript(this);
};
//Build second level buttons
for (j=0; j<subNum[i]; ++j) {
this.lev1_mc["lev1_bttn"+i].lev2_mc.lev2_bttn.duplicateMovieClip("lev2_bttn"+ j, j);
this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j]._y = bttnHeight+bttnHeight*j;
this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].bttnName = xmlNode.childNodes[i].childNodes[j].attributes.Name;
this.lev1_mc["lev1_bttn"+i].lev2_mc["lev2_bttn"+j].link = xmlNode.childNodes[i].childNodes[j].attributes.Link
}
}
//Set tween amount here
tween = 3
//Accordion Script function
function menuScript(object) {
object._y += (object.destY-object._y)/tween
if (selectedID>=object.ID) {
object.lev2_mc._visible = true;
object.mask_mc._height = this.lev1_mc["lev1_bttn"+(object.ID+1)]._y-object.originY;
} else {
object.lev2_mc._visible = false;
}
if (clicked == object._name) {
object.lev2_mc._visible = true;
object.icon_mc.gotoAndStop(2);
object.destY = object.originY;
} else {
object.icon_mc.gotoAndStop(1);
if (this.lev1_mc[clicked]._y<object._y) {
object.destY = object.originY+moveTo-bttnHeight-1;
} else {
object.destY = object.originY;
}
}
}
// Function for linking (target URL or movieclip frame label)
_global.linkAction = function(object) {
_global.LINK = object.link;
one();
}
// Function for button selection
function clickAction(object) {
selectedID = object.ID;
moveTo = object._height;
if (clicked == object._name) {
clicked = "";
} else {
clicked = object._name;
}
}
stop();
Hope you can help me now.
Regards,
Jack.
try adding _root.point._visible = false;
it should look like
PHP Code:function clickAction(object) {
selectedID = object.ID;
moveTo = object._height;
if (clicked == object._name) {
_root.point._visible = false;
clicked = "";
} else {
clicked = object._name;
}
}
Thanks a lot for your reply providence0630, but where must I add these lines... ? At the end of the Database.as, on the first code or the second. Sorry for that question....
at the one you posted
inside menu in menu_mc
replace
with this onePHP Code:// Function for button selection
function clickAction(object) {
selectedID = object.ID;
moveTo = object._height;
if (clicked == object._name) {
clicked = "";
} else {
clicked = object._name;
}
}
stop();
this will hide point button when you click chaussuresPHP Code:function clickAction(object) {
selectedID = object.ID;
moveTo = object._height;
if (clicked == object._name) {
_root.point._visible = false;
clicked = "";
} else {
clicked = object._name;
}
}
stop();
which is what you wanted?
Not, this is not yet that. I want to click in shoes and to have the " numericStepper" and " point" (in shoes). And to hide " numericStepper" and " point" when I click on the other headings: Bags, clothing, various .....
I found !!!!
Here is what I changed in the code :
// Function for button selection
function clickAction(object) {
selectedID = object.ID;
moveTo = object._height;
if (clicked == object._name) {
_root.point._visible = true;
_root.pointure_ns._visible = true
clicked = "";
} else {
clicked = object._name;
}
}
stop();
So you got it working?
Yes for that, all is well, but I haven't thought how to remote the "L" "S" "M" "XL" buttons in "Chaussures".... and I cannot.
Well, a great thank to Providence0630 and Taidaishar.... I have not found all I wished to do, because I don't know enough Action Script, but you tried to help me and I thank you really much. Solution is with " _root.file._visible true or false; " in the frame two of the "Menu_mc" file. I will work again for to find the solution.
Best Regards to you.
Jack.