Hello,

I try to import then control an external swf file.
I study the example (Penguin Animation ) from Pamela and when i
changed the command
 penguinMc().play() by penguinMc().gotoAndStop(1) it works.
But when i subsitute the penguin.swf use in this example by an other
one (picto1.swf) it doesnt work.

TypeError: Error #1009: Il est impossible d'accéder à la propriété ou
à la méthode d'une référence d'objet nul.
at <anonymous>()[/.../src/moncontroleswf.mxml:63]

Is due to the swf flash version ? picto1 is made with flash CS3 and
compiled in  v9 - AS2
If you want i put the swf file here :
http://demo.actigraph.com/flex/penguin.swf
http://demo.actigraph.com/flex/picto1.swf

I try to found example or demo or tutorial who explain the way to do
that but without success !

Thank you for your answer
Thierry

I try to simplify the example as below :

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
 <mx:UIComponent id="mapHolder" initialize="onHolderCreated(event);"
          resize="onHolderResized(event)" width="100%" height="100%"/>
  <mx:Script>
    <![CDATA[
    import com.google.maps.InfoWindowOptions;
        import com.google.maps.LatLng;
        import com.google.maps.LatLngBounds;
        import com.google.maps.Map;
        import com.google.maps.MapEvent;
        import com.google.maps.MapMoveEvent;
        import com.google.maps.overlays.Marker;
        import com.google.maps.overlays.MarkerOptions;
        import com.google.maps.interfaces.IPolyline;
        import com.google.maps.services.*;
        import com.google.maps.controls.MapTypeControl;
        import com.google.maps.MapType;
        import com.google.maps.controls.MapTypeControlOptions;
        import flash.display.*;
        import flash.display.MovieClip;
        import flash.net.URLRequest;
        import mx.controls.Alert;
        import mx.core.UIComponent;
        private var map:Map;
        private var loader:Loader;
        private var penguin:Marker;
        private var timer:Timer;
//
public function onHolderCreated(event:Event):void {
  this.map = new Map;
  this.map.key = "ABQIAAAA7QUChpcnvnmXxsjC7s1fCxQGj0PqsCtxKvarsoS-
iqLdqZSKfxTd7Xf-2rEc_PC9o8IsJde80Wnj4g";
  this.map.addEventListener(MapEvent.MAP_READY, onMapReady);
  mapHolder.addChild(map);
}
// Called whenever the map's containers are resized
public function onHolderResized(event:Event):void {
  this.map.setSize(new Point(mapHolder.width, mapHolder.height));
}
// Get the MovieClip instance of the swf file
private function monMc():MovieClip {
  return loader.content as MovieClip;
}
// Called when map is ready to be messed with
private function onMapReady(event:Event):void {
         map.setCenter(new LatLng(49.237988,-0.450445), 14,
MapType.HYBRID_MAP_TYPE);
  // Setup the loader to load the swf as a marker icon
  loader = new Loader();
  loader.contentLoaderInfo.addEventListener(
      Event.COMPLETE,
      function(event:Event):void {
        // Create the penguin marker
          var penguin:Marker = new Marker(map.getCenter(), new
MarkerOptions({draggable: true,icon: loader,iconAlignment:
(MarkerOptions.ALIGN_BOTTOM |
MarkerOptions.ALIGN_HORIZONTAL_CENTER)}));
          map.addOverlay(penguin);
          monMc().gotoAndStop(2); // <- works only with penguin.swf ?
      });
  // Load the external  swf
 // loader.load(new URLRequest("penguin.swf")); <- this works
  loader.load(new URLRequest("picto1.swf"));//<- this does'nt works
}
   ]]>
  </mx:Script>
</mx:Application>

--~--~---------~--~----~------------~-------~--~----~
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 google-maps-api-for-flash@googlegroups.com
To unsubscribe from this group, send email to 
google-maps-api-for-flash+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to