Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button which makes itself invisible

Status
Not open for further replies.

minky

MIS
Sep 18, 2002
7
GB
can anyone help with creating a button that when pressed will make itself invisible and inactive, in other words clicking the button eliminates the button. can i use the tell target or set property commands to target an instance of the button? any suggestions greatfully recieved!
 
I have done this by putting the button inside a movie clip.

2 frames...in the first frame it is visible in the 2nd frame it is alpha=0 or no button at all...

A lot depends on what you want it to do. At what point do you want to make it visible again? Ya' Gotta Love It!:)X-)
 
By the way... Put a goto and stop function on your button in the 1st frame that takes your movie clip to frame 2. If you need more in depth help with this...post again.
Ya' Gotta Love It!:)X-)
 
thanks tulsajeff,
i am new to flash and am a little out of my depth in what you say [please excuse!]. let me explain what i want to do:

make a sheet of bubblewrap which you can pop.

i was thinking that a button which looks like an unburst bubble coould be placed over a burst bubble graphic so that when clicked the button would simply disappear to reveal the graphic below to simulate popping the bubblewrap.

if it can't be done as straight-forwardly as this, would you mind explaining your movie clip suggestion in more detail?
i assume that a movie clip here works in a similar way to a film loop in director, in that even if the timeline is confined to a single frame with coding the movie clip will play within that frame, so the clip plays even though the time line doesnt advance?
however in my novicery i cant seem to make a movie clip play at all, are there conditions [similar to the enable buttons or preview scene options] to see the clip? i pull a movie clip from the library into a new layer but it doesnt play as the movie plays.
i tend to jump in over my depth a little!
eagerly awaiting your response!

 
What about the graphic below? Would that in turn be another button or just a graphic standing there?

;-)
 
oldnewbie,
the graphic below doesnt need to do anything, it is an image of the end result [the popped bubblewrap] of 'popping' the button/movie clip above it. so it can just sit there.
 
As Tulsa said...

Create a new symbol, give it a button's behavior.
Design your graphic wrapping, basicly the same on up, over and down states, and a fill rectangle roughly the size of your desing on the hit state.
Make sure it will cover your below graphic.

Create another new symbol, give a movie clip's behavior.
Drag your button (from the library) in this movie clip. Set the action of the button (right click on the button) somewhat as follows:

on (press) {
setProperty ("/pop", _visible, "0");
}

Now go to the main movie (scene1), design your gum and from the library, drag the above movie clip (the wrapper movie clip) over your gum. Name this instance pop, or the name you used in the above button's actionscript.

You're done! Test the movie!
A press on the wrapping should make it dissapear!

;-)

Going out for supper... Hope you can make it through!
Will check in... but much later!
 
Looks to me like you could create a button inside a movie clip on the 1st frame. The button could be an un-popped bubble like you mentioned. the second frame of the movie clip would contain a graphic of the same size and location in a popped state.

the button on the 1st frame would contain the following action script

on (release) {
gotoAndStop (2);
}

put a stop action on bot frames as well

put about 20 of these on the page as your bubbles and go to town.

Ya' Gotta Love It!:)X-)
 
thankyou both!
it all seems to make sense now! i'll go and have a fiddle with your movie now jeff and let you both know how i get on later!
cheersx
 
tulsa/onb,
yup! that's the ticket. i'm now the proud owner of my first successful flash endeavor. :-9
some interesting things came up: onb, your step-by-step [thanks!] produced a button that i could only 'use' once, only the first of duplicate buttons disappeared. any ideas why?
i followed tulsa steps too, and replaced image in the 2nd frame of the movie clip with an aplha=0. this meant that the button could be used over and over, disappearing each time. horay! so then i could place some variations of the popped state under each button to make it a little more realistic.
i coded the button to work on press, so you can pop each bubble one at a time, but couldn't find a command that would allow subsequent buttons to be popped if they were rolled over during the first button's press [hope that makes sense!- i want to pop a bubble on press, but then holding that press and moving the mouse i want any other buttons i rollover to burst as well]. none of the options, rollover, drag over etc, really do that. any ideas?

i'm going to jazz up the media a bit then i'll post it up for you to have a gander!
cheers for your help guys,
off for a well earned |-I
 
In my case, you would probably have to change the instance name (pop1, pop2, etc) and change that button's action accordingly, referring to the right instance!

;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top