# Removing buttons

**URL:** <https://forum.kirupa.com/t/removing-buttons/24164>\
**Category:** flash\
**Created:** [June 26, 2003, 7:50pm UTC](https://forum.kirupa.com/t/removing-buttons/24164 "2003-06-26T19:50:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![elion](https://avatars.discourse-cdn.com/v4/letter/e/4491bb/32.png) [@elion](https://forum.kirupa.com/u/elion)\
**Post date:** [June 26, 2003, 7:50pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/1 "2003-06-26T19:50:01Z")

</div>

When a button is pressed, it activates a movie clip and tells the clip to play. After the button is pressed, I want it to… delete itself or something, just so its no longer there. (That, or I want after the movie clip reaches the end, it would delete itself).

---

<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:** [June 26, 2003, 7:56pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/2 "2003-06-26T19:56:40Z")

</div>

The easiest way would be this script:

```auto
on (release){
this._visible = false;
}

```

---

<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:** [June 26, 2003, 8:02pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/3 "2003-06-26T20:02:06Z")

</div>

It makes everything dissapear… ☹

---

<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:** [June 26, 2003, 8:04pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/4 "2003-06-26T20:04:16Z")

</div>

Did you apply it to the button? It should only make the button disappear.

---

<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:** [June 26, 2003, 8:09pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/5 "2003-06-26T20:09:15Z")

</div>

Could the fact that theres other scripting in it effect it?

on (release) {  
tellTarget(\_root.head) {  
gotoAndPlay(41);  
}  
this.\_visible = false;  
}

---

<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:** [June 26, 2003, 8:11pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/6 "2003-06-26T20:11:19Z")

</div>

Try this:[AS]on (release) {  
this.blah.\_visible = false;  
tellTarget (\_root.head) {  
gotoAndPlay(41);  
}  
}  
[/AS]

blah would be the instance name of that button.

---

<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:** [June 26, 2003, 8:15pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/7 "2003-06-26T20:15:21Z")

</div>

> \*Originally posted by FireDrake101 \*  
> \*\*Could the fact that theres other scripting in it effect it?

on (release) {  
tellTarget(\_root.head) {  
gotoAndPlay(41);  
}  
this.\_visible = false;  
} \*\*

[AS]on (release) {  
\_root.head.gotoAndPlay (41);  
\_root.intance of your button.\_visible = false;  
} [/AS]

that’s smaller, and correcter!

---

<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:** [June 26, 2003, 8:16pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/8 "2003-06-26T20:16:13Z")

</div>

haha that’s the same thing I posted. 😛

---

<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:** [June 26, 2003, 8:16pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/9 "2003-06-26T20:16:37Z")

</div>

Four minutes between our posts

---

<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:** [June 26, 2003, 8:17pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/10 "2003-06-26T20:17:47Z")

</div>

aaargh, stop it electron… 😛 😉

---

<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:** [June 26, 2003, 8:18pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/11 "2003-06-26T20:18:36Z")

</div>

I win, whoohow… 😉

---

<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:** [June 26, 2003, 8:25pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/12 "2003-06-26T20:25:47Z")

</div>

Actually Didius did win EG…lol.

tellTarget is old and not used anymore.

And you can’t us “this” on a button clip otherwise it acts as a global property and makes everything in that timeline invisible (if using \_visible = false that is) so you need to target it’s instance name.

HOWEVER, as Didius used \_root, that is not wise because it may cause complications if this movie gets loaded into another movie.

In that case this should suffice…

[AS]on (release) {  
head.gotoAndPlay (41);  
buttonInstanceName.\_visible = false;  
}[/AS]

Of course that assumes the head clip is on the same timeline as your button.

---

<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:** [June 26, 2003, 8:38pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/13 "2003-06-26T20:38:27Z")

</div>

Ello,

Well if you really wanted to ‘Delete’ your button, can’t see why but you could do it this way.

Make your button, put it into a movieClip. Then on watever frame of your main timeline using the attachMove method you can retrieve the movie clips that contain the buttons from the library, place them where you want.

Then to take them away you use the removeMovieClip method. This will take the button (which is in a movieClip remember) off the stage.

Viru.

---

<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:** [June 26, 2003, 8:39pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/14 "2003-06-26T20:39:19Z")

</div>

What do you mean by tellTarget is old and unused? I use it… ☹

---

<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:** [June 26, 2003, 8:41pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/15 "2003-06-26T20:41:02Z")

</div>

Flash 4 and 5 used it. Its not obhect oriented like flash MX’s actionscript is.

You can still use it but its not ‘good’ coding practice. Java rules!!

Viru.

---

<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:** [June 26, 2003, 8:41pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/16 "2003-06-26T20:41:12Z")

</div>

Another good method k02n, I was operating under the assumption of him possibly wanting to bring the button back at some time (so he could set \_visble to true and voila, done), but if the button is going to be completely deleted and done with then your method is good as well.

---

<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:** [June 26, 2003, 8:42pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/17 "2003-06-26T20:42:45Z")

</div>

> \*Originally posted by kO2n \*  
> \*\*Flash 4 and 5 used it. Its not obhect oriented like flash MX’s actionscript is.

You can still use it but its not ‘good’ coding practice. Java rules!!

Viru. \*\*

Flash 5 still used it, but I have no clue why since it had the dot syntax method implemented… I never really understood why it was still standard practice in Flash 5 to use tellTarget and setProperty :-\ I don’t know, I started flashing after Flash 5 so maybe I missed something then.

And I hear Java rules… I want to learn Java… :drools:

---

<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:** [June 26, 2003, 8:43pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/18 "2003-06-26T20:43:05Z")

</div>

Yup, thats why i mentioned i couldnt see why he’d want to ‘delete’ the button at all. So your answer was the one he wanted.

Viru

---

<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:** [June 26, 2003, 8:46pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/19 "2003-06-26T20:46:13Z")

</div>

Well in Flash 5 the dot syntax was just a syntax. It was just an ‘old’ style programming way. Flash MX has incorporated as I said before an ‘Object Oriented’ programming style. This sort of programming is more efficient and can in some situations making solving a problem more intuitive and easier. I wont go to deep into cos I had a year of the ‘fundementals’ of Java…zzzzzz. Haha

Viru.

---

<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:** [June 26, 2003, 8:58pm UTC](https://forum.kirupa.com/t/removing-buttons/24164/20 "2003-06-26T20:58:28Z")

</div>

Thanks for the info, but I think I am still confused.

Flash 4 and lower used the old style called “slash syntax”, Flash 5 was the first to incorporate the new “dot syntax” where you could do “clip.property = something” and whatnot.

Was the dot syntax in Flash 5 just experimental/work in progress and that is why the old slash syntax was still considered for normal use?

And don’t worry about boring me, I am an avid coder and I enjoy learning new things. Unfortunately though, I jumped into the Flash game a bit late so I missed a lot of the past stuff, which has it’s advantages and disadvantages.

[Next page](https://forum.kirupa.com/t/removing-buttons/24164.md?page=2)
