What is happening here? Cuz I hav noooo clue, and been trying to figure it out for hours
Flash Version 8.0.0
Feel free to copy and paste this and try it out, Thanks for any help I can get!Code:class Tile { public var walkable:Boolean; public var frame:Number static var tile0, tile1, tileF:Object; public function Tile (id:Number) { var tile:Object = tileClass ("tile1"); walkable = tile.walkable; frame = tile.frame; trace(tile) //outputs undefined } static function tileClass (str:String) { tile0 = {walkable:true, frame:1} tile1 = {walkable:false, frame:2} tileF = {walkable:false, frame:20} trace (eval(str)); //outputs undefined trace (str); // outputs tile1 trace(str==="tile1");// outputs true trace (eval("tile1")); // outputs [object][object] return eval(str); } }






Reply With Quote
