Graphics Programs Reference
In-Depth Information
var buttons:Array = new Array();
navButtons = new Sprite();
addChild(navButtons);
buttons.push(makeButton(navButtons, 'plus', '+', map.zoomIn));
buttons.push(makeButton(navButtons, 'minus', '-', map.zoomOut));
var nextX:Number = 0;
for(var i:Number = 0; i < buttons.length; i++) {
var currButton:Sprite = buttons[i];
Sprite(buttons[i]).scaleX = 3;
Sprite(buttons[i]).scaleY = 3;
Sprite(buttons[i]).x = nextX;
nextX += 3*Sprite(buttons[i]).getChildByName('label').width;
}
navButtons.x = 2; navButtons.y = map.height-navButtons.height-2;
}
However, because it's a function, the code won't execute until you call it.
In the Openings() function, also known as the constructor, under the fil-
ters, add drawNavigation() . Now you can zoom in to locations of interest, as
shown in Figure 8-45.
FIGurE 8-45 Map with zooming enabled
That's all you need for the base map. You pick your tiles, set your vari-
ables, and enable interaction.
Search WWH ::




Custom Search