Dabei seit: 19.08.2010 Ort: - Alter: - Geschlecht: -
Verfasst Fr 20.08.2010 00:51 Titel
Galerie Pager AS2
Hallo,
Ich habe mir das "Alle meine Kinder"-Tutorial angesehen, aber ich habe dazu noch eine Frage:
Kann man das auf eine weitere Ebene erweitern?
Wie kann ich die Bilder in Schalter ändern und eine Galerie pro Bild daraus machen?
Ziel ist es eine XML für Projekte mit einem Bild zu nehmen (8x2 Bilder) und dann durch klick
eine Galerie des Projekts anzuzeigen.
Dabei seit: 19.08.2010 Ort: - Alter: - Geschlecht: -
Verfasst Di 24.08.2010 01:08 Titel
Okay, habe schon herausgefunden dass die Skalierung von Flash auch so funktioniert.
Wenn ein Bild bei 100px x 100px platziert wird, wird es entsprechend plaziert.
Wie mach ich die Dinger aber anklickbar?
Code:
var Project_arr:Array = new Array(); // the array that collects it all
var Project_xml:XML = new XML(); // XML-object to load and parse the XML-file
Project_xml.ignoreWhite = true; // ignore Whitespace in the XML-file
Project_xml.onLoad = function(success:Boolean) {
switch(success) {
//
// SUCCESS: XML loaded
case true:
trace("XML successfully loaded..." + this.firstChild.childNodes.length + " projects in line"); // count of projects
for(var i:Number = 0; i < this.firstChild.childNodes.length; i++) { // for every <project>
var _node1:XMLNode = this.firstChild.childNodes[i]; // # of Nodes in <project>
Project_arr.push(new Object()); // create an Object for this Project
trace ("Projects registered: " + Project_arr.length); // trace # of P-Objects
var _obj:Object = Project_arr[i]; // this Project
for(var n:Number = 0; n < _node1.childNodes.length; n++){
var _node2:XMLNode = _node1.childNodes[n];
trace ("subNodes: " + _node2.childNodes.length + " nodeName: " + _node2.nodeName); // trace <image>
// in this version all information comes from attributes and the image is the single child
//
var _item:Object = _obj[_node2.nodeName] = new Object();
}
}
break;
//
// ERROR: if something went wrong with the XML-file
case false:
trace("Error loading the XML-file!");
break;
}
};
Project_xml.load("encours_fr3.xml"); // fetch the XML
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst an Umfragen in diesem Forum nicht mitmachen.
Mediengestalter.info ist ein Projekt von Webformatik:: Forensoftware: phpBB