Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 11-05-2006, 10:48   #1 (permalink)
Optimist
 
Registriert seit: Mar 2003
Beiträge: 226
Dynamisches Menue funktioniert nicht richtig

Hallo,

nachdem mir gestern hier bei meinem Problem leider niemand helfen konnte habt ihr evtl. zu Folgendem eine Idee für mich. Ich habe ein Pulldownmenue das nach unten aufklappt. Wenn ich mit der Maus allerdings den oberen Hauptmenuepunkt verlasse, dann klappen die Untermenues zwar auf, verschwinden aber wieder direkt sobald ich mit der Maus vom Hauptmenuepunkt nach unten wegziehe. Außerdem möchte ich gerne den einzelnen Untermenuepunkten eine Zuweisung geben, dass wenn ich darauf klicke, jeweils eine andere swf geladen wird. Die fla dazu habe ich im Anhang.

Vorab schon mal Danke für die Hilfe
Angehängte Dateien
Dateityp: zip Hauptmenue.zip (6,8 KB, 8x aufgerufen)
Michael Trost ist offline   Mit Zitat antworten
Alt 11-05-2006, 10:52   #2 (permalink)
man lernt immer dazu
 
Benutzerbild von dabinjo
 
Registriert seit: Dec 2003
Ort: Freiburg
Beiträge: 442
also bei mir funzt deine datei irgendwie nicht...
dabinjo ist offline   Mit Zitat antworten
Alt 11-05-2006, 10:58   #3 (permalink)
Optimist
 
Registriert seit: Mar 2003
Beiträge: 226
Das liegt wahrscheinlich daran, dass ich die xml Datei bei mir auf einem Unterverzeichnis liegen habe und deswegen in der fla in der letzten Zeile das Unterverzeichnis "Texte" angegeben habe. Lösche "Texte" in der fla raus, dann sollte es funktionieren.
Michael Trost ist offline   Mit Zitat antworten
Alt 12-05-2006, 06:42   #4 (permalink)
Optimist
 
Registriert seit: Mar 2003
Beiträge: 226
Guten Morgen,

hat wirklich keiner eine Idee dazu ?

Hier mal das Script:

startx = -184;
starty = 90;
font1 = new TextFormat();
font1.size = 11;
font1.color = 0xFFFFFF;
font1.font = "ARIAL";
font1.bold = true;
font2 = new TextFormat();
font2.size = 11;
font2.color = 0xFFFFFF;
font2.font = "ARIAL";
font2.bold = true;
menue = [a];
count = 0;
verzoegerung = 25;
abstand = 2;//<---------abstand zwischen den buttons
//
// hauptmenue
make_menue = function () {
var anz = menue.length;
for (var i = 1; i<=anz; i++) {
var mc = _root.attachMovie('mc2', 'm'+i, i+1000);
mc.createTextField('txt', 1, 0, 0, 100, 20);// <--------textfeldparameter einstellen
mc.txt.selectable = 0;
mc._y = starty;
mc._x = startx+i*(mc._width+abstand);
mc.txt.text = " "+menue[i-1];
mc.txt.setTextFormat(font2);// <--------textformat auswählen
mc._name = menue[i-1]+"1";
mc.id = menue[i-1];
mc.onRollOver = function() {
this.licht.play();
for (var c = 0; c<_root.menue.length; c++) {
_root[menue[c]+"1"]._y = starty;
}
if (_root[this.id] != undefined) {
this._y == starty ? this._y += 0 : 0;
this.submenue(_root[this.id].length, this._y);
} else {
this.onPress = function() {
_root.ausgabe.text = this._name;//<---buttonaktionen einfügen
};
this.onRelease = function() {
//
// //<--------------------------------buttonaktionen einfügen
//
};
}
};
mc.onRollOut = function() {
this.licht.gotoAndStop(1);
if (_root[this.id] != undefined) {
if (_root._ymouse<this._y+this._width) {
this._y -= 0;
_root.holder.removeMovieClip();
}
}
};
}
};
//######################################
// untermenues
//
// erstellen
MovieClip.prototype.submenue = function(subzahl, starty) {
_root.createEmptyMovieClip('holder', 50);
for (var i = 1; i<=subzahl; i++) {
var mc1 = _root.holder.attachMovie('mc2', 'm'+i, i+1100);
mc1.createTextField('txt', 1, 0, 0, 100, 20);
mc1.txt.selectable = 0;
mc1._x = this._x+(i-1)* mc._width;
mc1._y = starty+(i-0)* (this._heigh+20);
mc1.txt.text = " "+_root[this.id][i-1];
mc1.txt.setTextFormat(font2);
mc1._name = _root[this.id][i-1];
mc1.onPress = function() {
_root.ausgabe.text = this._name;//<----buttonaktionen einfügen
};
mc1.onRelease=function(){
//
////<--------------------------------------buttonaktionen einfügen
//
};
mc1.onRollOut = function() {
//this.licht.gotoAndStop(1);
count = 0;
yy = 10;
this.onEnterFrame = function() {
if (yy>verzoegerung && count == 0) {
delete this.onEnterFrame;
for (var c = 0; c<_root.menue.length; c++) {
_root[menue[c]+"1"]._y = starty;
}
_root.holder.removeMovieClip();
}
yy++;
};
};
}
};
//
//######################################
// xml auslesen
//
jxml = new XML();
jxml.ignoreWhite = true;
jxml.onLoad = function(ok) {
if (ok) {
// submenuepunkte
//
var j = this.firstChild.childNodes[1].childNodes.length;
for (var z = 0; z<j; z++) {
// submenue-arrays erstellen
_root[this.firstChild.childNodes[1].childNodes[z].nodeName] = [];
//
// submenue-arrays füllen
var a = Number(this.firstChild.childNodes[1].childNodes[z].attributes.sub);
for (var k = 0; k<a; k++) {
_root[this.firstChild.childNodes[1].childNodes[z].nodeName].push(this.firstChild.childNodes[1].childNodes[z].attributes['sub'+(k+1)]);
//trace(this.firstChild.childNodes[1].childNodes[z].attributes['sub'+(k+1)]);
}
}
// hauptmenuepunkte
//
for (var i = 0; i<this.firstChild.firstChild.childNodes.length; i++) {
menue.push(this.firstChild.firstChild.childNodes[i].attributes.name);
}
}
make_menue();
};
jxml.load('Texte/Menue.xml');
Michael Trost ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 05:52 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele