[GastForen Archiv Adobe Flash & ActionScript

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste

array menu bei click verschwinden lassen

heymic
Beiträge gesamt: 5

16. Dez 2004, 17:54
Bewertung:

gelesen: 1810

Beitrag als Lesezeichen
Hallo allerseits,

Ich bin neu hier und habe schon eine Frage.
Wie kann ich ein dynamisch erzeugtes array menu verschwinden lassen oder "removen" wenn auf eines der menubuttons geklickt wird?
Wenn möglich mit Code- Beispiel, bezogen auf mein array.

Herzlichen Dank für jegliche Hilfe!

Stage.scaleMode = "noScale";
// modificare questo array per cambiare il numero e i nomi dei pulsanti
labels = ['HOME', 'ABOUT', 'PORTFOLIO', 'DOWNLOADS', 'CONTACT'];
// posizione
x = 60;
y = 25;
// distanza tra ogni mc
dist = 5;
// larghezza al rollOver e velocità di apertura
openWid = 100;
speed = 4;
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 _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 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;
}

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 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();
}, 10);
}



(Dieser Beitrag wurde von heymic am 16. Dez 2004, 17:55 geändert)
Dieser Beitrag wurde nicht geändert.