So, i can make a random map of sprites however when i try to attach a map to it it falls apart. Error codes galore. I did do it right a while ago however my computer crashed and now I can't remember how to do it. Any help would be greatly appreciated. Its a loop of two arrays but I just can't get the last line in it right connecting it to the map. Im using as3isolib and man, its driving me crazy. Here is the code for it. I do not know how to link it in proper formatting on here so yeah, I'm a newbie obviously. Thanks for anything you can do.
package AS
{
import as3isolib.display.IsoSprite;
import as3isolib.display.IsoView;
import as3isolib.display.primitive.IsoBox;
import as3isolib.display.scene.IsoGrid;
import as3isolib.display.scene.IsoScene;
import as3isolib.geom.IsoMath;
import as3isolib.geom.Pt;
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.KeyboardEvent;
[SWF(width = '800', height = '600', backgroundColor='#FFFFFF', frameRate='30')]
public class Main extends Sprite
{
private static const CELL_SIZE:Number = 50;
private var grid:IsoGrid;
private var scene:IsoScene;
private var view:IsoView;
var char:IsoSprite;
public function Main()
{
char = new IsoSprite();
char.setSize(60,60,60);
char.sprites = [Hero];
//var iso:IsoSprite = new IsoSprite;
//iso.setSize(50,50,50);;
//iso.sprites = [Wall];
grid = new IsoGrid();
grid.cellSize = CELL_SIZE;
grid.setGridSize(8,8,0);
stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDown);
scene = new IsoScene();
scene.addChild(grid);
scene.addChild(char);
/* var myMap:Array = [
[1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 1, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1]
];
*/
var iso:IsoSprite;
for(var i:int=0; i<8; i++)
{
for(var j:int=0; j<8; j++)
{
// THIS IS WHERE I AM HAVING ISSUES, ATTACHING IT TO THE MAP. NOT SURE HOW EXACTLY TO DO IT.
iso = new IsoSprite();
if (Math.random() >0.5)
iso.sprites = [Wall];
else
iso.sprites = [Floor];
iso.moveBy(j*50,i*50,0);
scene.addChild(iso);
}
}
scene.render();
view = new IsoView();
view.setSize(800, 600);
view.centerOnPt(new Pt(200,200,0));
view.addScene(scene);
addChild(view);
view.render();
}