2 Replies Latest reply on Nov 27, 2008 2:46 PM by ytlevine

    Creating a new instance of a cast member

    ytlevine Level 1
      I want to create an instance of a cast member on stage, that will not exist as a new member in the cast.
      I read some stuff about child objects, but I wasn't successful in getting it to work.
      I also want to be able to create more than one instance, and to be able to manipulate them separately.
      Can someone help?
      Thanks a lot,
      Isaac
        • 1. Re: Creating a new instance of a cast member
          Level 7
          There is a variety of ways to accomplish this ("is" agreeing with "a
          variety" not "of ways"). You can puppet as many sprite channels as you need
          and assign the one cast member to each. Each will function independently
          although any modification to the cast member itself will be reflected in
          each sprite instance.

          The following code takes the first cast member in the first castLib and
          places it on the stage 10 times using channels 1-10. It places the sprites
          side by side horizontally. The position is not important but I showed that
          each sprite can be treated independently, in this case by setting the loc
          property. Of course you can do this with any sprite property. The
          significant lines are 2 and 3.

          repeat with x = 1 to 10
          sprite (x).puppet = TRUE
          sprite (x).member = member (1)
          xPos = member (1).width * (x - 1) + (member (1).width / 2)
          sprite (x).loc = point (xPos, member (1).height / 2)
          end repeat

          Craig

          "ytlevine" <webforumsuser@macromedia.com> wrote in message
          news:ggk8be$fr7$1@forums.macromedia.com...
          >I want to create an instance of a cast member on stage, that will not exist
          >as
          > a new member in the cast.
          > I read some stuff about child objects, but I wasn't successful in getting
          > it
          > to work.
          > I also want to be able to create more than one instance, and to be able to
          > manipulate them separately.
          > Can someone help?
          > Thanks a lot,
          > Isaac
          >


          • 2. Re: Creating a new instance of a cast member
            ytlevine Level 1
            So that's what it's called - puppeting?
            Thanks.