I not a developer, so I bought a menu, which I saw in flashden.
a menu xml accordion.
http://flashden.net/files/21673/index.html
My problem is the following, the menu opens all, I just would like to open certain category.
In that way:
in my URL I have a param &IDCategoria=2660&, I can take this param, but my whole menu opens, all categories, not just this particular category.
Can anyone help me?
AS.
stop();
// subitems
var xmlItems = xmlRoot.childNodes
// total subitems
var total = xmlItems.length
// todos items
var itemList = []
//----------------------------------------------
//catch the url param
import flash.external.*;
import QueryString.as;
var myPath:QueryString = new QueryString();
assignVariables();
//------------------------------------------------
function assignVariables() {
if (myPath.parameters.Y) {
idCategoria_txt.text = unescape("IDCategoria="+myPath.parameters.IDCategoria);
for (i=0; i<total; i++){
// Attaching menu
box.attachMovie("item", "item" + i, i)
itemList* = box["item"+i]
itemList*.xmlRoot = xmlItems*
itemList*.separation = separation
itemList*.tabulation = tabulation
itemList*.subItemAutoClose = subItemAutoClose
itemList*.itemHeight = itemHeight
itemList*.itemWidth = itemWidth
itemList*.light = light
//itemList*.buttonColor = buttonColor
//itemList*.rollOverColor = rollOverColor
itemList*.arrowColor = arrowColor
itemList*.rollOverArrowColor = rollOverArrowColor
itemList*.TextColor = TextColor
itemList*.rollOverText = rollOverText
itemList*.openEase = openEase
itemList*.closeEase = closeEase
itemList*.rollOutFade = rollOutFade
itemList*.openAll = openAll
itemList*.openID = openID
}
//botões menu
button.onRelease = function(){
if (link){
getURL(xmlRoot.attributes.url+"&Y="+myPath.parameters.Y, "_self")
}
}
button.onReleaseOutside = function(){
if (link){
getURL(xmlRoot.attributes.url+"&Y="+myPath.parameters.Y, "_self")
}
}
button.onRollOver=function(){
if (!openBox){
over = true
}
}
button.onRollOut=function(){
if (!openBox){
over = false
}
}
//cores
color.setRGB(buttonColor)
color = new Color (button.over)
color = new Color (Arrow.color)
color.setRGB(arrowColor)
color = new Color (Arrow.over)
color.setRGB(rollOverArrowColor)
// nome do item CAT
cat.text = xmlRoot.attributes.cat
id_txt.text = xmlRoot.attributes.id
levels_txt.text = xmlRoot.attributes.level
// máscara
box.setMask(mask)
// sem submenu
if (total<1){
link = true
Arrow._visible=false
}
if (!light){
button.light._visible=false
}
mask._height = 0
button._x = button._y = 0
mask.onEnterFrame=function(){
cursor._x=_xmouse
cursor._y=_ymouse
button._height = itemHeight
button._width = itemWidth
box._y = mask._y = button._height + separation
mask._width = button._width*tabulation/5
if (openBox || myPath.parameters.IDCategoria){
mask._height += (targetSize - mask._height)/openEase
Arrow._rotation += (-90 - Arrow._rotation)/openEase
box._x = mask._x += (tabulation - mask._x)/openEase
teste_txt.text = "Categoria aberta";
teste_txt.textColor = 0xFF0099;
}
else {
mask._height += (0 - mask._height)/closeEase
Arrow._rotation += (0 - Arrow._rotation)/closeEase
box._x = mask._x += (0 - mask._x)/closeEase
}
if (over){
cat.textColor = rollOverText
if (button.over._alpha<100){
button.over._alpha +=50
}
} else {
cat.textColor = TextColor
if (button.over._alpha>0){
button.over._alpha -= rollOutFade
}
}
Arrow.over._alpha = button.over._alpha
// menu
for (i=1; i<=total; i++){
// menu embaixo do outro
itemList*._y = itemList[i-1]._y + itemList[i-1].mask._height + itemList[i-1].button._height + separation
targetSize = itemList[i-1]._y + itemList[i-1].mask._height + itemList[i-1].button._height + separation
if (!openBox && !openAll){
itemList[i-1].openBox=false
itemList[i-1].over=false
}
// abrir todos
if (openAll && openBox){
itemList[i-1].openBox=true
itemList[i-1].over=false
if (!itemList[i-1].link){
itemList[i-1].over=true
}
}
}
}
onMouseDown = function (){
for (i=0; i<total; i++){
if (itemList*.button.hitTest(cursor)){
showCurrent(itemList*)
}
}
}
// botão clicado
showCurrent=function(current){
for (i=0; i<total; i++){
if (itemList*!=current){
if (subItemAutoClose){
itemList*.openBox=false
}
if (total > 0){
itemList*.over = false
}
} else {
// se tiver submenu
if (total>0){
if (itemList*.openBox){
if (!openAll){
itemList*.openBox=false
}
} else {
itemList*.openBox=true
}
}
}
}
}
// fechando a função assignVariables if Y parameter exists
}
}
If somebody wanna help, I´ll send the .fla
Sorry about my english.