Visualizzazione dei risultati da 1 a 2 su 2

Discussione: menu e codice

  1. #1
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289

    menu e codice

    ciao ciao...
    molto semplicemente ho un menu' con 4pulsanti che mi lavora in maniera elastica ogni volta che sono su uno di questi..cioe' allargandosi e mostrandomi la relativa voce del menu' che compare in automatico facendo scrollare delle lettere a caso per poi farmi vedere il testo giusto....e chiaramente quando tutto questo succede..i restanti bottoni si spostano con lui in un movimento elastico come gia' detto!!!
    questo per farvi capire il funzionamento..quello che vorrei io e' potere richiamare le pagine (al click)..che sono dei clip con istanza...ma qui sorge il problema...date un' occhiata al codice e ditemi come posso fare...perche' ne ho provate un po' ma zero....

    codice su frame vuoto in livello1 in stage:

    function randomChar(campo, testo) {
    clearInterval(id);
    out = [];
    h = 0;
    txtTemp = testo.split('');
    txtTemp.push('-', '_', '/', '@', '?', '|', '^', '$', '€');
    function genera() {
    k = txtTemp[random(txtTemp.length)];
    for (j=0; j<txtTemp.length; j++) {
    if (k == txtTemp[j]) {
    txtTemp.splice(j, 1);
    }
    }
    return k;
    }
    oldText = campo.text;
    function creaTesto() {
    str = testo.split('');
    char = genera();
    if (char == str[h]) {
    out[h] = char;
    h++;
    txtTemp = testo.split('');
    txtTemp.push('-', '_', '/', '@', '#', '?', '|', '^', '$', '€');
    } else {
    campo.text = oldText+' : '+out.join('')+char;
    }
    }
    id = setInterval(function () {
    creaTesto();
    if (out.join('') == testo) {
    campo.text = oldText+' : '+testo;
    clearInterval(id);
    }
    updateAfterEvent();
    }, 0);
    }


    codice su frame vuoto in livello 2 in stage:

    /* EagleEyed :: 2004 */
    Stage.scaleMode = "noScale";
    // modificare questo array per cambiare il numero e i nomi dei pulsanti
    labels = ['HOME', 'PRODOTTI', 'CONTATTI', 'LINKS'];
    // posizione
    x = 104;
    y = 30.9
    ;
    // distanza tra ogni mc
    dist = 7;
    // larghezza al rollOver e velocità di apertura
    openWid = 100;
    speed = 12;
    MovieClip.prototype.scala = function(w, vel) {
    vel = w>this._width ? vel : -vel;
    this.onEnterFrame = function() {
    if (this._width == w) {
    delete this.onEnterFrame;
    } else {
    this._width = (Math.abs(this._width-w)>Math.abs(vel)) ? this._width+vel : w;
    }
    mc0._x = x;
    this._parent.visited._x = this._width-mcWid;
    for (i=1; i<labels.length; i++) {
    _root['mc'+i]._x = _root['mc'+(i-1)]._x+_root['mc'+(i-1)]._width+dist;
    }

    };
    };
    obj = {};
    obj.onRollOver = function() {
    this.bt.gotoAndStop('over');
    _root[temp].bt.scala(mcWid, speed);
    this.bt.scala(openWid, speed);
    path = this;
    clearInterval(id);
    _root[temp].txt.text = '0'+(Number(_root[temp]._name.substring(2))+1);
    clearInterval(pausa);
    pausa = setInterval(function () {
    randomChar(path.txt, labels[path._name.substring(2)]);
    clearInterval(pausa);
    }, 200);
    };
    obj.onRollOut = function() {
    clearInterval(pausa);
    clearInterval(id);
    this.bt.gotoAndStop('up');
    _root[temp].bt.scala(openWid, speed);
    this.bt.scala(mcWid, speed);
    pausa = setInterval(function () {
    randomChar(_root[temp].txt, labels[_root[temp]._name.substring(2)]);
    clearInterval(pausa);
    }, 200);
    this.txt.text = '0'+(Number(this._name.substring(2))+1);
    };
    obj.onRelease = function() {
    _root[temp].txt.text = '0'+(Number(_root[temp]._name.substring(2))+1);
    _root[temp].bt.gotoAndStop('up');
    _root[temp].enabled = true;
    _root[temp].bt.scala(mcWid, speed);
    this.enabled = false;
    temp = this._name;
    this.visited._visible = true;
    };
    for (i=0; i<labels.length; i++) {
    attachMovie('mc', 'mc'+i, i, obj);
    mcWid = mc0.bt._width;
    this['mc'+i]._x = i*(mcWid+dist)+x;
    this['mc'+i]._y = y;
    this['mc'+i].txt.text = '0'+(i+1);
    this['mc'+i].txt.autoSize = true;
    this['mc'+i].visited._visible = false;
    }

    avete qualche idea??? :master:
    graxie mille a tutti e buone feste....
    disciple of dice.....

  2. #2
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    niente..nessuno ci capisce qualcosa?
    il codice nn l'ho scritto io..l'ho adattato...
    mi ritrovo nella m**** perche' nn mi richiama le finestre che sono clip con istanza..
    nel codice nn c'e' niente che debba richiamare le mie finestre..l'ho lasciato puro come era all'inizio...cosi' da nn confondere le idee!!!!
    e' costruito in modo tale da far aprire unaclip con istanza visited che nn e' richiamata come istanza sullo stage perche' nn e' messa sullo stage principale ma e' all' interno della clip dove ho il campo testo dinamico che serve a far vedere i testi sul bottone..quindi una volta che premo uno dei bottoni mi compare sto clip visited che nn e' nient'altro che un quadratino grigio...
    penso che il codice che richiami il clip visited lo troviamo qui:

    mc0._x = x;
    this._parent.visited._x = this._width-mcWid;
    for (i=1; i<labels.length; i++) {
    _root['mc'+i]._x = _root['mc'+(i-1)]._x+_root['mc'+(i-1)]._width+dist;
    }

    e poi chiaramente il codice dell' on release:

    obj.onRelease = function() {
    _root[temp].txt.text = '0'+(Number(_root[temp]._name.substring(2))+1);
    _root[temp].bt.gotoAndStop('up');
    _root[temp].enabled = true;
    _root[temp].bt.scala(mcWid, speed);
    this.enabled = false;
    temp = this._name;
    this.visited._visible = true;
    };
    for (i=0; i<labels.length; i++) {
    attachMovie('mc', 'mc'+i, i, obj);
    mcWid = mc0.bt._width;
    this['mc'+i]._x = i*(mcWid+dist)+x;
    this['mc'+i]._y = y;
    this['mc'+i].txt.text = '0'+(i+1);
    this['mc'+i].txt.autoSize = true;
    this['mc'+i].visited._visible = false;
    }

    quello che vorrei io e richiamare semplicemente le mie clip che sarebbero poi le mie pagine..ma per come e' costruito nn capisco come fare.....se volete vi spedisco il tutorial cosi' la cosa puo' essere piu' comprensibile....graxie ciao......
    spero in una risposta... altrimenti...
    disciple of dice.....

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.