3 Replies Latest reply on Jun 9, 2006 2:36 PM by Newsgroup_User

    scriptInstanceList puppet and score behaviour

    RaPit
      Hi,
      Did anyone know that MM correct this problem or any workarounds for that?

      Frame 1:
      --------------
      sprite(1).puppet = true
      sprite(1).scriptInstanceList.add(script("a").new())
      ...

      Frame 2:
      -----------------
      sprite(1).scriptInstanceList.deleteAt(1)
      sprite(1).puppet = false

      Frame 3:
      ----------------
      There are score predefined sprites with attached behaviours. Bahaviours isn't instantiated (for sprite 1 of course)
      sprite(1).scriptList look good - there are infos about attached behaviours but scriptInstanceList is empty!

      There is workaround, using dedicated sprite channels (ie. over 100) for dynamic sprites, but I need a lot of sprites and I think that performances problem may occure...

      RaPIT
      Sorry, my english is poor ;D
        • 1. Re: scriptInstanceList puppet and score behaviour
          Level 7
          > Did anyone know that MM correct this problem or any workarounds for that?

          Yes - with MX2004 a new function was added to fix the issue you observe.
          Check the docs for 'makeScriptedSprite()'
          • 2. Re: scriptInstanceList puppet and score behaviour
            RaPit Level 1
            That's strange...

            I tried:

            1). channel(1).makeScriptedSprite() / removeScriptedSprite()
            2). _movie.puppetSprite(1, true / false)
            3). sprite(1).puppet = true / false

            and always had same results :(

            Changing any sprite propertys (member, loc, rect, etc.) from lingo level when sprite is puppet and after that restoring it's controll to score (de-puppet sprites ) work fine...

            ...but after any access to scriptInstanceList (add/remove behaviour to sprite scriptInstanceList when is puppet) and after that restore score controll (set scriptInstanceList to empty list and de-puppet sprite) - all score predefined behaviours fail...
            • 3. Re: scriptInstanceList puppet and score behaviour
              Level 7
              > 1). channel(1).makeScriptedSprite() / removeScriptedSprite()
              > 2). _movie.puppetSprite(1, true / false)
              > 3). sprite(1).puppet = true / false

              I'm not sure what you're saying, but if you use
              make/removeScriptedSprite() you shouldn't use touch either the 'puppet'
              or 'scriptInstanceList' properties of your sprite