Danke für Deine Antwort, das hier ist das erste Forum, was mir auf diese Frage antwortet... traurig aber wahr...
Tja, mein AS... Das sieht ganz schön übel aus, finde ich zumindest..
PHP-Code:
var root = null;
var menux = 10;
var menuy = 10;
var menuname = "Main Menue";
var xm = new XML();
xm.ignoreWhite = true;
xm.load("cmsx.navigation1.php");
xm.onLoad = function() {
parse(this);
}
function parse(obj) {
root = this.attachMovie("node", "root", this.getNextHighestDepth());
root.bname = menuname;
root.node = obj;
root.root = this;
root.depth = 0;
root._x = menux;
root._y = menuy;
this.onEnterFrame = function() {
root.doParse();
delete this.onEnterFrame;
}
}
function dispatch(bname) {
trace(bname);
}
Das steht in der ersten Frame in der Code Ebene
Das steht im node mc
PHP-Code:
var type = false;
var isopen = false;
var child = new Array();
var but = null;
var blocked = false;
var IV = 0;
function doParse(obj) {
this._x = this.bx;
this.but = this.attachMovie("button", "but", 1);
if (this.depth > 0) {
this._visible = true;
this.bname = this.node.attributes.name;
this.but.btext.text = this.bname;
}// else {
//this.bname = "MENÜ";
this.but.btext.text = this.bname;
//}
for (var i=0; i<this.node.childNodes.length; i++) {
child[i] = this.root.attachMovie("node", "child" + i, this.root.getNextHighestDepth());
child[i].node = this.node.childNodes[i];
child[i].parent = this;
child[i].root = this.root;
child[i].depth = this.depth + 1;
if (this.depth > 0) {
child[i].bx = this._x + this._width + 1;
child[i]._y = this._y + (this._height + 1) * i;
} else {
child[i].bx = this._x;
child[i]._y = this._y + (this._height + 1) * (i + 1);
}
}
this.onEnterFrame = function() {
for (var i=0; i<this.node.childNodes.length; i++) {
child[i].doParse();
}
delete this.onEnterFrame;
}
}
function klick() {
hideAll();
this.root.dispatch(this.bname);
}
function hideAll() {
unblock();
hideMe();
parent.hideAll();
}
function over() {
block();
parent.block();
parent.hideSubSubs(this);
for (var i=0; i<this.child.length; i++) {
this.child[i]._visible = true;
}
}
function block() {
clearInterval(IV);
this.blocked = true;
parent.block();
}
function unblock() {
clearInterval(IV);
this.blocked = false;
}
function out() {
clearInterval(IV);
this.blocked = false;
parent.unblock();
IV = setInterval(function() { hideSiblings(); }, 200);
}
function hideSiblings() {
clearInterval(IV);
hideSubs();
for (var i=0; i<parent.child.length; i++) {
parent.child[i].hideMe();
}
}
function hideMe() {
clearInterval(IV);
if (!parent.blocked) {
this.blocked = false;
hideSubs();
if (this.depth > 0) {
this._visible = false;
}
} else {
hideSubs();
}
}
function hideSubs() {
clearInterval(IV);
for (var i=0; i<this.child.length; i++) {
this.child[i].hideMe();
}
}
function hideSubSubs(obj) {
for (var i=0; i<this.child.length; i++) {
if (child[i] != obj) {
child[i].blocked = false;
child[i].hideSubs();
}
}
}
und das hier im button mc
PHP-Code:
this.useHandCursor = false;
this.onRollOver = function() {
gotoAndStop(2);
_parent.over();
}
this.onRollOut = this.onReleaseOutside = function() {
gotoAndStop(1);
_parent.out();
}
this.onRelease = function() {
_parent.klick();
}
stop();/*das stop(); stand da nich wirklich so, war in einer anderen Ebene aber im gleichen Frame*/
ich könnte Dir auch die fla senden, vielleicht hilft Dir das ja mehr... und auch die PHP...
(sorry hatte mich vertan, um das noch ein wenig genauer zu erläutern:
Eine PHP Datei, mit ganz vielen Hyroglyphischen Zeichen
generiert dann diese PHP Datei bzw. da steht, das die diese XML generiert.... welche dann im Explorer unter Quellcode ansehen wie die unten aufgeführte "XML" aussieht, hoffe das war nicht allzu verwirrend)
Das ganze funktioniert auch reibungslos, wenn die Tags attribute.name haben anstatt der ganzen Tags.
Der text tag sollte dann in den button als beschriftung, das ?idcat attribut als link bzw. URL und dieses blöde leere item tag an jedem Knotenende soll ignoriert werden.
Oh, und wegen der "XML" die sieht auch so aus:
PHP-Code:
<?xml version="1.0"?>
<!--
Author und Copyright wurde von mir entfernt
//-->
<navigation>
<item name="Hauptnavigation">
<text>Hauptnavigation</text>
<link>?idcat=1</link>
<items>
<item name="Punkt 1">
<text>Punkt 1</text>
<link>?idcat=3</link>
<items>
<item name="Punkt 1.1">
<text>Punkt 1.1</text>
<link>?idcat=6</link>
<items>
</items>
</item>
<item name="Punkt 1.2">
<text>Punkt 1.2</text>
<link>?idcat=7</link>
<items>
</items>
</item>
</items>
</item>
<item name="Punkt 2">
<text>Punkt 2</text>
<link>?idcat=8</link>
<items>
<item name="Punkt 2.1">
<text>Punkt 2.1</text>
<link>?idcat=9</link>
<items>
</items>
</item>
<item name="Punkt 2.2">
<text>Punkt 2.2</text>
<link>?idcat=10</link>
<items>
</items>
</item>
</items>
</item>
</items>
</item>
<item name="News">
<text>News</text>
<link>?idcat=12</link>
<items>
</items>
</item>
<item name="Hilfsnavigation">
<text>Hilfsnavigation</text>
<link>?idcat=2</link>
<items>
<item name="Home">
<text>Home</text>
<link>?idcat=17</link>
<items>
</items>
</item>
<item name="Impressum">
<text>Impressum</text>
<link>?idcat=4</link>
<items>
</items>
</item>
<item name="Kontakt">
<text>Kontakt</text>
<link>?idcat=5</link>
<items>
</items>
</item>
</items>
</item>
</navigation>
Das ändert schon einiges, denke ich.
Wie gesagt, das ist aber nur die Quelltext ansicht, nicht das direkte PHP Script!
Ich poste nicht oft in Foren, deswegen wusste ich nicht, wie man den PHP Code einfügt...