I'm building a Tile Viewer in Adobe AIR and so far I have implemented the Drag and Drop function that allows the user to load PNG and JPG files.
The function returns a ':File' format, but how can i gram the ':Bitmap' data and place the image in an existing movieclip while looping and make that one tile image repeat in x and y so a preview of a tilemap will shown ?
my thought was to simply add instances of that one file, but i dont know the exact code for that. ( create a Loader, pass the File format to that, and get the BitmapData and place it in place by defining position x and y and also defining width and height. also i want to make instances, to the code doesnt load the image 10 x 10 times )
i would be glad for all helpfull answers.
Edit:
example theory:
( without correct syntax )
image = new ImageFromDropBox(); // bitmap or whatever
for( x = 0; x < 10; x++) {
for( y = 0; y < 10; y++) {
image.x = tilesize * x;
image.y = tileSize * y;
image.width = tileSize;
image.height = tileSize;
stage.addChild( image ); // so each of the 100 places images should be just instances of the ONE LOADED IMAGE
}
}