3 Replies Latest reply on Jan 3, 2008 12:34 PM by Newsgroup_User

    strange scriptInstanceList behavior

    Level 7
      I am trying to view the list of properties of a behavior in runtime. I put

      sprite (11).scriptInstanceList

      in the object inspector and sometimes I'll see [] (an empty list) and
      sometimes I'll see the object referece of the script(s) attached. It seems
      to happen randomly. I'm not attaching scripts in realtime to the sprites in
      question and I'm definitely in run mode. The sprites absolutely have
      behaviors attached. I thought that maybe it was a memory thing. I have 2
      GB memory runing in XP Pro. My program is mostly code and very few graphics
      so there shouldn't be any memory issues.

      Any clues?


        • 1. Re: strange scriptInstanceList behavior
          the real POTMO Level 1
          yes. If you check sprite(11).scriptInstanceList on beginSprite the scriptInstanceLIst might not be initialized. Does it happen on exitFrame randomly or only on beginSprite randomly?
          • 2. Re: strange scriptInstanceList behavior
            Level 7
            Sean Wilson enlightened me. If you add the scriptinstancelist of a sprite
            to the behavior inspector while a movie is running, it will work fine but if
            you add it before the movie is run and then run the movie, it will in
            effect, inconsistently, dissable the behavior on that sprite.

            I have now had consistent results if I remove the entry from the OI each
            time I stop the movie then add it back after I run it. It's a pain in the
            neck but it works. I'm not sure if this is a bug or an anomoly in the OOP
            design of Director and Lingo. I strongly suspect it's a bug.

            Thanks for your input.

            Craig

            "the real POTMO" <webforumsuser@macromedia.com> wrote in message
            news:fh9a2h$jrb$1@forums.macromedia.com...
            > yes. If you check sprite(11).scriptInstanceList on beginSprite the
            > scriptInstanceLIst might not be initialized. Does it happen on exitFrame
            > randomly or only on beginSprite randomly?


            • 3. Re: strange scriptInstanceList behavior
              Level 7
              I discovered something that's handy if you run into this problem of using
              the scriptInstanceList of a sprite in the Object Inspector. Once Sean
              enlightened me as to what was going on, I started removing the entry from
              othe OI then reentering it when the referenced sprite was alive. That was a
              pain in the butt but it worked. I have found that if I just close the OI or
              even to to the Behaviors tab of that window, I can stop and start the movie
              all I want and as long as I open the OI or go back to that tab everything
              works fine. Of course if the entry is still in the OI and the OI is active
              then it dissables all scripts.