Question about sliding_menu [Action Script]

Статус
В этой теме нельзя размещать новые ответы.
©

©annabis

Прохожие
помогите с Акшн Скрипт, плз !! как сделать чтобы меню на функцию mouse_on открывалось? и не надо былоб мышкой по нему лишний раз кликать?


Спасибо! :thenks:


main code:

Код:
// declare variables for the phisical movement of menues' elements
acc = 3.9
smorz = 1.22
posOflogo = -76        // logo position in menu's element

// ACTION FOR THE BUTTON
MovieClip.prototype.DoSomething = function(theClip){
    trace("nome: " + theClip._name)            // just while editing...
    trace("valore: " + theClip.mov.txt)        // as above...
    trace("link: " + theClip.link)            // ..and also for testing...

    getURL(theClip.link, "_parent");            // this applies the link to our buttons
    
    /*---------------------------------------------------------------
    |    here you can add your script for the button action...        |
    |    .....                                                        |
    | end of your custom script                                        |
    ---------------------------------------------------------------*/
}    // end of function()



// BUTTONS LABEL: label and links must be == (label name:page url)
// buttons declarations
nomi = new Array("HOME: index.php","PRICE LIST: index.php?show_price=yes","DELIVERY: index.php?aux_page=aux2","ABOUT US: index.php?aux_page=aux1");

// this array contains your custom logo placed in your library
// and get thier linkage name
loghi = new Array("cubo","triangolo","sfera","ottagono");


max = nomi.length - 1; // this is the number of btns;

// Menu init:
function createMenu(firstElement){
    for(i=1;i<=max;i++){
        duplicateMovieClip(firstElement,"menu"+i,i)
        myMenu = _root["menu"+i]
        textLabel = nomi[i].split(':')[0]    // labels
        linkLabel = nomi[i].split(':')[1]    // links
        myMenu.mov.txt = textLabel            // adding label
        myMenu.link = linkLabel                // link for the button here
        myMenu.acc = acc
        myMenu.smorz = smorz
        myMenu.attachMovie(loghi[i],"logo" + i,(5000+i))
        myLogo = myMenu["logo" + i]
        myLogo._x = posOflogo
        newColor = new getColor(myMenu);
    }
    // adding variables to the first element...
    firstElement.attachMovie("cubo","cubo",(7000+1))
    firstElement.cubo._x = -76
    firstElement.mov.txt = nomi[0].split(':')[0]
    firstElement.link = nomi[0].split(':')[1]
    firstElement.acc = acc
    firstElement.smorz = smorz
}

// different colors to each element of ours menu
function getColor(what){
    inizio += (255/nomi.length)/3
    colore = new Color(eval(what))
    alex = new Object();
    alex = colore.getTransform();
    alex.rb += inizio
    alex.gb += inizio
    alex.bb += inizio
    colore.setTransform(alex)
}

createMenu(_root.menu0);    // create that menu man!

buttons code:

Код:
onClipEvent(load){
    x_fin = -97
}
onClipEvent(enterFrame){
    x = mov._x
    dx = (dx+(x_fin-x)/acc)/smorz
    x += dx
    mov._x = x
    name = _name.substring(4,6) - 1;
    if(name >=0){
        _x = _root["menu" + name].mov._x + _root["menu" + name]._x + 164
    } else {
        _x = 100
    }
}
 
onClipEvent (rollOver) - мыш появился над клипом
onClipEvent (rollOut) - мыш больше не над клипом
onClipEvent (mouseMove) - мыш производит движение над клипом
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху