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....![]()