I think the issue is with these statements:
sprite(mySprite).member = sprite(mySprite).member + 1
sprite(mySprite).member evalsates to a member reference such as
(member 17 of castLib 3)
& I think adding 1 to it might make nonsense.
-> you probably want sprite(mySprite).member.number + 1
hth
-Buzz
At 11:21 PM +0100 11/16/01, Mikael Wir�n wrote:
>Hi List.
>I�ve run into this strange problem.
>I�m generating some sprites based on a list of symbols defining what member
>to put into the sprite. Like this:
> Just to mass puppet them and attach a mouseUp script to all.
>
> repeat with s = 50 to 105
> puppetSprite s, TRUE
> x = script("carg_mouse").new()
> sprite(s).scriptInstanceList.add(x)
> end repeat
>
> repeat with i = 1 to lastItem
> dispItem = pl_itemList[i]
> case dispItem of
> #wpn: disp_mem = member("cg_wpn_uc") --Weapons
> #foo: disp_mem = member("cg_foo_uc") --Food
> #dop: disp_mem = member("") --Dope
> #jew: disp_mem = member("cg_jew_uc") --Jewels
> #ent: disp_mem = member("") --Entertainment
> #too: disp_mem = member("") --Tools
> #clo: disp_mem = member("") --Clothes
> #rob: disp_mem = member("") --Robots
> #med: disp_mem = member("") --Medicine
> #com: disp_mem = member("cg_com_uc") --Computers
> end case
> sprite(curr_sp).member = disp_mem
> sprite(curr_sp).rect = gCargList[y_count][x_count]
> curr_sp = curr_sp + 1
> x_count = x_count + 1
> if x_count > 5 then
> y_count = y_count + 1
> x_count = 1
> end if
> end repeat
>
>Works like a charm. Calling the mouseUp script works just great.
>BUT, the funny part comes here:
>
>on mouseUp me
> mySprite = me.spriteNum
> add_sub = 1
> puppetSprite(mySprite), TRUE
> if add_sub = 1 then
> sprite(mySprite).member = sprite(mySprite).member + 1
> add_sub = 0
> else
> sprite(mySprite).member = sprite(mySprite).member - 1
> add_sub = 1
> end if
>end
>
>if i set the property mySprite on beginSprite it�s VOID, ok.
>So i slaped it at the begining of the mouse up script.
>Ugly but it works.
>Generating a number from 50 and upwards.
>Fine, the right sprite gets called.
>But the strange part is when i try and change the member of mySprite, it
>changes to member(0) of castLib(0) no matter what i do. This code was my
>last attempt to change it by redoing step 1. Puppeting the sprite again,
>setting the member.
>But still it generates a member(0) of castLib(0). WHY??????
>
>Am i missing something here??
>
>Frustrated and bored =/
>
>TIA
>/Micke
>
>
>
>
>
>[To remove yourself from this list, or to change to digest mode, go to
>http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
>email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
>Lingo-L is for learning and helping with programming Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]