Results 1 to 3 of 3

Thread: This is insane, i need help!

  1. #1
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default This is insane, i need help!

    Okay, im feeling that im getting good at as now, but this is just wierd
    im creating this shooting game, where you can upgrade your weapon
    so to test the function, i made 3 buttons, and a character who shoots.
    made all the codes, and told him to shoot bullet 1 when bullet1 variable is true and so on.

    but when i tell the button:
    on(release){
    _root.bullet1 == true;
    }

    the variable doesnt turn true. it stays false :S
    i dont understand anything now
    ive tried with one = to.

    what im i doing wrong?
    i thought i knew this by now : /

  2. #2
    Join Date
    Mar 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Resolved!
    needed to call the variables with _global

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    It's not necessarily wrong to be using _root or _global, but if you find yourself using it too much, it's probably indicative of larger problems in your code. It shouldn't cause trouble with your code, but it's important to understand what is implied by that keyword. This article by Grant Skinner explains the implications of _root (the same logic applies to _global.

Bookmarks

Posting Permissions

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