Note that there are some explanatory texts on larger screens.

plurals
  1. POactionscript 3.0 type coercion error
    primarykey
    data
    text
    <p>I'm trying to move to another frame by clicking a movieclip. I have checked the frame name, etc, but it always gets an error like this whenever I tried to click my MovieClip. The application I made is combining google map with flash. So, when I click the movieclip, it should move to another frame containing google map.</p> <pre><code>TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@2675cf99 to flash.display.MovieClip. at startMap/movetoMap() </code></pre> <p>This is my code :</p> <pre><code>package { import flash.display.MovieClip; import flash.events.MouseEvent; import com.google.maps.*; import flash.geom.Point; import flash.events.Event; import com.google.maps.overlays.Marker; import com.google.maps.services.ClientGeocoder; import com.google.maps.services.GeocodingEvent; public class startMap extends MovieClip { var gMap : Map = new Map(); public function startMap() { this.x = 700; this.y = 150; this.scaleX = 0.5; this.scaleY = 0.5; this.addEventListener(MouseEvent.CLICK, movetoMap); } function movetoMap (e : MouseEvent) { //I think this is where the error took place... MovieClip(this.parent).gotoAndStop("mymap"); // move to another frame //the code below is for the next frame //trace ("initiating map"); /* gMap.key = "ABQIAAAAkvJLDXCdl31EuFDEitKQ6hTDVs7mYo4hdRoqkWYrrPdtz_Eb9RRJP9mw3bPiboGSX4c0stQsYo4aPQ"; gMap.sensor = "true"; gMap.x = 100; gMap.y = 50; gMap.setSize(new Point(stage.width - 200, stage.height - 100)); gMap.addEventListener(MapEvent.MAP_READY, prepareMap); gMap.addEventListener(MapMouseEvent.CLICK, showPoint); stage.addChild (gMap); */ } /* function prepareMap (e : Event) { doGeoCode ("Jakarta, Indonesia"); } function showPoint (e : MapMouseEvent) { var revGeoCode : ClientGeocoder = new ClientGeocoder(); revGeoCode.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, function markPlace (e : GeocodingEvent) { var place : Array = e.response.placemarks; var marker : Marker = new Marker (place[0].point); gMap.addOverlay(marker); gMap.setZoom(8, true); gMap.setCenter (marker.getLatLng()); marker.addEventListener(MapMouseEvent.CLICK, function showInfo(e : MapMouseEvent){ gMap.openInfoWindow(marker.getLatLng(), new InfoWindowOptions ({title:"Welcome to", content:place[0].address})); }); }); revGeoCode.addEventListener(GeocodingEvent.GEOCODING_FAILURE, function addFailure(e : GeocodingEvent){ trace ('fail to geocode'); }); revGeoCode.reverseGeocode(e.latLng); } function doGeoCode (placeName : String) { var placeInfo : ClientGeocoder = new ClientGeocoder(); placeInfo.addEventListener(GeocodingEvent.GEOCODING_SUCCESS, function addInfo(e : GeocodingEvent){ var place : Array = e.response.placemarks; var mark : Marker = new Marker (place[0].point); gMap.setCenter(mark.getLatLng()); gMap.setZoom(8, true); gMap.addOverlay(mark); mark.addEventListener(MapMouseEvent.CLICK, function setPlaceInfo (e : MapMouseEvent){ gMap.openInfoWindow(place[0].point, new InfoWindowOptions ({title:"Welcome to", content:place[0].address})); }); }); placeInfo.addEventListener(GeocodingEvent.GEOCODING_FAILURE, function addFailure(e : GeocodingEvent){ trace ('fail to geocode'); }); placeInfo.geocode(placeName); } */ } </code></pre> <p>}</p> <p>THX before for any help provided....</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload