flash question
- Started
- Last post
- 14 Responses
- ufreqr
trying to set an if statement up for a movie clip that says if var = true then on release get URL, flash doesn't seem to like this idea. Can anyone offer any advice. Basically I don't want the movie clip to be a hyperlink unless the variable is set to true.
- kpl0
switch it around: it's on (release) on the outside, then the if statement in the block.
- kpl0
and once a button, always a button. you can't set a button to turn itself off. but you can set a button to do nothing.
- ufreqr0
cheers kpl, I am trying to something smiliar to this site - anyideas how this has been done? http://www33.brinkster.com/savas…
- kpl0
most likely with a movie clip under a invisible button. the button tells the clip to play forwards or backwards, or to stop depending if the mouse is over it or not. if clicked, it tells the clip to go to 80% alpha or something like that.
- ufreqr0
sorry to be a bit thick, but what about the dates that have no record, wouldn't they show as links as you move over them?
- kpl0
I don't believe there is a button on those dates... the outlinse are just drawn in and the color is the only things in the button/movie clip combo. otherwise the cursor would turn into a hand.
- ufreqr0
but if it's not possible to determine using actionscript whether each day is a link or not then this guy can't be doing it dynamically?
- kpl0
you kinda lost me there...
the way I'm sure the flash works is that the grid is premade and is a single image. The button outlines are not actually part of a button, but have been predrawn on a separate layer.
On dates that have content, a movie clip w/ accompanying button is placed where the lines are. buttons/movie clips can be created and placed via actionscript or placed manually by hand. either way, they can be positions exactly within the borders of the button outlines.
in other words, the appearance of a button is separated from the button symbol.
- ufreqr0
kpl thanks very much for your help I'm with you.... i think. So I have to work out how to create a button instance dependant on the value of the variable right?
just been looking at your work, very impressed!
- kpl0
yep. a script should be able to look at variables and create and place the buttons as needed. probably want to do duplicatemovieclip() a bunch of times, with the button inside the mc being duplicated.
thanks for your comments...
- shant0
Make one movie clip, with your little date or link or button in the first frame.
In frame one make it look like the button when it's not clickable, in frame 2, make it have the actual button.
Copy and paste them all you like, over and over, and the ones you want to be active, make them go to frame 2 on load.
- autonoma0
Actually, you CAN turn a button off kpl, as long as you are using Flash MX..
With an if statement, you can do something like this:
if (!myVariable) {
myButton.enabled = false;
} else {
myButton.enabled = true;
}
- rh0
Don't forget that when checking for an equality you need to use ==.
Single = is used for setting variables.
- billyFUN0
You can turn a button off in flash 5 as well, by placing it in a movieClip and setting that movieClip's _visible property to false.