Hi all,

despite the new SWC 1.7 and having read the tutorials,
I still have the same error appearing in Flex (Object not initialized)
at runtime, when another instance of Map is spawned. Event more
unfortunately, no good news in the net, seems like not many people
need more than just one map in an application. Pretty shame, isn't
it :)

Well, I'd love some feedback if anyone has a solution better than
a singleton pattern. BTW, I use Igor Costa's UIComponent wrapper,
and to bring the map back I added a silly ROLL_OVER listener which
passes the map-child to a component 'in focus'. It obviously won't
work when there are multiple maps side by side. Here's some snippets:

___in the UIComponent wrapper:____
                [...] function init()
                // Singleton pattern map instance
                _map = MapSingleton.getInstance();

                [...]

                public function linkBackMap():void
                {
                        if(_map.parent) {
                                (_map.parent as Mapa).setReclaimTrap();
                        }
                        this.addChild(_map);
                }

                protected function reclaimMapAsChild(e:MouseEvent):void
                {
                        this.removeEventListener(MouseEvent.ROLL_OVER, 
reclaimMapAsChild);
                        linkBackMap();
                }

                public function setReclaimTrap():void
                {
                        addEventListener(MouseEvent.ROLL_OVER, 
reclaimMapAsChild);
                }

____

cheers,

ptrk
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to