dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: If statment?

  1. #1
    Senior Member
    Join Date
    Aug 2003
    Posts
    112

    If statment?

    Hi.

    I would like to use an IF statement but am not sure of the syntax.

    This is what I would like:


    on (release) {
    tellTarget ("_root.menu_sub01") {
    gotoAndPlay(2);
    }
    }
    IF _root.menu_sub02 at frame 16

    on (release) {
    tellTarget ("_root.menu_sub02") {
    gotoAndPlay(16);
    }
    }

    IF NOT then do nothing.


    If anyone could re-write this for me it would be great.

    Thanks - Joe
    Check out this comic:
    http://www.schoolyardrules.com/

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    IF _root.menu_sub02 at frame 16...

    Sure you didn't mean...

    if _root.menu_sub02 NOT at frame 16? Otherwise why have it go and play 16 if it's already at 16?
    Code:
    on (release) {
    if(_root.menu_sub02._currentframe == 16){
    _root.menu_sub02.gotoAndPlay(16);
    }
    }
    Last edited by oldnewbie; 03-09-2005 at 11:04 AM.

  3. #3
    Senior Member
    Join Date
    Aug 2003
    Posts
    112
    Sweet its working now.

    Thanks.

    This is what I was trying to make:
    rollover.swf
    rollover.fla

    Its working now but if you click a buttons while the page is still moving it breaks it.

    Any ideas?
    Last edited by SchoolYard; 03-09-2005 at 11:41 AM.
    Check out this comic:
    http://www.schoolyardrules.com/

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Then this should do it...

    on (release) {
    if(_root.menu_sub02._currentframe == 16){
    _root.menu_sub02.gotoAndPlay(17);
    }
    }

  5. #5
    Senior Member
    Join Date
    Aug 2003
    Posts
    112
    Originally posted by SchoolYard
    This is what I was trying to make:
    rollover.swf
    rollover.fla

    Its working now but if you click a buttons while the page is still moving it breaks it.

    Any ideas?
    Check out this comic:
    http://www.schoolyardrules.com/

  6. #6
    Senior Member
    Join Date
    Aug 2003
    Posts
    112
    Can I make a double if statement?

    IF _root.menu_sub02 not at 1, 15 or 32 then do nothing when the button is pressed.

    IF _root.menu_sub02 at 15 then play.

    Ta.
    Check out this comic:
    http://www.schoolyardrules.com/

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Disable the other buttons, while one is in motion...

  8. #8
    Senior Member
    Join Date
    Aug 2003
    Posts
    112
    I don't think that would work.

    Unless I can disable a button whilst a certain movie clip is playing then when it has stopped or reached a certain frame the button is then enabled.

    Is this possible?
    Last edited by SchoolYard; 03-10-2005 at 01:02 PM.
    Check out this comic:
    http://www.schoolyardrules.com/

  9. #9
    Senior Member
    Join Date
    Aug 2003
    Posts
    112
    I still havent figured it out.

    Anyone got any ideas?
    Check out this comic:
    http://www.schoolyardrules.com/

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