how to use droptarget in AS3?

1.2k views Asked by At

I need to convert this AS2 code to AS3.

on (release)
 {

    stopDrag();
    this.MOR1.zzz.gotoAndStop(1);

    if (this._droptarget == "/lcd5") {

        this.MOR1.zzz.shekl.gotoAndStop(1);
        _root.nor.gotoAndStop(3);
    } else {

        this.MOR1.zzz.shekl.gotoAndStop(4);
        _root.nor.gotoAndStop(2);
    }

    if (this._droptarget == "/lcd1") {

        setProperty(this, _x, -731.7);
        setProperty(this, _y, 626.4);
    }
}

Please help me. Thank you...

1

There are 1 answers

0
CodeMouse92 On

First off, you're going to need to start using event listeners.

Now to the main issue. dropTarget appeared to stop working in an update recently. I'm not entirely sure why.

Thus, you're going to need to change approach. Instead of droptarget, use one of the following...

I recommend hitTestPoint() out of the three, but the final decision is up to you.