|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
small change in question :)
hmmmm how can i do for example
if ("object._alpha == 80) { "some action" on a frame other than the frame containing the "object"? thanks, z00m Last edited by z00m : December 8th, 2003 at 05:48 PM. |
|
#2
|
|||
|
|||
|
Hi, are you sure your setting the button alpha correctly? I made what you said and it works for me. To test it I made the button alpha change from 80 to 100 each time the button itself is clicked i.e:
on (release) { if (_alpha == 100) { _alpha = 80; } else { _alpha = 100; } } and used the code you provided (minus the last closing brace): if (_root.button._alpha == 80) { textname.text = "something here"; } else { textname.text = "something else writen here"; } stop(); I added a stop command for my clip, maybe you dont need it. Have you double checked that you have actually called the button instance "button"? Know it's silly but you never know. |
|
#3
|
|||
|
|||
|
hi, sorry my bad, doesnt work forgot to test the text bit out. working on it now
|
|
#4
|
|||
|
|||
|
Here you go, I attached a demo clip. wowza that took me a while for no real reason!?
Break down of code is: on (release) { if (_root.thatbutton._alpha == 100) { _root.thatbutton._alpha = 80; } else { _root.thatbutton._alpha = 100; } } Added the code to change button alpha to the actual button, not sure how you do it but this worked for me. Had to set it by name as just _alpha set it for the whole clip (cept the text but thats normal with dyna text). trace(thatbutton._alpha); if (_root.thatbutton._alpha > 80) { textname.text = "more than 80"; } else { textname.text = "less than or equal to 80"; } This is in the first keyframe, i used two kf's in the clip. I used trace to show you what is happening. Flash doesnt always stick to the number you specify. Run the demo in flash to see what I mean, even the though I statically set the button to 80 the trace shows its alpha as 79.846whatever... By altering the if statement this is accounted for. |
|
#5
|
|||
|
|||
|
wow this forum rox
thank you very very much m8! |
|
#6
|
|||
|
|||
|
bah well my mistake :(
it still doesn't work...
i misexplained my self. i have 1 frame with 2 buttons one changes from _alpha 50 to alpha _100 and versa every time u click it the other button goes to frame 2, in frame 2 i have the action i've posted up there i want it to know when on frame 1 the button's alpha is what i've changed it too :\ if u can still help me so thanks again now i see the problem for sure is that the buttons are on a different frame, n e way to get over it? Last edited by z00m : December 8th, 2003 at 05:04 PM. |
|
#7
|
|||
|
|||
|
Hi, ok I modified the demo. Maybe that will be what your looking for. You've got to have the buttons instantiated when you try to read their properties, you may be trying to do the following which wont work:
you have both buttons in keyframe 1. You have no frames with the buttons after that. On a new layer (or the same layer but with a keyframe not including the buttons) in keyframe 2 you have the if statement you wrote. That wont work. You must have either a keyframe or a frame with the buttons on at the same point as you call the code, in this case the if statement. Maybe I'm wrong on this one, see what other people say. You could do this other ways without having to have the buttons around but you wouldnt be able to directly check their current status because they dont exist. You could get the buttons to set a variable when clicked that indicates their alpha. Then read that instead. dont see why but everyone has their reasons, right? Sorry if thats kind of rambling, im tired now. good luck |
|
#8
|
|||
|
|||
|
i am sitting here stunned from your guys replys....
u take the time to write me a huge answer... thank you very very much m8! |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > different actions with the same "button" |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|