Uncaught exception - load.c(176) : Module not found : path
Error :
What am I doing wrong? I'm on Kubuntu if that matters
I have
Main.hx:
class Main extends Map {
static function main() {
var app:Main = new Main();
flash.Lib.current.addChild(app);
app.setSize(new flash.geom.Point(490,490));
}
public function new(){
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
}
class GMap extends Map {
static function main() {
var app:GMap = new GMap();
flash.Lib.current.addChild(app);
app.setSize(new flash.geom.Point(490,490));
}
public function new(){
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
}
Hi
Totally haxe n00b here, but....
When I run "haxe gmap.hxml" I get:
Uncaught exception - load.c(176) : Module not found : path
Error :
What am I doing wrong? I'm on Kubuntu if that matters
I have
Main.hx:
class Main extends Map {
static function main() {
var app:Main = new Main();
flash.Lib.current.addChild(app);
app.setSize(new flash.geom.Point(490,490));
}
public function new(){
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
}
private function onMapReady(event:MapEvent) {
setCenter(new LatLng(53.559889,10.038757), 14, MapType.NORMAL_MAP_TYPE);
setZoom(10,false);
}
}
gmap.hxml:
#
-swf gmap.swf
-lib googlemaps.swf
-main Main
-debug
-D network-sandbox
--flash-use-stage
--flash-strict
hehe
OKOK
copy the com directory to the project root
use -swf-lib not -lib
use -swf-version 9
viola
Now I just need to get the code working... but it compiles...
/morten
gaaaaaaaa
I can only get the backgroundcolor going... my own compiles haxe swf won't start...
If I use the one fron the demo, it works perfectly....
What am I doing wrong?
I have the following now, which compiles width: "haxe gmap.hxml" and creates "gmap.swf":
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.LatLng;
import com.google.maps.MapMouseEvent;
import com.google.maps.overlays.Marker;
import com.google.maps.overlays.MarkerOptions;
import com.google.maps.controls.ZoomControl;
import com.google.maps.controls.PositionControl;
import com.google.maps.controls.MapTypeControl;
---------------------------------------------------------------------------------------------------------------
GMap.hx:
class GMap extends Map {
static function main() {
var app:GMap = new GMap();
flash.Lib.current.addChild(app);
app.setSize(new flash.geom.Point(490,490));
}
public function new(){
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
}
private function onMapReady(event:MapEvent) {
setCenter(new LatLng(53.559889,10.038757), 14, MapType.NORMAL_MAP_TYPE);
setZoom(10,false);
addControl(new ZoomControl());
addControl(new PositionControl());
addControl(new MapTypeControl());
addEventListener(MapMouseEvent.CLICK, onMapClick);
}
private function onMapClick(event:MapMouseEvent) {
var marker : Marker = new Marker(event.latLng,new MarkerOptions({draggable: true}));
addOverlay(marker);
}
}
---------------------------------------------------------------------------------------------------------------
gmap.hxml:
#
-swf gmap.swf
-swf-version 9
-swf-lib googlemaps.swf
-main GMap.hx
-debug
-D network-sandbox
--flash-use-stage
--flash-strict
---------------------------------------------------------------------------------------------------------------
index.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/>
<title>GoogleMap in Flash with haxe</title>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div id="container"></div>
<script type="text/javascript">
var swf = new SWFObject( 'gmap.swf', 'gmap', '600', '500', 9, 'E5E5E5' );
swf.addParam( "allowScriptAccess", "always" );
swf.addVariable( "key", "ABQIAAAAURo17xMS8aKMaIKTp4OaSxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSmqxcw45qBUTZ2z77JW7r7YWM_iQ" );
swf.write( 'container' );
</script>
</body>
</html>
---------------------------------------------------------------------------------------------------------------
/morten
OK... rookie mistake.... again...
I unzippet the file map_flex_1_7a.swc and used that library.swf...
I needed to unzip map_1_7a.swc and use THAT library.swf....
Thx
/morten