Here is my latest solution:

Document class:

===============

import com.foo.util.GoogleMaps;

...

_map.controls = ['PositionControl', 'ZoomControl', 'MapTypeControl',
'ScaleControl', 'OverviewMapControl'];

===============


Here's com.foo.util.GoogleMaps:

===============

import com.google.maps.controls.*;

...

private function onMapReady($e:Event):void {
        for each (var s:String in _controls) {
                this['my' + s]();
        }
};

...

private function myZoomControl():void {
        _map.addControl(new ZoomControl());
};

private function myPositionControl():void {
        _map.addControl(new PositionControl());
};

private function myMapTypeControl():void {
        _map.addControl(new MapTypeControl());
};

private function myScaleControl():void {
        _map.addControl(new MapTypeControl());
};

private function myOverviewMapControl():void {
        _map.addControl(new MapTypeControl());
}

...

public function set controls($a:Array):void {
        _controls = $a;
};

===============

I am sure to all ya'll pro AS3 coders, the above looks pretty silly... :)

I don't think I will actually use the above code in my final
program... I just thought I would share a working solution.

Thanks again for all of the help! I really appreciate it. :)

Cheers,
Micky
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to