henkep
05-15-2005, 03:55 PM
I has a class called Map.as. That class read a XML-file and draw the map.
This Map-class is a movieclip on the stage.
Everytime I have to "load" and "read" coordinates in the file, how do I do to avoid this. And just "draw" the map. I have send the code also
class Map extends MovieClip {
function Map() {
zoomFactor = 1000;
loadmap();
Key.addListener(this);
}
function Zoomin():Void {
clear();
zoomFactor = zoomFactor+100;
loadmap();
}
function Zoomout():Void {
clear();
zoomFactor = zoomFactor-100;
loadmap();
}
private function loadmap() {
var contryIndex:Number;
var mapIndex:Number;
var map:XML = new XML();
var X:Number;
var Y:Number;
var mapMax:Number;
var contryMax:Number;
var factor:Number;
factor = zoomFactor;
mapIndex = 0;
contryIndex = 0;
map.ignoreWhite = true;
map.load("http://localhost/GronlandXMLstereo.xml");
map.onLoad = function(success) {
if (success) {
read and draw the map
}
}
};
}
private var zoomFactor;
}
This Map-class is a movieclip on the stage.
Everytime I have to "load" and "read" coordinates in the file, how do I do to avoid this. And just "draw" the map. I have send the code also
class Map extends MovieClip {
function Map() {
zoomFactor = 1000;
loadmap();
Key.addListener(this);
}
function Zoomin():Void {
clear();
zoomFactor = zoomFactor+100;
loadmap();
}
function Zoomout():Void {
clear();
zoomFactor = zoomFactor-100;
loadmap();
}
private function loadmap() {
var contryIndex:Number;
var mapIndex:Number;
var map:XML = new XML();
var X:Number;
var Y:Number;
var mapMax:Number;
var contryMax:Number;
var factor:Number;
factor = zoomFactor;
mapIndex = 0;
contryIndex = 0;
map.ignoreWhite = true;
map.load("http://localhost/GronlandXMLstereo.xml");
map.onLoad = function(success) {
if (success) {
read and draw the map
}
}
};
}
private var zoomFactor;
}