2 Replies Latest reply on Oct 25, 2006 2:20 PM by Newsgroup_User

    Script Error: Varible used before assigned a value

    TheStressedStudent
      Hey as u guys can probably tell fromt he last post, im new to lingo and im getting the following script error when i try to run my movie.

      script error: variable used before assigned value

      this is my code...

      -- create the backdrop of sky
      p3Dmember.newTexture("backdrop", #fromCastmember, \ member("sky")) <-- error occurs here!!
      p3Dmember.camera(1).insertBackdrop(1, \
      p3Dmember.texture("backdrop"), point(0,0), 0)
        • 1. Re: Script Error: Varible used before assigned a value
          duckets Level 1
          does 'p3Dmember' actually contain a reference to your 3d cast member? if you haven't explicitly done this at some other point in your code then it won't. You'll need a line something like this:

          p3Dmember = member("the name of your 3d cast member")

          Also, you don't need that \ in the line.

          hope this helps!

          - Ben
          • 2. Re: Script Error: Varible used before assigned a value
            Level 7
            I don't work with 3d but in general an object has to be initialized before
            it can be used. That certainly pertains to lists. For example, you'll get
            the same error if you try to add an item to a variable that wasn't
            previously defined as a list

            myList.add ("tom")

            will give you an error but

            myList = []
            myList.add ("tom")

            will not.

            Try initializing your 3d object first.

            --
            Craig Wollman
            Word of Mouth Productions

            phone 212 928 9581
            fax 212 928 9582
            159-00 Riverside Drive West #5H-70
            NY, NY 10032
            www.wordofmouthpros.com


            "TheStressedStudent" <webforumsuser@macromedia.com> wrote in message
            news:ehodrp$8uq$1@forums.macromedia.com...
            > Hey as u guys can probably tell fromt he last post, im new to lingo and im
            > getting the following script error when i try to run my movie.
            >
            > script error: variable used before assigned value
            >
            > this is my code...
            >
            > -- create the backdrop of sky
            > p3Dmember.newTexture("backdrop", #fromCastmember, \ member("sky"))
            > <--
            > error occurs here!!

            > p3Dmember.camera(1).insertBackdrop(1, \
            > p3Dmember.texture("backdrop"), point(0,0), 0)
            >