system.useCodepage = true;
var objXML = new XML();
objXML.onLoad = isLoaded;
objXML.ignoreWhite = true;
objXML.load("test_bilder.xml");
function isLoaded(ok) {
var err_msg = "";
if (ok && objXML.status == 0) {
view_messages();
} //end if
else {
switch (objXML.status) {
case -2 :
err_msg = "Ein CDATA-Bereich wurde nicht ordnungsgemäß beendet.";
break;
case -3 :
err_msg = "Die XML-Deklaration wurde nicht ordnungsgemäß beendet.";
break;
case -4 :
err_msg = "Die DOCTYPE-Deklaration wurde nicht ordnungsgemäß beendet.";
break;
case -5 :
err_msg = "Ein Kommentar wurde nicht ordnungsgemäß beendet.";
break;
case -6 :
err_msg = "Ein XML-Element war ungültig.";
break;
case -7 :
err_msg = "Zu wenig Speicher";
break;
case -8 :
err_msg = "Ein Attributwert wurde nicht ordnungsgemäß beendet.";
break;
case -9 :
err_msg = "Das zu einem Anfangstag gehörige Endtag fehlte.";
break;
case -10 :
err_msg = "Es trat ein Endtag ohne zugehöriges Anfangstag auf.";
break;
default :
err_msg = "Ein nicht spezifiziertes Problem ist aufgetreten.";
}
trace("FEHLER:\n\n"+err_msg.toString()+"\nDer Vorgang wird gestoppt.");
objXML = null;
}//end else
}//end function isLoaded(ok)
function view_messages() {
var bildanzahl = objXML.firstChild.firstChild.childNodes.length;
//bildanzahl = unter Knoten Bilder, die Anzahl der Bildknoten
//trace(bildanzahl);
var elemtanzahl = objXML.firstChild.firstChild.firstChild.childNodes .length;
//elemtanzahl = unter Knoten Bilder, unter Knoten Bilder, die Anzahl der Bildelemente
//trace(elemtanzahl);
/*----------------------------Bild laden----------------------------*/
POSY=96;
abstand=16;
i=1;
nochbeimladen = 0;
this.onEnterFrame = function(){
if (i<=bildanzahl && nochbeimladen==0){
nochbeimladen=1;
container.createEmptyMovieClip ("bildklein"+i,i);
node = objXML.firstChild.childNodes[0].childNodes[i-1].childNodes[0];
bildurl=node.firstChild.nodeValue.toString();
_root.container["bildklein"+i].myi=i;
_root.container["bildklein"+i]._x=abstand;
_root.container["bildklein"+i]._y=POSY;
_root.container["bildklein"+i].loadMovie(bildurl,1);
}//end if
else if (_root.container["bildklein"+i].getBytesLoaded() >= _root.container["bildklein"+i].getBytesTotal() && nochbeimladen==1){
bild(i);
nochbeimladen=0;
i++;
}//end elseif
else if (i>bildanzahl){
delete this.onEnterFrame;
}//end elseif
}//end function()
function bild(i){
_root.container["bildklein"+i].onEnterFrame=function(){
if(_root.container["bildklein"+i].getBytesTotal() >= _root.container["bildklein"+i].getBytesTotal()){
var bildBreite=_root.container["bildklein"+i]._width;
var bildHoehe=_root.container["bildklein"+i]._height;
if(bildBreite>0){
scal(i,bildBreite,bildHoehe);
delete _root.container["bildklein"+i].onEnterFrame;
}//end if
}//end if
}//end onEnterFrame
function scal(i,bildBreite,bildHoehe){
if(i==1){
createTextField("Ausgabe"+i,bildanzahl+2,12,448,455,35);
var textnode = objXML.firstChild.childNodes[0].childNodes[i-1].childNodes[1];
bildtext = textnode.firstChild.nodeValue.toString();
meinFormat = new TextFormat();
meinFormat.font ="Verdana";
meinFormat.size = 11;
meinFormat.textColor = 0x000000;
meinFormat.bold = false;
meinFormat.italic = false;
meinFormat.multiline = true;
meinFormat.html=true;
_root["Ausgabe"+i].wordWrap = true;
_root["Ausgabe"+i].htmlText = bildtext;
_root["Ausgabe"+i].setTextFormat(meinFormat);
createEmptyMovieClip("bildgross"+i,bildanzahl+1);//i+bildanzahl+2
node = objXML.firstChild.childNodes[0].childNodes[i-1].childNodes[0];
bildurl=node.firstChild.nodeValue.toString();
neu_bild_x=240-(bildBreite/2);
neu_bild_y=315-(bildHoehe/2);
_root["bildgross" +i]._x=neu_bild_x;
_root["bildgross" +i]._y=neu_bild_y;
_root["bildgross" +i].loadMovie(bildurl,i);
}//end if
prop=bildHoehe/bildBreite;
neu_bildHoehe=75;
_root.container["bildklein"+i]._height=neu_bildHoehe;
_root.container["bildklein"+i]._width=neu_bildHoehe/prop;
_root.container["bildklein"+i]._alpha=35;
abstand=abstand+_root.container["bildklein"+i]._width;
schalt(i,bildBreite,bildHoehe);
}//end function groesse
function schalt(i,bildBreite,bildHoehe){
_root.container["bildklein"+i].onRollOver= function(){
_root.container["bildklein"+i]._alpha=100;
bild1();
}//end onRollOver
_root.container["bildklein"+i].onRollOut= function(){
_root.container["bildklein"+i]._alpha=35;
}//end onRollOut
_root.container["bildklein"+i].onRelease = function() {
createTextField("Ausgabe"+i,bildanzahl+2,12,448,455,35);
var textnode = objXML.firstChild.childNodes[0].childNodes[i-1].childNodes[1];
bildtext = textnode.firstChild.nodeValue.toString();
meinFormat = new TextFormat();
meinFormat.font ="Verdana";
meinFormat.size = 11;
meinFormat.textColor = 0x000000;
meinFormat.bold = false;
meinFormat.italic = false;
meinFormat.multiline = true;
meinFormat.html=true;
_root["Ausgabe"+i].wordWrap = true;
_root["Ausgabe"+i].htmlText = bildtext;
_root["Ausgabe"+i].setTextFormat(meinFormat);
createEmptyMovieClip("bildgross"+i,bildanzahl+1);
node = objXML.firstChild.childNodes[0].childNodes[i-1].childNodes[0];
bildurl=node.firstChild.nodeValue.toString();
neu_bild_x=240-(bildBreite/2);
neu_bild_y=315-(bildHoehe/2);
_root["bildgross" +i]._x=neu_bild_x;
_root["bildgross" +i]._y=neu_bild_y;
_root["bildgross" +i].loadMovie(bildurl,i);
}//end onRelease
}//end function schalt
}//end function bild(i)
_root.container.onMouseMove = function(){
mausx=_xmouse;
mausy=_ymouse;
pos=_root.container._x;
wid=450-_root.container._width;
if(mausx>=16 && mausx<=232 && mausy>=96 &&mausy<=171){
if(pos!=0){
this._x+=3;
}//end if
}//end
else if(mausx>=232 && mausx<=464 && mausy>=96 &&mausy<=171){
if(pos>=wid){
this._x+=(-3);
}//end if
}//end else if
}//end
}//end function view_messages()