I'm currently working on a game where i'm going to have to select an actor and place him on somewhere on the screen. what i'm trying to do is select the actor/sprite and then touch a spot on the screen and the sprite will move to where i just touched. Currently in my code when you touch the sprite it just moves in a random spot. Here's the code
public MyActor(){
        setBounds(sprite.getX(),sprite.getY(),sprite.getWidth(),sprite.getHeight());
        setTouchable(Touchable.enabled);

        addListener(new InputListener(){
            @Override
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
                MoveByAction mba = new MoveByAction();
                mba.setAmount(x,y);
                MyActor.this.addAction(mba);
                return true;
            }


        });
    }

    @Override
    protected void positionChanged() {
        sprite.setPosition(getX(),getY());
        super.positionChanged();
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
       sprite.draw(batch);
    }
    @Override
    public void act(float delta){
        super.act(delta);
    }