View Full Version : setproperty
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
Jesse
02-23-2002, 01:49 AM
You need to (re)read the instances tutorial. The library name doesn't come into play in setProperty.
hi
thanks for answering!
but i did read the tut and got confused because it says name instances apply to mc's, maynly
so, what can i do?
i forgot to say: in that tut they give a name to the instance using the instance window but when i get there i cant find a place to name my button...
Jesse
02-23-2002, 01:59 AM
If you want to set property on a button you have to put the button inside a movieclip.
hi again
i made an MC, put the button in it, and added the actionscript i mentioned, but got this message:
Scene=Scene 1, Layer=mc1, Frame=1: Line 1: Mouse events are permitted only for button instances
on (release) {
what is wrong now?
i getting very puzzled...
is that my actionscript has a mistake?
thanks for helping
FiZzIk
02-23-2002, 03:40 AM
This may be wrong as i am new to flash but i believe you have to edit the MC you put the button in and apply the actions to the button.
?
Billy T
02-23-2002, 04:52 AM
yeah
put your button in an mc and put that mc on the stage - give it an "instance" name of "myButtonMC"
then go inside your mc and give the button the action
on (release){
_root.myButtonMC._visible=false;
}
cheers
that's it
the only thing is that once the buton gets invisible, doesnt work anymore - disapears forever
thanks to everyone who helped me
Billy T
02-23-2002, 11:33 PM
??
so you want it to still work while its invisible or you want it to become visible again later in the movie.
if its the first then use this action instead
on (release){
_root.myButtonMC._alpha=0;
}
if its the later then make something else make it visible again (a frame, another button etc)
on (release){
_root.myButtonMC._visible=true;
}
cheers
hi
thanks for keeping helping
now i want two diferent things:
1) would like to have a button saying stop all sounds and that button, when clicked, would disapear and instead appear another button saying play sounds (and performing those actions)
2) the very first problem was this: i wanted a button (invisible) that had several actions in diferent states: play sounds, perform tasks and so on; but this i guess i can control exactly with the alpha = 0
what i cant still make is the case 1)... i think it has something to do with the "with" action, but cant figure that out
thanks again
Billy T
02-24-2002, 05:42 PM
make a 2 frame mc.
in the first frame put a button that stops all sounds and moves the mc to the second frame. In the second frame put a buttons that play the sound and moves the mc to the first frame
cheers
i cant get it...
i'm confused
i think i did what you said: made an animation, in layer one
in layer 2 put a sound
made an MC (which i put in layer 3) with 2 frames - in frame one i have a button with this code:
on (release) {
stopAllSounds ();
}
on (release) {
nextFrame ();
}
in frame 2 of the mc i put a button with this code:
on (release) {
play ();
}
on (release) {
prevFrame ();
}
when i test the movie the buttons dont work and keep jumping from one to another button...
can you explain where i'm doing wrong?
thanks a lot for helping!
Billy T
02-25-2002, 04:51 AM
see attached
cheers
hi again
just to thank you for your zip
it works perfectly in what i intent to do
and i discovered another way of doing it, with telltarget
its good to learn from various angles, but best of all its good to learn period
Please,
READ the manual. Takes time, but makes life a lot easier. I use the 'Flash 5 Bible'. That's a very good book that goes beyond the manual. It guides you from newbie to pro in an easy way. Your question wouldn't have been here when you'd read that.
www.flash5bible.com
Good luck!
Sckz
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.