A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: _visible = true/false ??

  1. #1
    Member
    Join Date
    Aug 2003
    Location
    over the rainbow
    Posts
    48

    _visible = true/false ??

    i'm making a fps where u have 2 shoot the enemy more than once 2 kill em. the way i did this was to make a movie clip of him and everytime tha button over the clip was pressed (shot), it would go2 the next frame with a different pic of the enemy (one of him w/ a bullet in his head). i also wanted to put a health bar over each enemy so u culd c how may more times u wuld have 2 shoot him 2 have him dead. but after i put them in the whole screen was 2 crowded. so now my idea was 2 only show the health of the enemy that ur mouse was over. what i did was to put in the health bars code(movie clip):


    Onclipevent (load) {
    _visible = false;
    }

    In the button that tell the enemy to advance 2 the next frame, i put the code(ehealth = enemy health bar{instance name}):

    On (rollOver) {
    ehealth = _visible = "true"
    }

    but that didnt work. then i tried:

    On (rollOver) {
    var ehealth
    _visible = "true"
    }

    didnt work either
    i'm confused about it. i know i have to use set variable 2 change the visiblity from false to true, but i cant figure owt how 2 tell (in the code) what thing 2 turn from false to true. ?? does anyone know how to solve this ??
    cant nobody take my pride, cant nobody hold me down; Oh No, i gotta keep on movin'

    <^>(0_o)<^>

    (8^)1-<

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Hmmm, I think this is going to confuse the flashplayer:

    Onclipevent (load) {
    _visible = false;
    }

    Not seeing the movie, it's hard to tell, but you might want to put that in the first frame:

    _root.ehralth._visible = false;//no "" marks

    You can also use _visible = 0; for false, or _visible = 1; for true

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center