This content has been marked as final. Show 2 replies
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!
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
Word of Mouth Productions
"Blackthorn" <email@example.com> wrote in message
> 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?,
> ?Shield??..). All weapon selections are represented by there own cast
> 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
> is something to do with 3D lingo, which this is not using.