I have designed a basic inventory system for a point and click game I’m working on. Its pretty straight forward atm, see below:
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.*;
public class InventoryAccess extends MovieClip {
private var _inventoryI = new Interface();
private var _itemsInDisplay:Array;
private var _fishPaste = new FishPasteInv();
public function InventoryAccess() {
_itemsInDisplay = new Array();
addChild(_inventoryI);
}
public function updater(MC:String) {
switch(MC) {
case "fish paste" :
_itemsInDisplay.push(_fishPaste);
updating(_itemsInDisplay);
break;
}
}
private function updating(arrayOfItems:Array) {
for (var i:int=0;i<arrayOfItems.length;i++) {
addChild(arrayOfItems*);
}
}
}
}
‘updater’ is a function that can be accessed from outside the AS file, i.e. when object is picked up file.updater… through tracing i have found out that all the functions are being executed but the object just isn’t being added to the screen :S Any help would be greatly appreciated, thanks.