A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: I wonder if a "exist" function exists! (Flash 5)

Hybrid View

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Posts
    107

    I wonder if a "exist" function exists! (Flash 5)

    Hey guys. I'm just asking if there is a certain way to do this :

    If (_root.instancename EXISTS) [
    and blalbalbla
    ]

    Do you know a way to do this? I know perhaps it's stupid enough I just don't know it. Well thanks!

  2. #2
    Senior Member kendude's Avatar
    Join Date
    Sep 2003
    Location
    Hartford, CT USA
    Posts
    877
    use true or false
    code:

    if(playerAlive == true){
    //then do something...
    }
    //or
    if(playerAlive) {
    //this is the same as above
    }


    When the clip of whatever is attached, then a var turns true, when removed it turns false.

  3. #3
    Senior Member
    Join Date
    Oct 2002
    Posts
    107
    it works with objects too???

  4. #4
    Senior Member
    Join Date
    Oct 2002
    Posts
    107
    Ok nevermind I see what you mean. Thanks!

  5. #5
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    code:

    if(variable == undefined){
    //the variable doesnt exist yet
    }


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