I am using code to draw a line from one point to another when a button is released. Basically, this allows the user to drag the button and Flash will draw a line from the parent object to the button wherever the user places it. All I need to do is erase any previous lines that Flash created in the parent clip, so that there is only one line showing at any given time. Here is the code :
on(release) {
this.stopDrag();
thisPartner = String(this).toString();
thisPartner = thisPartner.substring(15, 16);
_global.partnerInfo(thisPartner);
_parent.lineStyle(1, 0x0000FF, 100);
_parent.moveTo(0, 0);
_parent.lineTo(this._x, this._y);
}
How can I remove the line I've created the next time the user releases the button? Do I have to place the line inside an empty movie clip and Create/Remove the clip everytime..? I was just hoping there was an easier way.
on(release) {
this.stopDrag();
thisPartner = String(this).toString();
thisPartner = thisPartner.substring(15, 16);
_global.partnerInfo(thisPartner);
_parent.lineStyle(1, 0x0000FF, 100);
_parent.moveTo(0, 0);
_parent.lineTo(this._x, this._y);
}
How can I remove the line I've created the next time the user releases the button? Do I have to place the line inside an empty movie clip and Create/Remove the clip everytime..? I was just hoping there was an easier way.