I'm new to AS3 and decided to make a simple drag&drop decor game just to get started. My problem is that I can't figure out on how to make another page of items when I click on the arrow; also navigating through the categories of items.
Here is a sample of the game SWF
One more question. I'm using this code for every item. Is there a way to make this code more compact instead of copying&pasting the code for every item?
var Clone1:MovieClip;
Ground01.addEventListener(MouseEvent.MOUSE_DOWN, GroundPressed);
function GroundPressed(event:MouseEvent):void
{
Clone1 = new ground01();
Clone1.x = 132;
Clone1.y = -123;
addChild(Clone1);
Clone1.startDrag();
Clone1.addEventListener(MouseEvent.MOUSE_DOWN,onClonedPlusPressed1);
}
function onClonedPlusPressed1(event:MouseEvent):void
{
Clone1 = MovieClip(event.currentTarget);
Clone1.startDrag();
}
stage.addEventListener(MouseEvent.MOUSE_UP, onStageReleased1);
function onStageReleased1(event:MouseEvent):void
{
if(Clone1 != null){
Clone1.stopDrag();
}
if(Clone1.hitTestObject(Trashcan)) {
removeChild(Clone1);
Clone1 = null;
}
}