Hi eyeole- I wasn't able to run that fla for some reason (got an invalid file format error). What error did you get, exactly?
- pamela On Tue, Dec 9, 2008 at 12:23 PM, eyeole <[email protected]> wrote: > > Hello pamela, > > I was playing around after I posted my first question and I found a > way (kind of) that works for me. > > Is there any any where with my previous code that I posted that I can > add a info window to markerA with something like > markerA.openInfoWindow(new InfoWindowOptions({content:"Peace > River High School"})); > > in the place of > map.openInfoWindow(new LatLng(56.241817,-117.289728), > new InfoWindowOptions({content: "Peace River > High School"})) > > instead of just opening a info window on the map. > > I saw that this was accomplished in the draggable markers tutorial, > but there it was done in the onmapReady function. I would have to do > it outside of that function. Whenever I try that it gives me an > error! Is that possible and how? I have uploaded my updated Menu > Bar.fla (and a CS3 version) so you can see my full code. > > Sorry for the hassle, > eyeole > > P.S Hope this makes some sense to you! > > On Dec 8, 3:36 am, "pamela (Google Employee)" <[email protected]> > wrote: > > Hi eyeole- > > To clear listeners in AS3, you have to use Object.removeEventListener, > > passing in the same parameters and function reference - so if you wanted > to > > remove that listener, you'd have to make the event callback it's own > > function (not inline). See: > http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/event...() > > > > It might be easier for you to set a flag to see if the infowindow for the > > marker has opened yet, and then only open it on the first move_end after. > > > > - pamela > > > > > > > > On Sat, Dec 6, 2008 at 7:07 PM, eyeole <[email protected]> wrote: > > > > > (using 1_8a library) > > > > > I am trying to get my info window to close with a drag_start event. > > > > > My code (in part) is below. The code executes but the problem is that > > > as soon as you stop dragging the mouse the infowindow reappears. (I > > > have also tried putting in a "hasCloseButton: true" into my info > > > window options but the same closing and reappearing occurs.) Drag_end > > > does nothing at all > > > > > Are these issues a result of using the map move event: move_end > > > listener to open the infowindow? If so how can I stop the listener > > > inside the function. > > > > > If not, then what is occurring and how can I get around it? > > > > > import com.google.maps.LatLng; > > > import com.google.maps.Map; > > > import com.google.maps.MapEvent; > > > import com.google.maps.MapMouseEvent; > > > import com.google.maps.MapMoveEvent; > > > import com.google.maps.MapType; > > > import com.google.maps.overlays.Marker; > > > import com.google.maps.overlays.MarkerOptions; > > > import com.google.maps.styles.FillStyle; > > > import com.google.maps.styles.StrokeStyle > > > import com.google.maps.InfoWindowOptions > > > import com.google.maps.controls.MapTypeControl; > > > import com.google.maps.controls.ZoomControl; > > > import com.google.maps.controls.PositionControl > > > > > var map:Map = new Map(); > > > map.key = > > > > > > "ABQIAAAA80Glo37MZ56fw1S4UUY44hRzPnC9TjKENMaIdC0OLHndWsw2xhQ6iXbvihoFZVFtQOvx88ZlKonUEg"; > > > map.setSize(new Point(550, 400)); > > > map.x = 15; > > > map.y = 300; > > > map.addEventListener(MapEvent.MAP_READY, onMapReady); > > > this.addChild(map); > > > > > function onMapReady(event:Event):void { > > > map.setCenter(new LatLng(56.242973,-117.294069), 16, > > > MapType.SATELLITE_MAP_TYPE); > > > map.addControl(new MapTypeControl()); > > > map.addControl(new ZoomControl()); > > > map.addControl(new PositionControl()); > > > map.removeMapType(MapType.PHYSICAL_MAP_TYPE); > > > var markerA:Marker = new Marker( > > > new LatLng(56.241617,-117.289728), > > > new MarkerOptions({ > > > strokeStyle: new StrokeStyle({color: 0x000000}), > > > fillStyle: new FillStyle({color: 0xFF0000, alpha: > > > 1.0}), > > > radius: 7, > > > hasShadow: true > > > })); > > > > > map.addOverlay(markerA); > > > }; > > > > > function panMarkerA (event:MouseEvent):void { > > > map.panTo(new LatLng(56.241617,-117.289728)); > > > map.addEventListener(MapMoveEvent.MOVE_END, function > > > (event:Event):void { > > > map.openInfoWindow(new > > > LatLng(56.241817,-117.289728), > > > new InfoWindowOptions({content: "Peace River > High > > > School"})) > > > }); > > > }; > > > > > map.addEventListener(MapMouseEvent.DRAG_START, function > > > (event:MapMouseEvent):void { > > > map.closeInfoWindow(); > > > }); > > > > > Thanks, > > > eyeole- Hide quoted text - > > > > - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
