0 Replies Latest reply on Jan 15, 2009 12:44 PM by Opera Rat

    CheckBox Script not quite right

    Opera Rat Level 1
      This script isn't writing to my .ini file. I can't figure out why? Can anyone see it. Also, at the bottom, I'be attached a second script that I would rather use because that way I don't have to modify the first one 40 times. But the baWrite doensn't like what I have and if it is like the first one, it probably won't work.

      Script 1:
      --forget about gThing2 for now
      global gThing1, gThing2

      on beginSprite me

      if gThing1 = TRUE then
      sprite(me.spriteNum).member.hilite = TRUE
      else
      if gThing1 = FALSE then
      sprite(me.spriteNum).member.hilite = FALSE
      end if

      end if


      end

      on enterFrame me

      if sprite(me.spriteNum).member.hilite = TRUE then
      gThing1 = TRUE
      else
      if sprite(me.spriteNum).member.hilite = FALSE then
      gThing1 = FALSE
      end if
      end if

      end

      on exitFrame me
      if gThing1 = TRUE then
      baWriteIni( "Box", "Thing", "TRUE", the moviePath&"data.ini" )
      else
      end if

      if gThing1 = False then
      baWriteIni( "Box", "Thing", "FALSE", the moviePath&"data.ini" )
      end if

      end

      Script2:
      global gThing1, gThing2

      property pName, pValue

      on getPropertyDescriptionList me
      list = [:]
      addProp list, #pItem, [#comment: "Name", \
      #format: #string, #default: ""]
      addProp list, #pValue, [#comment: "Variable Name", \
      #format: #string, #default: ""]
      return list
      end


      on beginSprite me

      if pValue = TRUE then
      sprite(me.spriteNum).member.hilite = TRUE
      else
      if pValue = FALSE then
      sprite(me.spriteNum).member.hilite = FALSE
      end if

      end if


      end

      on enterFrame me

      if sprite(me.spriteNum).member.hilite = TRUE then
      pValue = TRUE
      else
      if sprite(me.spriteNum).member.hilite = FALSE then
      pValue = FALSE
      end if
      end if

      end

      on exitFrame me
      if pValue = TRUE then
      baWriteIni( "Box", (pName), "TRUE", the moviePath&"data.ini" )
      else
      baWriteIni( "Box", (pName), "FALSE", the moviePath&"data.ini" )
      end if

      end