7 Replies Latest reply on May 24, 2007 5:00 AM by Greg Dove

    referencing variable: component parameter panel

    Level 7
      Here is my sample fla....
      http://swsidev.tafensw.edu.au/ElectricalTrades/sampleForPosting.fla (file
      size 48 K)

      I have posted this a couple of times, but hopefully the fla will help
      someone work out the answer for me...if you could i would appreciate that
      heaps.


      I am a very average programmer but this little piece of code 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 statement
      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 :)
      adam.west@@tafensw.edu.au (take out one of the @ to email me)