#include "config.txt"
var tTiles = terrainTiles; // from config.txt
var tPath = terrainPath; // from config.txt
var fType = FileType; // from config.txt
var selectedTile:String;
// loading stuff
function loadImages(imageNum, imageLocation, fileType) {
var imageList = Array();
var images:MovieClip = this.createEmptyMovieClip("images", this.getNextHighestDepth());
for (var i=1; i<= imageNum; ++i) {
imageList.push(imageLocation+i+fileType);
}
for (var i=1; i <= imageNum; ++i) {
images.createEmptyMovieClip("t"+i, i);
images["t"+i].createEmptyMovieClip("e"+i, i);
images["t"+i]["e"+i].loadMovie(imageList[i-1]);
images["t"+i]._alpha = 50;
images["t"+i].onRollOver = function() { this._alpha = 100; }
images["t"+i].onRollOut = function () { fadeOut(this); }
images["t"+i].onPress = function () { tileSelect(this); trace(selectedTile); }
}
return images;
}
var images:MovieClip = loadImages(tTiles, tPath, fType);
function tileSelect(tile) {
currentTileBox.removeMovieClip();
currentTileBox.duplicateMovieClip(images.tile, tile+"sel", currentTileBox.getNextHighestDepth());
currentTileBox.attachMovie(tile+"sel", "tile selection", currentTileBox.getNextHighestDepth(), {_width:2, _height:2});
selectedTile = tile._name;
}
I can trace the current selection no problem but the selected tile does not duplicate and embed itself into the currentTileBox. I know the problem lies within the tileSelect function. Perhaps scoping issue? Am I referring everything correctly?
If it aids at all, this is what I am working on:
http://www.student.cs.uwaterloo.ca/~bbobnis/
Thanks in advance,
decumbo