in my current project i use ogmo ,but after all its a xml file that should be exported from ogmo also …so here is how i do it …maybe u can see similarities and adapt it
protected var map:Entity;
protected var miniMap:Entity;
protected var bubbles_:Bubble = new Bubble(FP.camera.x + 10, FP.camera.y + 20);
protected var mapGrid:Grid;
protected var mapImage:Graphic;
protected var mapMiniGrid:Grid;
protected var mapMiniImage:Graphic;
protected var mapMiniWall:Entity;
protected var mapData:Class;
protected var mapWall:Entity;
protected var mapSpikes:Entity;
public function Level(mapData:Class = null)
{
//backdrops
eCloseBackdrop = new Backdrops(0, 15,"close background");
add(eCloseBackdrop);
eFarBackdrop = new Backdrops(0, 15,"far background");
add(eFarBackdrop);
this.mapData = mapData;
loadMap(mapData);
//normal map
mapImage = null; //new Image(mapGrid.data);
map = new Entity(0, 0, mapImage, mapGrid);
map.layer = 0;
map.mask = mapGrid;
map.type = "solid";
//mini map
mapMiniImage = null; //new Image(mapMiniGrid.data);
miniMap = new Entity(0, 0, mapMiniImage, mapMiniGrid);
miniMap.layer = 0;
miniMap.mask = mapMiniGrid;
miniMap.type = "solid";
}
protected function loadMap(mapData:Class):void
{
var mapXML:XML = FP.getXML(mapData);
mapWidth = mapXML.@width;
mapHeight = mapXML.@height;
whereTele = mapXML.@whereTele;
//tilemap and grids
tileMapAndGrids(mapXML);
}
private function tileMapAndGrids(mapXML:XML):void
{
var node:XML;
//normal grid
mapGrid = new Grid(uint(mapXML.@width), uint(mapXML.@height), 36, 36, 0, 0);
mapGrid.loadFromString(String(mapXML.Grid), "", "\n");
//normal tilesmap
if (String(mapXML.TileSet).length > 0)
{
var wallW1:Tilemap = new Tilemap(E.WORLD1IMG, mapGrid.width, mapGrid.height, 36, 36);
wallW1.loadFromString(mapXML.TileSet, ",", "\n");
mapWall = new Entity(0, 0, wallW1, mapGrid);
add(mapWall);
}
//mini grids
mapMiniGrid = new Grid(uint(mapXML.@width), uint(mapXML.@height), 24, 18, 0, 0);
mapMiniGrid.loadFromString(String(mapXML.black), "", "\n");
//mini tilemap
if (String(mapXML.SmlTile).length > 0)
{
var wallMiniW1:Tilemap = new Tilemap(E.WORLD1LILIMG, mapMiniGrid.width, mapMiniGrid.height, 24, 18);
wallMiniW1.loadFromString(mapXML.SmlTile, ",", "\n");
mapMiniWall = new Entity(0, 0, wallMiniW1, mapMiniGrid);
add(mapMiniWall);
}
//spikes tilemap
if (String(mapXML.spikeset).length > 0)
{
var spikes_:Tilemap = new Tilemap(E.SPIKESMAP, mapGrid.width, mapGrid.height, 36, 36);
spikes_.loadFromString(mapXML.spikeset, ",", "\n");
mapSpikes = new Entity(0, 0, spikes_, mapGrid);
add(mapSpikes);
}
}
U wont see embeds cause i embed the xml file and images in a class called E so everywhere u will see E.BlahBlah that means it was embed and i call it from E