PDA

View Full Version : setproperty



rs2002
February 22nd, 2002, 08:37 PM
hi
here i go with another very basic question:
i made a button called "bverde" - the name the button has on the library - and want to set its visibility to "0"
i wrote the following action:
on (release) {
setProperty ("_root.bverde", _visible, "0");
}
but it doesnt work at all, i mean, the button keeps visible in the main movie
what am i doing wrong?
i also tried with:
on (release) {
setProperty ("bverde", _visible, "0");
}

thanks

I am not Jubba
February 22nd, 2002, 10:14 PM
you have to put the button inside a movieclip. then put this code on the button.

on (release) {
setProperty ("_root.bverde", _visible, "0");
}

it worked for me. if you have questions ask away.

upuaut8
February 22nd, 2002, 10:38 PM
Yes,.. Jubba is correct, even if he isn't jubba.

you CANNOT target buttons.

select the button. Hit F8, select Movie clip from the popup. You can name it here as well, but this name, in this popup, is not relivant.

open the "instance" panel. With this new movie clip selected, type in a name in the "instance" panel. This is the instance name, and the one you use for targeting in Flash.

rs2002
February 22nd, 2002, 10:41 PM
hi
thank you for helping
didnt work!
i made a new film, made a button, made a MC, put the button in the mc, pasted the code to the button action and put the mc on a layer on the main movie, but the button is visible
what am i doing wrong?

I am not Jubba
February 22nd, 2002, 10:55 PM
you have to give the movie clip an instance name "bverde" without the quotes. select the movieclip on the main stage and press CONTROL+I then in the name box type "bverde" then it will work.

upuaut8
February 22nd, 2002, 10:57 PM
I'll try to post something in the morning about this, if you haven't figured it out by then.

For now, all I can suggest is that you have not named the "instance" name of the movie clip. Remember that the name of a Movie clip in the library is irrelivant for the purposes of targeting. You must open the instance panel, and with that object selected on the stage, place a name in that panel for the object.

rs2002
February 22nd, 2002, 11:15 PM
hi again
thanks to everybody trying to help me
its too late here, so i'll work it tomorrow, with the head more clear, ok?
thanks again

I am not Jubba
February 22nd, 2002, 11:27 PM
i think thats the problem since he(she, it) said that the name in the library was bverde. just doesn't understand instances. i think thats difficult to explain too, but once you get it, you get it...get it?

rs2002
February 23rd, 2002, 12:15 PM
that's it
the only thing is that once the buton gets invisible, doesnt work anymore - disapears forever
thanks to everyone who helped me

I am not Jubba
February 23rd, 2002, 01:04 PM
well wut kind of situation are you using it in? cuz then you can make it reappear. I can help if you tell me how you're using it.

upuaut8
February 24th, 2002, 12:47 PM
If the button is inside a movie clip and you're making that movie clip _visible=false, then you are correct, it will disapear unless you have some other action set to make it _visible=true again.

ilyaslamasse
February 24th, 2002, 01:17 PM
you CANNOT target buttons.Well, you can put that code to your button, and it works perfectly :
on (press) {

setProperty (this, _visible, 0);

}Sorry guys.
pom 0]

upuaut8
March 22nd, 2002, 06:58 PM
:) you are so right POM

suprabeener
April 18th, 2002, 10:11 PM
in flash mx, you can target buttons (hooray!), although they still default to the movie that they're in's namespace ("this" refer's to the movie it's in).

so ... ily's code will make whatever movie the button's in invisible, if you tested it by quickly creating a button and cut and pasting the code in, congratualtions, you made _root invisible. ; )

ilyaslamasse
April 28th, 2002, 11:04 AM
****ed !
pom 0]