Is there a way of telling a null value in the _droptarget property?
Basically I’ve got 9 draggable objects, and what I want them to do is if there is no _droptarget when you release the drag, flick back to it’s riginal position.
- Kit
Is there a way of telling a null value in the _droptarget property?
Basically I’ve got 9 draggable objects, and what I want them to do is if there is no _droptarget when you release the drag, flick back to it’s riginal position.
just use if/else statements. Remember that _droptarget returns “/target”.
let me know if you need additional help. Here is a sample:
on(press){
        this.startdrag();
}
on(release){
        this.stopdrag();
        drop=this._droptarget;
        if(drop=="/redsquare"){
                this._x=413.5;
                this._y=121.0;
        } else if(drop=="/bluesquare"){
                this._x=413.5;
                this._y=240.3;
        } else {
                this._x=170;
                this._y=170;
                }
}
“My name is Inigo Montoya. You killed my father. Prepare to die!”
Cheers. Just checked it against my own code, and I’d missed out a this. along the way. Argh. Don’t you just hate it when that happens?
:: Copyright KIRUPA 2024 //--