One more thing I should probably add. You don't have to convert the GoogleMapsLibrary component to a movieclip you can just dump it on the stage, give it an instance name and do all the as there.
On Sat, May 2, 2009 at 1:16 PM, Jim East <[email protected]> wrote: > I forgot to mention that after I converted the *GoogleMapsLibrary > component *I deleted it form the stage > then I right clicked the MovieClip in the library, selected linkage and > clicked export for actionscript. The last stage creates a class based on > the name of the movie clip when you press enter after clicking export for > actionscript you get a message telling you the class doesn't exist and > actionscript will make it for you this is good just press enter. In my > example MapMC is the name of the new class. > > > On Sat, May 2, 2009 at 1:07 PM, Jim East <[email protected]> wrote: > >> this is what it looks like: >> http://cybermountainwebservices.com/as3MapOverAs2/ >> >> this is how I made it: >> I created a simple AS2 swf >> >> then I created a as3 swf with this code >> the main time line has a single actions layer nothing else with this code >> *// this to load the as2 swf >> var loader:Loader = new Loader(); >> var objToLoad:URLRequest = new URLRequest("AS2.swf"); >> loader.load(objToLoad); >> loader.x = 0; >> loader.y = 0; >> this.addChildAt(loader, 0); >> >> //this to load the MovieClip that contains the GoogleMapsLibrary component >> var map:MapMC = new MapMC(); >> addChild(map); >> map.x = 200; >> map.y = 200;* >> >> before I wrote that code I dragged the *GoogleMapsLibrary component* on >> to the stage and converted to a >> MovieClip with the registration point in the center >> the MovieClip also only has a actions layer and it contains this code. >> >> *import com.google.maps.LatLng; >> import com.google.maps.Map; >> import com.google.maps.MapEvent; >> import com.google.maps.MapType; >> import com.google.maps.controls.ZoomControl; >> import com.google.maps.controls.MapTypeControl; >> >> var map:Map = new Map(); >> map.key = >> "ABQIAAAAREqiX-rchDAf5rxchuz6dBRWe2mVX0hDrmSB-WmloJC2Gq5woRTC7qP0U2HFXQ2VGQr29bhHJOlY-Q"; >> >> map.setSize(new Point(500, 300)); >> map.addEventListener(MapEvent.MAP_READY, onMapReady); >> map.x = 0; >> map.y = 0; >> >> this.addChild(map); >> >> function onMapReady(event:Event):void >> { >> map.setCenter(new LatLng(40.736072,-73.992062), 14, >> MapType.NORMAL_MAP_TYPE); >> map.addControl(new ZoomControl()); >> map.addControl(new MapTypeControl()); >> } >> * >> >> >> >> On Sat, May 2, 2009 at 12:34 PM, [email protected] < >> [email protected]> wrote: >> >>> appreciated.a step by step guide is the best. >>> ;) >>> >>> >>> On 02 May 2009, at 20:12, Jim East wrote: >>> >>> I'm working on an example I'll get back to you in a few minutes. >>> >>> On Sat, May 2, 2009 at 10:39 AM, [email protected] < >>> [email protected]> wrote: >>> >>>> what do you mean?please explain yourself better. >>>> >>>> >>>> On 02 May 2009, at 19:03, Jim East wrote: >>>> >>>> Loading the as2 movie into the as3 movie with the map is the only >>>> feasible way I can think of. >>>> >>>> On Sat, May 2, 2009 at 3:32 AM, drn006 <[email protected]> wrote: >>>> >>>>> >>>>> I have the same problem as Jedikalimero. It is impossible to change >>>>> the site from AS2 to AS3 for this function, and client is eager to get >>>>> this Google map working dynamically. >>>>> >>>>> I'm blank >>>>> What can I do? >>>>> >>>>> >>>>> >>>>> On Mar 30, 4:27 pm, jedikalimero <[email protected]> wrote: >>>>> > Thank you, Pamela >>>>> > >>>>> > I already have created (with lot of effort) a simple AS3 movie with >>>>> > just the map, so overlaying this AS3 movie over theAS2movie can be >>>>> > an option worth of looking at. Since I already have the AS3 movie >>>>> > working, it would be easier than using the Javascript API. >>>>> > >>>>> > It is a pity Google doesn't care about theAS2programmers. AS3 maybe >>>>> > more structured, efficient and generate faster code, but it is too >>>>> > much complicated for the user mainly oriented to the graphical part >>>>> of >>>>> > Flash like me. And there are lots of webs like mine already >>>>> programmed >>>>> > inAS2that can't just add a Google Map because they would have to >>>>> > port all the site to AS3. Even for an expert AS3 programmer it would >>>>> > be a big task, hardly worth the effort. >>>>> > >>>>> > This is an example of how complicated AS3 is for a graphic artist who >>>>> > has only basic programming background: >>>>> > >>>>> > Button for sending e-mail inAS2: >>>>> > //------------------------------------------------------------------ >>>>> > on (release) { >>>>> > getURL("mailto:[email protected]");}; >>>>> > >>>>> > //------------------------------------------------------------------ >>>>> > >>>>> > Direct and simple. The code is in the button but you can be neat and >>>>> > place it in the main timeline with little effort. Now let's see the >>>>> > same thing in AS3: >>>>> > //------------------------------------------------------------------ >>>>> > import flash.net.*; >>>>> > >>>>> > correo.addEventListener(MouseEvent.CLICK, abrirCorreo); >>>>> > >>>>> > function abrirCorreo(event:MouseEvent):void { >>>>> > var url:String = "mailto:[email protected]"; >>>>> > var request:URLRequest = new URLRequest(url); >>>>> > navigateToURL(request);}; >>>>> > >>>>> > //------------------------------------------------------------------ >>>>> > >>>>> > You already have the AS3 API. porting it theAS2should be very easy, >>>>> > or letting somebody to do the work for you. I'm sure there is a lot >>>>> of >>>>> > people willing to do it. >>>>> > >>>>> > Juan C Walls >>>>> > >>>>> > On Mar 30, 2:17 am, pamela fox <[email protected]> wrote: >>>>> > >>>>> > > Hi jedikalimero- >>>>> > > I believe your only option is to embed the JS Map over the >>>>> currentAS2SWF. >>>>> > > There's an example that's similar of overlaying the Earth API over >>>>> a Flex >>>>> > > application: >>>>> http://cynergysystems.com/blogs/page/andrewtrice?entry=google_eath_fl. >>>>> .. >>>>> > >>>>> > > Actually, perhaps you can overlay an AS3 SWF over anAS2SWF, using >>>>> the >>>>> > > right CSS mastery. I have no demo of that though, just speculation. >>>>> > >>>>> > > - pamela >>>>> > >>>>> > > On Sat, Mar 28, 2009 at 9:49 AM, jedikalimero < >>>>> [email protected]> wrote: >>>>> > >>>>> > > > Unfortunately, the client wants the map to be dynamic, so the >>>>> user can >>>>> > > > search for subway stations, change to satellite view, see nearby >>>>> > > > monuments, zoom, etc. >>>>> > >>>>> > > > On 27 mar, 23:46, Arothian <[email protected]> wrote: >>>>> > > > > If your map is simply showing the singular location fo this >>>>> 'shop' you >>>>> > > > > could try using the Static Map API and embedding a image into >>>>> the app. >>>>> > > > > I'm not that familiar with the image tools orAS2but its an >>>>> idea. >>>>> > >>>>> > > > > On Mar 27, 6:42 pm, jedikalimero <[email protected]> wrote: >>>>> > >>>>> > > > > > I have a flash site that was developed inActionScript 2. the >>>>> client >>>>> > > > > > now wants to include a Google Map with a map view of his >>>>> shop, so you >>>>> > > > > > click on a botton labeled "location" and the map would appear >>>>> in the >>>>> > > > > > site (not in another window/tab/page) >>>>> > >>>>> > > > > > Problem, evidently is Google Maps API only supports AS3. and >>>>> loading >>>>> > > > > > an AS3 movie from anAS2movie will not work. >>>>> > >>>>> > > > > > Is there any way to solve this? (apart from rewriting the >>>>> entire site >>>>> > > > > > in AS3, obviously) >>>>> > >>>>> > > > > > What if I make a simple AS3 movie that loads my >>>>> currentAS2movie and >>>>> > > > > > then myAS2movie loads the Map AS3 movie or ask the base AS3 >>>>> movie to >>>>> > > > > > load the map AS3 movie? >>>>> > >>>>> > > > > > What if I use the JavaScript API to overlay the map in a new >>>>> HTML >>>>> > > > > > layer over the layer that contains the flash? (any example of >>>>> how to?) >>>>> > >>>>> > > > > > Thanks >>>>> >>>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >>> >>> >>> >>> >>> >> > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
