greetings to all

the following coding was given to me by someone in this group
i sort of modified it and it partially works. the purpose is to press an 
arrow key and go through a castmemberlist
changing the sprite on the stage to the next one on the list, I repeated the 
lists because when it reaches the end it stops.
so by repeating the list it will go over it the times i write it.
pMemberList1 works okay but the others dont
if possible can someone please take a look and tell me whats wrong with it 
(sorry for such a big problem but i really need your help).


property pMemberList1, pMemberList2, pMemberList3, pMemberList4, pIndex1, 
pIndex2, pIndex3, pIndex4
property spriteNum, pnMemberCount1,pnMemberCount2, pnMemberCount3, 
pnMemberCount4

on beginsprite me
  pMemberList1 = 
[1,2,3,4,5,6,7,8,9,10,11,12,13,1,2,3,4,5,6,7,8,9,10,11,12,13] -- up
  pMemberList2 = 
[33,34,35,36,37,38,39,40,41,42,43,44,45,33,34,35,36,37,38,39,40,41,42,43,44,45]--down
  pMemberList3 = 
[122,123,124,125,126,127,128,129,130,131,132,133,134122,123,124,125,126,127,128,129,130,131,132,133,134]--left
  pMemberList4 = 
[152,153,154,155,156,157,158,159,160,161,162,163,164,152,153,154,155,156,157,158,159,160,161,162,163,164]--right
  pnMemberCount1 = pMemberList1.count
  pnMemberCount2 = pMemberList2.count
  pnMemberCount3 = pMemberList3.count
  pnMemberCount4 = pMemberList4.count

  the keyDownScript = "sendSprite(" & spriteNum & ", #xKeyDown, the 
keyCode)"

end

on xKeyDown me, nKeyCode
  case nKeyCode of
    125:
      sprite(1).member = member("5front")

    126:
      me.changeCast(1)
    123:
      sprite(1).member = member("5left")
    124:
      sprite(1).member = member("5right")
  end case
end

on changeCast me, nextPrev
  pIndex1 = max(1, min(pnMemberCount1, pIndex1 + nextPrev))
  pIndex2 = max(1, min(pnMemberCount2, pIndex2 + nextPrev))
  pIndex3 = max(1, min(pnMemberCount3, pIndex3 + nextPrev))
  pIndex4 = max(1, min(pnMemberCount4, pIndex4 + nextPrev))
  sprite(1).member = member(pMemberList1[pIndex1])
  sprite(2).member = member(pMemberList2[pIndex2])
  sprite(3).member = member(pMemberList3[pIndex3])
  sprite(4).member = member(pMemberList4[pIndex4])
end


best regards

JUAN-NYC
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


[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!]

Reply via email to