was willst denn du wissen ?
Warum kan nicht auf die Funktionen im mcProduct zugreifen?
stop();
xml_conn.trigger();
_global.aSpecs = new Array();
_global.sDescription;
_global.sAdvantages;
_global.sProductName;
_global.nCurrentPid;
_global.bLoadedOK = false;
this.attachMovie("welcome", "mcWelcome", 0, {_x:340, _y:277});
customizeTree();
var treeListener:Object = new Object();
treeListener.target = tree;
function loadData():Void {
// Get XML
var xmlProduct:XML = new XML();
xmlProduct.ignoreWhite = true;
xmlProduct.onLoad = function(bSuccess:Boolean) {
if (bSuccess) {
_global.bLoadedOK = true;
var xnRoot:XMLNode = this.firstChild;
var xnProductName:XMLNode = xnRoot.firstChild;
_global.sProductName = xnProductName.firstChild.nodeValue;
// Beschreibung
var xnDescription:XMLNode = xnProductName.nextSibling;
_global.sDescription = xnDescription.firstChild.nodeValue;
// Vorteile
var xnAdvantages:XMLNode = xnDescription.nextSibling;
_global.sAdvantages = "<ul>";
for (var i = 0; i<xnAdvantages.childNodes.length; i++) {
xnAdvantage = xnAdvantages.childNodes[i];
_global.sAdvantages += "<li>"+xnAdvantage.firstChild.nodeValue+"</li>";
}
_global.sAdvantages += "</ul";
var xnSpecs:XMLNode = xnAdvantages.nextSibling;
var xnAnmischverhaeltnis:XMLNode = xnSpecs.firstChild;
_global.aSpecs['anmischverhaeltnis'] = xnAnmischverhaeltnis.firstChild.nodeValue;
var xnRuehrzeit:XMLNode = xnAnmischverhaeltnis.nextSibling;
_global.aSpecs['ruehrzeit'] = xnRuehrzeit.firstChild.nodeValue;
var xnVz:XMLNode = xnRuehrzeit.nextSibling;
_global.aSpecs['vz'] = xnVz.firstChild.nodeValue;
var xnAb:XMLNode = xnVz.nextSibling;
_global.aSpecs['ab'] = xnAb.firstChild.nodeValue;
var xnEntf:XMLNode = xnAb.nextSibling;
_global.aSpecs['entf'] = xnEntf.firstChild.nodeValue;
var xnHaerte30min:XMLNode = xnEntf.nextSibling;
_global.aSpecs['haerte30min'] = xnHaerte30min.firstChild.nodeValue;
var xnHaerte60min:XMLNode = xnHaerte30min.nextSibling;
_global.aSpecs['haerte60min'] = xnHaerte60min.firstChild.nodeValue;
var xnHaerte24h:XMLNode = xnHaerte60min.nextSibling;
_global.aSpecs['haerte24h'] = xnHaerte24h.firstChild.nodeValue;
var xnDruckfest_1h:XMLNode = xnHaerte24h.nextSibling;
_global.aSpecs['druckfest_1h'] = xnDruckfest_1h.firstChild.nodeValue;
var xnDruckfest_24h:XMLNode = xnDruckfest_1h.nextSibling;
_global.aSpecs['druckfest_24h'] = xnDruckfest_24h.firstChild.nodeValue;
var xnAbbindeexpansion:XMLNode = xnDruckfest_24h.nextSibling;
_global.aSpecs['abbindeexpansion'] = xnAbbindeexpansion.firstChild.nodeValue;
displayData();
} else {
_global.bLoadedOK = false;
}
};
xmlProduct.load("de/katalog/php/product.php?pid="+_global.nCurrentPid);
}
function customizeTree():Void {
this.tree.setStyle("backgroundColor", "none");
this.tree.setStyle("borderStyle", "none");
this.tree.setStyle("color", 0x000000);
this.tree.setStyle("depthColors", [0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff]);
this.tree.setStyle("embedFonts", false);
this.tree.setStyle("fontFamily", "verdana");
this.tree.setStyle("fontSize", 10);
this.tree.setStyle("fontWeight", 0xffffff);
this.tree.setStyle("indentation", 5);
this.tree.setStyle("rollOverColor", 0xffffff);
this.tree.setStyle("scrollSelectedList", "none");
this.tree.setStyle("selectionColor", 0xffffff);
this.tree.setStyle("selectionDuration", 0);
this.tree.setStyle("textIndent", 0);
this.tree.setStyle("textRollOverColor", 0x000000);
this.tree.setStyle("textSelectedColor", 0x000000);
this.tree.setStyle("textRollOverColor", 0x000000);
this.tree.vScrollPolicy = 'auto';
this.tree.depthChild0._visible = false;
this.tree.depthChild0._alpha = 0;
}
function fadeOutWoman():Void {
}
function displayData():Void {
// if this is the first time a product was choosen, remove the welcome message(fade out woman)
if (mcWelcome) {
mcWelcome.onEnterFrame = function() {
if (mcWelcome._alpha >=0) {
mcWelcome._alpha -= 5;
} else {
show();
mcWelcome.removeMovieClip();
delete mcWelcome.onEnterFrame;
}
};
}
}
function show():Void {
mcProduct.removeMovieClip();
_level0.main.attachMovie("product", "mcProduct", 1, {_x:353, _y:277});
// trace(targetPath(mcProduct")); ergibt _level0.main.mcProduct
_level0.main.mcProduct.displayDescription();
_level0.main.mcProduct.displayTitle();
}
// If the user clicked on a leaf of the product:
treeListener.change = function(evt:Object) {
var node = evt.target.selectedItem;
_global.nCurrentPid = Number(node.attributes.value);
// if a leaf wach choosen, that has a value then do this:
if (_global.nCurrentPid) {
loadData();
}
};
tree.addEventListener('change', treeListener);