Setproperty

hi \rhere i go with another very basic question: \ri made a button called “bverde” - the name the button has on the library - and want to set its visibility to “0” \ri wrote the following action: \ron (release) { \rsetProperty ("_root.bverde", _visible, “0”); \r} \rbut it doesnt work at all, i mean, the button keeps visible in the main movie \rwhat am i doing wrong? \ri also tried with: \ron (release) { \rsetProperty (“bverde”, _visible, “0”); \r} \r\rthanks\r

you have to put the button inside a movieclip. then put this code on the button.\r\ron (release) {\r setProperty ("_root.bverde", _visible, “0”);\r}\r\rit worked for me. if you have questions ask away.

Yes,… Jubba is correct, even if he isn’t jubba.\r\ryou CANNOT target buttons.\r\rselect 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.\r\ropen 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.\r

hi\rthank you for helping\rdidnt work!\ri 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\rwhat am i doing wrong?

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.

I’ll try to post something in the morning about this, if you haven’t figured it out by then.\r\rFor 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.

hi again\rthanks to everybody trying to help me\rits too late here, so i’ll work it tomorrow, with the head more clear, ok?\rthanks again

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?

that’s it\rthe only thing is that once the buton gets invisible, doesnt work anymore - disapears forever\rthanks to everyone who helped me

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.

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.

you CANNOT target buttons.
Well, you can put that code to your button, and it works perfectly :

 on (press) {\r\r    setProperty (this, _visible, 0);\r\r}

Sorry guys.\rpom 0]

:slight_smile: you are so right POM

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).\r\rso … 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. ; )\r

****ed !\rpom 0]