Click and Drag issue (beginner)
Hello, so I have a really simple program where I'd like the user to be able to drag the statue object, and place it on top of a pedestal. I started with the click and drag, but the code didn't work when I used it. I tried using the direct code snippets code, and that didn't work either. After putting a trace in the click function, I found that it wasn't being called. They are named the same, and the mouse_up function was working properly, so I'm not sure what the problem is. Any help would be greatly appreciated~
Here's the code, the important bits are bolded. I am recieving no other errors~
package
{
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class retry extends flash.display.MovieClip
{
var rightIsPressed:Boolean = false;
public function retry()
{
//add drag listeners
trace("it's working");
//make the instructions invisible
controlText.alpha = 0;
//call event listeners
nextBtn.addEventListener(MouseEvent.CLICK, seeManga);
startBtn.addEventListener(MouseEvent.CLICK, beginManga);
controlText.addEventListener(MouseEvent.MOUSE_OVER, showText);
controlText.addEventListener(MouseEvent.MOUSE_OUT, hideText);
walkinganimation.addEventListener(Event.ENTER_FRAME, fl_MoveInDirectionOfKey_3);
stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_SetKeyPressed_3);
stage.addEventListener(KeyboardEvent.KEY_UP, fl_UnsetKeyPressed_3);
statue.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
statue.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
}
function fl_ClickToDrag(event:MouseEvent)
{
var object = (event.currentTarget);
object.startDrag();
}
function fl_ReleaseToDrop(event:MouseEvent)
{
var object = (event.currentTarget;)
object.stopDrag();
}
//begin functions
function showText(event:MouseEvent)
{
trace("mouse in");
controlText.alpha = 1;
}
function hideText(event:MouseEvent)
{
trace("mouse out");
controlText.alpha = 0;
}
function beginManga(event:MouseEvent)
{
gotoAndStop(2);
}
function seeManga(event:MouseEvent)
{
trace("2nd button");
nextFrame();
}
function fl_MoveInDirectionOfKey_3(event:Event)
{
if (rightIsPressed)
{
trace("keyboard pressed");
walkinganimation.gotoAndStop(2);
foreground.x -= 3.5;
text1.x -= 2;
text2.x -= 2;
text3.x -= 2;
text4.x -= 2;
pedastal.x -= 3.0;
statue.x-=3.0;
}
}
function fl_SetKeyPressed_3(event:KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.RIGHT :
{
rightIsPressed = true;
break;
}
}
}
function fl_UnsetKeyPressed_3(event:KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.RIGHT :
{
rightIsPressed = false;
walkinganimation.gotoAndStop(1);
break;
}
}
}
}
}