A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Game actioscript help

Hybrid View

  1. #1
    Pack ******
    Join Date
    Aug 2008
    Posts
    5

    resolved [RESOLVED] Game actioscript help

    Im trying to make a game 4 my dad but it doesn't work as i want it to. grr

    Its supposed to go back to the beginning when you crash into a asteroid but it doesnt
    heres what ive done w/ the code

    Code:
    Asteroid 
    
    onClipEvent (enterFrame) { if (this.hitTest(_root.player_mc)) {  this._alpha = 50;  
    crash = "true"; } }
    
    
    
    
    frame 2
    
    if (crash = true) {
    gotoAndStop(1);
    }
    I dont know how to monitor true/false so i dont know if it is setting the variable. But i kno that the asteroid has been hit because it fades out...
    Please
    help
    anything would be increndilby aprecciated

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    8
    if (crash == true)
    Use single = when setting stuff, use double = if you comparing values, use triple = when comparing value and type

    and if crash is a boolean and not a string, you can leave out the quotes. crash = true; instead of "true"

    btw this seems to be AS2 and not AS3 (_alpha, _root is non existent in AS3, use alpha and root instead without the _)
    Last edited by Jareish; 08-13-2008 at 08:46 AM.

  3. #3
    Pack ******
    Join Date
    Aug 2008
    Posts
    5

    resolved Ty

    Thank you

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