Welcome, Guest
  • Author Topic: If else  (Read 7558 times)

    Mastamind

    • Jr. Programmer
    • **
    • Posts: 79
      • View Profile
      • Email
    If else
    « on: 09/22/05, 17:49 »
     ???
    I am scratching my head with this script. Can someone please help me. Everything works except for the LAYER SCRIPT ON FRAME 2. When it goes to frame 2 it only dissables the CVBA button. As if it only reads the if part and not the else. Thankx, your help will be very much appreciated.

    FRAME 1:
    Script Layer:
     stop();

    Button A:
    on (release) {
       gotoAndPlay(2);
       unloadMovie("Pane");
       tellTarget ("PALM") {
          gotoAndPlay("PLAY");
       }
    }

    Button B:
    on (release) {
       gotoAndPlay(2);
       unloadMovie("Pane");
       tellTarget ("CORDE") {
          gotoAndPlay("PLAY");
       }
    }


    FRAME 2

    Script Layer:
    stop();
    if (CORDE.loaded = true) {
       CVBA.enabled = false;
       PVBA._alpha = 50;
    }else if (PALM.loaded = true) {
       PVBA.enabled = false;
       CVBA._alpha = 50;
    }

    Button A:
    on (release) {
       unloadMovie ("Pane");
       PVBA.enabled = false;
       PVBA._alpha = 100;
       CVBA.enabled = true;
       CVBA._alpha = 50;
       tellTarget ("CORDE") {
          gotoAndPlay("EXIT");
       }
    }
    on (rollOver) {
       PVBA._alpha = 100;
    }
    on (rollOut) {
       PVBA._alpha = 50;
    }

    Button B:
    on (release) {
       unloadMovie ("Pane");
       CVBA.enabled = false;
       CVBA._alpha = 100;
       PVBA.enabled = true;
       PVBA._alpha = 50;
       tellTarget ("PALM") {
          gotoAndPlay("EXIT");
       }
    }
    on (rollOver) {
       CVBA._alpha = 100;
    }
    on (rollOut) {
       CVBA._alpha = 50;
    }
    « Last Edit: 09/23/05, 18:30 by Jorge R. »

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re: If else
    « Reply #1 on: 09/25/05, 06:46 »
    Hi,

    use == for equality comparison, the = rather sets a variable

    Musicman

    Mastamind

    • Jr. Programmer
    • **
    • Posts: 79
      • View Profile
      • Email
    Re: If else
    « Reply #2 on: 09/26/05, 10:18 »
    Musicman,
    I tried that but then it sets both buttons active instead of just the one that needs to be active. ???