2 Replies Latest reply on Feb 7, 2007 4:12 AM by Newsgroup_User

    Copy Pixel...!

    Blackthorn
      Morning folks, hopefully some smart people here will be able to help.

      This is my problem. I have a character which I want to equip.
      The character is represented by a cast member called “Character”. Depending on the user selection I can arm him with a variety of weapons (“Axe”, “Sword”, “Shield”…..). All weapon selections are represented by there own cast members.

      In a sample test app I have:

      new_image = member(“Character”).duplicate()

      new_image.copypixels(member(“Axe”).image, new_image.rect, member(“Axe”).image.rect, [#blendlevel:100])

      This works, I get a new cast member appropriately armed with a big axe. When I took this exact code and added it into my main application I get:
      Script error. Expecting four parameters
      All the relevant cast members are present and I can see no reason for the above code to throw an error. The only reference to this error I see with lingo is something to do with 3D lingo, which this is not using.
        • 1. Re: Copy Pixel...!
          duckets Level 1
          I'm guessing you already have another cast member with the same name (either 'character' or 'axe', etc), in your main application. Therefore when you specify that cast member, it's finding a different cast member which is not a bitmap, and failing.

          Hope this solves your problem!

          - Ben
          • 2. Re: Copy Pixel...!
            Level 7
            I'm guessing you typed your code wrong because it wouldn't have worked the
            first time this way but for what it's worth,

            new_image = member(?Character?).duplicate()

            You're not duplicating the member's image here.

            new_image = member(?Character?).image.duplicate()

            is what you want but as I said, if it worked once then you probably already
            have this.
            --
            Craig Wollman
            Lingo Specialist
            Word of Mouth Productions
            212-928-9581

            www.wordofmouthpros.com
            "Blackthorn" <webforumsuser@macromedia.com> wrote in message
            news:eqc3cj$87t$1@forums.macromedia.com...
            > Morning folks, hopefully some smart people here will be able to help.
            >
            > This is my problem. I have a character which I want to equip.
            > The character is represented by a cast member called ?Character?.
            > Depending on
            > the user selection I can arm him with a variety of weapons (?Axe?,
            > ?Sword?,
            > ?Shield??..). All weapon selections are represented by there own cast
            > members.
            >
            > In a sample test app I have:
            >
            > new_image = member(?Character?).duplicate()
            >
            > new_image.copypixels(member(?Axe?).image, new_image.rect,
            > member(?Axe?).image.rect, [#blendlevel:100])
            >
            > This works, I get a new cast member appropriately armed with a big axe.
            > When I
            > took this exact code and added it into my main application I get:
            > Script error. Expecting four parameters
            > All the relevant cast members are present and I can see no reason for the
            > above code to throw an error. The only reference to this error I see with
            > lingo
            > is something to do with 3D lingo, which this is not using.
            >
            >