PDA

View Full Version : Symbol's Visibility Determined by Variable



The Other Mike G
June 10th, 2002, 09:08 AM
Okay I'm going to take a new approach on the problem I'm having...

Let's say I have three symbols (whether they are movie clips or graphics, I'm not sure yet, but let's assume they're movie clips). Okay three movie clips, each is 5 frames of animation. The clips are named bugs1, bugs2, and bugs3.

Okay, now I have a variable named bugsvalue. Here's what I want to do:

If bugsvalue == 1, I want bugs1 to appear on the screen. If bugsvalue == 2, I want bugs2 to appear on the screen. And if bugsvalue == 3, I want bugs3 to appear on the screen.

There's two ways I think this can work, but logistically don't know if either one will work. We can have all 3 on the screen, but have their visibility set to 0. When the variable is equal to their value, their visibility is set to 100 and they appear. I don't like this approach because it's means having all three on the screen, which increases demand on the computer.

The other way to do it is to have none of them on the screen. Then when their variable is equal, have the clip actually appear and then when the variable isn't equal anymore, to have that clip disappear.

If this is confusing, is there a way I can provide a .FLA so perhaps you can see what I want to happen?

All movie clips are in the library, but I don't know how to call something from the library to appear on the stage, and then disappear again when I don't need it on the screen anymore. Any and all advice would be great, thanks!

ilyaslamasse
June 10th, 2002, 10:05 AM
You have to use the attachMovie function. You can see how it works in the tute drawing board in FLash 5.

Lastly, it will be a lot easier if you work with Flash MX.

pom 0]

Iammontoya
June 11th, 2002, 10:24 PM
totally agree..

yeah.. and visibility is 1 or 0, as in ON or OFF. _alpha values are 0 through 100.