A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How do I make multiple condition things?

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    5

    How do I make multiple condition things?

    Hello, I have encountered a small error here. Im sure its something obvious but I can't figure out what I am doing wrong. Basicly I want it so when you are in a certain area and press 'e' you can access a purchase terminal on my game.

    This is the code, it currently it brings up an error message.

    onClipEvent (enterFrame) {
    if (Key.isDown(69)){ and if (this.hitTest(_parent.player1.collect)) {
    _root.terminal.gotoAndStop(2);
    _root.player1.speed = 0;

    }
    }

    Thanks for any help

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    '&&' is the code for 'and'
    '||' is the code for 'or'
    Code:
    onClipEvent (enterFrame) {
    	if (Key.isDown(69) && this.hitTest(_parent.player1.collect)) {
    		_root.terminal.gotoAndStop(2);
    		_root.player1.speed = 0;
    	}
    }
    HTH

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