0 Replies Latest reply on May 21, 2007 2:17 AM by Newsgroup_User

    variable referencing problem...please help.

    Level 7
      Hi all. I posted this message to the general Flash forum yesterday, but
      doesn't seem like anyone can help.

      Here is my post::::

      Hi everyone. I can't seem to nail this.

      This works......
      a=0; //these variables a and b will eventually be set by other components on
      the fly.
      b=0;
      booleanCondition=a||b; //set boolean equation
      trace (booleanCondition); //trace shows either a 0 or 1

      if (booleanCondition==1){
      trace("condition is true")

      }

      if (booleanCondition==0){
      trace("condition is false")
      }

      Now....what i want to do is instead of explicity stating the boolean
      equation in the script, i would like to be able to enter (for convenience)
      the boolean via a varable called "booleanCondition" defined in the
      parameters panel for my component. I thought this would be easy, but have
      not been successful after many hours.

      eg

      a=0; //these variables a and b will eventually be set by other components on
      the fly.
      b=0;

      trace (booleanCondition); //the output panel shows a||b whereas before it
      contained 0 or 1 ....mmmm.
      if (booleanCondition==1){
      trace("condition is true")

      }

      if (booleanCondition==0){
      trace("condition is false")
      }

      Note that now this doesn't work, as booleanCondition seems to hold a||b and
      not the evaluated answer....

      HELP!!!

      Any help would be appreciated....it seems i am just not referencing the
      variable properly for this situation, but stuffed if i can work it out. I
      also have a sample fla I can send to anyone who would like to have
      a go.

      Thanks

      Adam :)
      p.s thanks Rothrock and Trevor for your help the other day...but i don't
      think i explained the problem well enough that time.