hello all,
i have a map, [spacebar] + [mouseclick] = dragging the map around - also the word “dragging” appears/disappears so you know you’ve started/stopped. once a building is clicked a “wall” slides up covering the map and that building’s info pops up. wonderful…
if i click a building w/o having dragged the map, then “map dragging” is correctly disabled…BUT…if i drag the map first and THEN click a building i can’t get the ‘map dragging’ to disble (the “wall” is opaque so i can still see the map moving behind it). here is my AS,
var allowDrag:String = "yes"; //initially set to enable dragging
this.onEnterFrame = function(){ // drag map
if(allowDrag != "no"){ //also tried (allowDrag == "yes")
var mouseListener:Object = new Object(); //drag map
if(Key.isDown(Key.SPACE))
{
mouseListener.onMouseDown = function()
{
_root.map.startDrag();
_root.dragLight.play();
setProperty(_root.dragLight,_alpha, 100);
}
}
else // DON'T DRAG!!!
{
Mouse.removeListener(mouseListener);
stopDrag();
_root.dragLight.stop();
setProperty(_root.dragLight,_alpha, 0);
//allowDrag = "no"
}
Mouse.addListener(mouseListener);
} // end if allowDrag
// end drag map
my building buttons are supposed to set the var to “no” to disable the dragging:
for(var b=1;b<=47;b++){ // loops thru ALL buttons
_root.map["btn"+b].onRelease = function()
{
start_it();
nozoom = "no";
allowDrag = "no";// disable map dragging after bldng is clicked
}
}
i can’t see how dragging before or after clicking a building would affect anything?!?! any ideas?
thanks!