Hallo zusammen,
ich hab ein kleines Problem mit 2 SwF dateien. Ich lade in mein erstes SWF, Daten in Comboboxen aus einem Xml. Betätige ich nun ein button um mein zweites Swf zu öffnen werden die xml-Daten in diesem swf nicht mehr geladen. Gehe ich wieder zurück auf erste swf werden diese ebenfals nicht mehr geladen.
PHP-Code:
onLoad = function() {
_root.auswahltext._visible=false;
_root.suche._visible=false;
_root.requestObjects("http://localhost/campus/campus.php");
}
stop();
this.myObjectXML = new XML();
this.myObjectXML.ignoreWhite = true;
this.myObjectXML.onLoad = function(sucess) { importObjects(sucess); }
//Arrays mit allen Daten
this.myObjectBau = new Array();
this.myObjectFak = new Array();
this.myObjectPer = new Array();
this.myObjectRau = new Array();
// Hilfsvariablen + Arrays für comboboxen anlegen
var building = new Array();
var fakName = new Array();
var room = new Array();
var perName = new Array();
//zusätzliche angaben für combobox
this.building.push("Wählen Sie");
this.fakName.push("Wählen Sie");
this.room.push("Wählen Sie");
this.perName.push("Wählen Sie");
// Füllen der arrays aus dem Xml
function importObjects(sucess) {
if(sucess) {
var xmlTarget = this.myObjectXML.firstChild;
if (xmlTarget.nodeName == "campus") {
for(var i=0; i<xmlTarget.childNodes.length; i++) {
if (xmlTarget.childNodes[i].nodeName == "bau") {
this.building.push(xmlTarget.childNodes[i].attributes.building_name);
}
if(xmlTarget.childNodes[i].nodeName == "fak") {
this.fakName.push(xmlTarget.childNodes[i].attributes.course);
}
if(xmlTarget.childNodes[i].nodeName == "rau") {
this.room.push(xmlTarget.childNodes[i].attributes.rooms_id);
}
if(xmlTarget.childNodes[i].nodeName == "per") {
this.perName.push(xmlTarget.childNodes[i].attributes.surname);
}
if(xmlTarget.childNodes[i].nodeName == "bau") {
this.myObjectBau.push(xmlTarget.childNodes[i].attributes);
}
if(xmlTarget.childNodes[i].nodeName == "fak") {
this.myObjectFak.push(xmlTarget.childNodes[i].attributes);
}
if(xmlTarget.childNodes[i].nodeName == "rau") {
this.myObjectRau.push(xmlTarget.childNodes[i].attributes);
}
if(xmlTarget.childNodes[i].nodeName == "per") {
this.myObjectPer.push(xmlTarget.childNodes[i].attributes);
}
}
}
delete(this.myObjectXML);
this.coBoData(this.cb_bau, building);
this.coBoData(this.cb_fak, fakName);
this.coBoData(this.cb_rau, room);
this.coBoData(this.cb_per, perName);
}
}
function requestObjects(MyRequestURL) {
this.myObjectXML.load(MyRequestURL);
}
// auswahl anzeigen
objComboListener = new Object();
objComboListener.change = function(eventObj){
_root.auswahl_cb.text = eventObj.target.value;
_root.auswahltext._visible = true;
_root.suche._visible = true;
/*
var building = "KBau";
var frame = "_f2";
var clipID = building + frame;
var test = "KBau_f2";
var myClip = new MovieClip();
function myClip(ID) {
var infobuilding;
var frame;
//var clipID = infobuilding + frame;
for(var i=0; i < this.myObjectBau.length; i++) {
if(this.myObjectBau[i].building_name == ID) {
infobuilding = this.myObjectBau[i].building_name + frame;
break;
}
}
*/
var currentFrameCampus = _root.campus._currentframe;
var myClip;
switch(currentFrameCampus) {
case 1: myClip = "_f2";
break;
case 2: myClip = "_f2";
break;
case 12: myClip = "_f3";
break;
case 26: myClip = "_f4";
break;
case 40: myClip = "_f1";
break;
default: myClip = "_f2";
break;
}
trace(myClip);
}
cb_bau.addEventListener("change", objComboListener);
cb_fak.addEventListener("change", objComboListener);
cb_rau.addEventListener("change", objComboListener);
cb_per.addEventListener("change", objComboListener);
//Label style änder.
auswahl_cb.setStyle("fontSize", 14);
auswahl_cb.setStyle("color", 0xFFFFFF);
auswahl_cb.setStyle("fontWeight", "bold");
auswahl_cb.setStyle("fontStyle", "italic");
noch der button zum verlinkten 2 swf:
PHP-Code:
on (release) {
loadMovie("B-Bau6Feb.swf",0);
}
im zweiten SWF ist der code gleich deswegen nicht gepostet.
kann es an dem onload liegen? weiss jemand abhilfe.
danke Robin