# Simple 2 line code help please

**URL:** https://forum.kirupa.com/t/simple-2-line-code-help-please/27854
**Category:** Uncategorized
**Created:** [August 7, 2003, 7:50am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854 "2003-08-07T07:50:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jefferson](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@Jefferson](https://forum.kirupa.com/u/Jefferson)
#### Post date: [August 7, 2003, 7:50am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854/1 "2003-08-07T07:50:56Z")

</div>

im new…and uneducated. im making an image able to drag and drop, all thats fine and dandy, but i want to close it once clicking a button attached to the image. the image name right now is called appear. so the drag and drop code goes as

on (press, dragOver) {  
startDrag(\_root.appear);  
}  
on (release, rollOut, dragOut) {  
stopDrag();  
}

now to make a button thats able to close the image and attach it to this item, what code would go with it?  
my work would go

on (press, release) {  
clear.Appear  
}

doesnt work, because im new to writing actionscript i dont know the right code. please help if possible

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 7, 2003, 8:02am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854/2 "2003-08-07T08:02:50Z")

</div>

put your close button outside of the drag and drop area (as in over it, and not inside it). That way your close button will be active at all times. Otherwise, the drag is always active, so they never get to “press” the close button.

Good luck.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 7, 2003, 8:05am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854/3 "2003-08-07T08:05:00Z")

</div>

but than how can i get it to group with the image and follow it around? if its in a new layer i dont believe you can group the two. that and i already do have the seperate button made with that code. its just not closing.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 7, 2003, 8:27am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854/4 "2003-08-07T08:27:27Z")

</div>

please help, right now im working with  
on (press) {  
stop.appear  
}  
on( release) {  
exit.appear;  
}

whats the proper code for the close image? would it be exit? clear? something other. ive tried going through all the different syntaxes provided, i couldnt seem to find the one needed.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 7, 2003, 8:37am UTC](https://forum.kirupa.com/t/simple-2-line-code-help-please/27854/5 "2003-08-07T08:37:27Z")

</div>

Iammontoya wasnt’ saying that the close button should be outside of the movieclip that is being dragged, just that it should be on the top layer of that movie clip.

It might help if you could attach the FLA file that you’re working on to your post.
