1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
import starContainer;
import constellation;
class planetarium extends Object{
private var lstEtoiles = new Array;
private var lstConst = new Array;
private var ciel:XMLNode;
public function planetarium( xmlFile:String ){
var xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(success){
if(success){
// fill sky with all stars -- starContainer
trace("lstEtoiles length : " + lstEtoiles.length);
trace("lstConst length : " + lstConst.length);
ciel = xml.firstChild;
var childs = ciel.childNodes;
var node:XMLNode = childs[0].firstChild;
while(node){
var etoile = _root.attachMovie("starContainer", node.attributes.nom, _root.getNextHighestDepth());
etoile.initialize(node);
lstEtoiles.push(etoile);
trace("lstEtoiles length : " + lstEtoiles.length);
node = node.nextSibling;
}
// fill sky with constellations
node = childs[1].firstChild;
while(node){
var const = _root.attachMovie("cstl", node.attributes.nom, _root.getNextHighestDepth());
const.initialize(node);
lstConst.push(const);
trace("lstConst length : " + lstConst.length);
node = node.nextSibling;
}
}
}
xml.load(xmlFile);
var a = 1;
}
public function showLinks(){
for(var i = 0; i< lstConst.length; i++){
lstConst[i].drawLinks();
}
}
} |
Partager