Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 15
  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    265

    Menu dinamico verticale scorrevole

    Salve a tutti,
    Avrei bisogno di un menu verticale con scroll continuo che si blocca al passaggio del mouse e che carichi le voci del menu da un txt esterno e che quindi si accorci e si allunghi in base alle voci di menu caricate esternamente.
    Avrei bisogno anche di poter assegnare esternamente anche i link dei diversi pulsanti.

    Ho cercato e ricercato in internet ma non ho trovato nulla, sapete per caso se c'e' qualche tutorial o qualche filmato gia pronto da scaricare?

    Grazie mille in anticipo a tutti
    Myriam

  2. #2
    contenuto file txt
    Codice PHP:
    &menu1=home page&url1=index.html&
    &
    menu2=chi siamo&url2=who.html&
    &
    menu3=contatti&url3=contact.html


    Codice PHP:
    this.createEmptyMovieClip("container",1)
    dati = new LoadVars()
    dati.onLoad=function(success){
         if(
    success){
            
    I=1
            
    while(this["menu"+I] != undefined){
               
    container.createTextField("opzione"+I,I,0,I*20-20,200,20)
               
    container["opzione"+I].html=true
               container
    ["opzione"+I].multiline=false
               container
    ["opzione"+I].htmlText="[url='"+this["url"+I]+"']"+this["menu"+I]+"[/url]
               I++
            }
            muovi_menu()
          }else{
              trace("
    errore caricamento file esterno")
          }
    }
    dati.load("
    file.txt")
    container.stato=false
    function muovi_menu(){
        container.onEnterFrame=function(){
              if(!this.stato){
                  this._y++
              }
              if(this.stato){
                  delete this.onEnterFrame
              }
         }
    }

    container.onRollOver=function(){
             this.stato =! this.stato
    }
    container.onRollOut=function(){
             this.stato = false
             muovi_menu()

    Non ho potuto provarlo, dovrebbe funzionare ma potrebbe esserci un conflitto sul fatto del rilancio del link

    Fammi sapere eventualmente procediamo in un altro modo

    Ciao

  3. #3
    mancava la chiusura delle virgolette

    Codice PHP:
    &menu1=home page&url1=index.html
    &
    menu2=chi siamo&url2=who.html
    &
    menu3=contatti&url3=contact.html

    Codice PHP:
    this.createEmptyMovieClip("container",1
    dati = new LoadVars() 
    dati.onLoad=function(success){ 
         if(
    success){ 
            
    I=
            
    while(this["menu"+I] != undefined){ 
               
    container.createTextField("opzione"+I,I,0,I*20-20,200,20
               
    container["opzione"+I].html=true 
               container
    ["opzione"+I].multiline=false 
               container
    ["opzione"+I].htmlText="[url='"+this["url"+I]+"']"+this["menu"+I]+"[/url]" 
               
    I++ 
            } 
            
    muovi_menu() 
          }else{ 
              
    trace("errore caricamento file esterno"
          } 

    dati.load("file.txt"
    container.stato=false 
    function muovi_menu(){ 
        
    container.onEnterFrame=function(){ 
              if(!
    this.stato){ 
                  
    this._y++ 
              } 
              if(
    this.stato){ 
                  
    delete this.onEnterFrame 
              

         } 


    container.onRollOver=function(){ 
             
    this.stato =! this.stato 

    container.onRollOut=function(){ 
             
    this.stato false 
             muovi_menu
    () 


  4. #4
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    265

    SISI

    L'ho provato e funziona (intanto ti ringrazio tantissimo!)

    Io ho questo menu:

    var menuItems:Array = new Array;
    menuItems.push("Flashden");
    menuItems.push("Join");
    menuItems.push("Tutorial");
    menuItems.push("features");
    menuItems.push("about");
    menuItems.push("support");
    menuItems.push("Collis");
    menuItems.push("Cyan");
    menuItems.push("Ryan");
    menuItems.push("Jun");

    var ease:Number = 10;

    // Ill axplain a little what the code is all about.
    // the two variables down here wil calculate the height of the scrollpanel
    // needed for the right scroll
    // Examine it and it will all be clear.

    var panelLength:Number = menuItems.length*82;
    var Multi:Number = (panelLength-220)/300;

    // The inline function down here tells the panel what position is should have
    // compared to the position of the mouse
    // It also tells it to move there with an ease to make it a little smoother

    scrollpanel.onEnterFrame = function() {
    ypos = (_ymouse*Multi*-1)+50;
    mover = (ypos-this._y)/ease;
    this._y += mover;

    // these if statements will see to it that the scroller wont leave your movie

    if (this._y > 5) {
    this._y = 5;
    }
    if (this._y < -(panelLength-295)) {
    this._y = -(panelLength-295);
    }
    };


    Ora non c'e' un modo di inserire al posto di :

    menuItems.push("Flashden");

    il contenuto del txt?
    In pratica utilizzando il txt che mi hai dato te con il testo del bottone e il relativo URL?
    Grazie mille

  5. #5
    Bhe se mi avessi detto che già avevi un codice partivamo da quello

    a te basta questo
    var menuItems:Array = new Array;
    var menuUrl:Array = new Array;

    dati = new LoadVars()
    dati.onLoad=function(success){
    if(success){
    I=1
    J=0
    while(this["menu"+I] != undefined){
    menuItems[J]=this["menu"+I]
    menuUrl[J] = this["url"+I
    I++;J++
    }
    }else{
    trace("errore caricamento file esterno")
    }
    }
    dati.load("file.txt")

    quindi avrai nell'Array menuItems i nomi delle opzioni menu ed in quello menuURL i link


    quado avrai un il caso dell' opzione.onPress dovrai fare riferimento al corretto indice dell'array URL

    Ciao

  6. #6
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    265

    Scusa

    Scusami ma l'ho trovato dopo

    Cmq dove lo devo mettere questo codice?lo devo aggiungere a quello che gia c'e' e poi funziona tutto?
    Grazie mille!

  7. #7
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    265

    noooo

    Mi da tanti errori e il menu non funziona..
    Uff sono una frana!

  8. #8
    il codice che hai postato non può essere tutto ... manca la gestione dei pulsanti del menu

    o posti il fla o tutto il codice

    Ciao

  9. #9
    Utente di HTML.it
    Registrato dal
    Jul 2004
    Messaggi
    265
    Non so come postare il fla quindi posto tutto il codice:

    al primo frame:

    Codice PHP:
    var menuItems:Array = new Array;
    menuItems.push("Flashden");
    menuItems.push("Join");
    menuItems.push("Tutorial");
    menuItems.push("features");
    menuItems.push("about");
    menuItems.push("support");
    menuItems.push("Collis");
    menuItems.push("Cyan");
    menuItems.push("Ryan");
    menuItems.push("Jun");

    var 
    ease:Number 10;

    // Ill axplain a little what the code is all about.
    // the two variables down here wil calculate the height of the scrollpanel
    // needed for the right scroll
    // Examine it and it will all be clear.

    var panelLength:Number menuItems.length*82;
    var 
    Multi:Number = (panelLength-220)/300;

    // The inline function down here tells the panel what position is should have 
    // compared to the position of the mouse
    // It also tells it to move there with an ease to make it a little smoother

    scrollpanel.onEnterFrame = function() {
        
    ypos = (_ymouse*Multi*-1)+50;
        
    mover = (ypos-this._y)/ease;
        
    this._y += mover;

    // these if statements will see to it that the scroller wont leave your movie
        
        
    if (this._y 5) {
            
    this._y 5;
        }
        if (
    this._y < -(panelLength-295)) {
            
    this._y = -(panelLength-295);
        }
    }; 
    All'interno dell'mc Scrollpanel:

    Codice PHP:
    for (var i:Number 0_root.menuItems.lengthi++) {
        
    menu attachMovie("scrollItem""scrollItem"+ithis.getNextHighestDepth());
        
    menu._y menu._y+i*82;
        
    menu.textHolder.itemText.text _root.menuItems[i]
        
    menu.item _root.menuItems[i];
        
    menu.onRollOver = function() {
            
    this.textHolder._alpha 100;
        }
        
    menu.onRollOut = function() {
            
    this.textHolder._alpha 50;
        }
        
    menu.onRelease = function() {
            
    _root.contentTitle.text this.item;
        }



    Spero sia tt,
    grazie cmq x l'attenzione spero di riuscire a farlo funzionare!

  10. #10

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.