Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Sprite player
simODBCPro Xtra
Firefly CD Burning Xtra
Flash Rotator
Set Rotation angle of a Flash Sprite
DirectImage Xtra
XML to OBJ with lingo
Bilinear Resample Algorithm
Play Sound of Member
Importer
MediaMacros Xtras Mall
 

 

 

Behavior 80's Arcade High Score Name Entry Behavior

Added on 9/2/2005

 

Compatibilities:
behavior D8 D8_5 D9 Mac PC Shockwave

This item has not yet been rated

Author: Chunick (website)

Attach this behavior to a text or field member. You will have to make sure the member is of the right size and such... I suppose I could add all that into a GPDL for you, but that'd be more work for me. ;-) Anyways, the key here is MAKE SURE TO CHOOSE A MONOSPACED FONT!!!!! If you don't know what I'm talking about then Google it.

- Traditional High Score Name Entry -- and other filters
-- ©2005 by Josh Chunick

property spriteNum, pSprite, pMem, pCount

on beginSprite me
  pSprite = sprite(spriteNum)
  pMem = pSprite.member
  pMem.editable = False
  pCount = 1
  pMem.text = "AAA"
  Case pMem.type of
    #text:
      pMem.fontStyle = [#plain]
      pMem.char[pCount].fontStyle = [#underline]
    #field:
      pMem.fontStyle = "plain"
      pMem.char[pCount].fontStyle = " underline"
  end Case
  the keyDownScript = string(pSprite) & ".keyDown()"
end

on keyDown me
  if keyPressed(123) then
    theNum = charToNum(pMem.char[pCount]) - 1
    if theNum < 33 then theNum = 96
    pMem.char[pCount] = numToChar(theNum)
  end if
  
  if keyPressed(124) then
    theNum = charToNum(pMem.char[pCount]) + 1
    if theNum > 96 then theNum = 33
    pMem.char[pCount] = numToChar(theNum)
  end if
  if pMem.type = #field then pMem.char[pCount].fontStyle = "underline"
  if keyPressed(RETURN) then
    if pCount > 3 then
      Case pMem.type of
        #text:
          pMem.fontStyle = [#plain]
        #field:
          pMem.fontStyle = "plain"
      end Case
    else
      pCount = pCount + 1
      Case pMem.type of
        #text:
          pMem.fontStyle = [#plain]
          pMem.char[pCount].fontStyle = [#underline]
        #field:
          pMem.fontStyle = "plain"
          pMem.char[pCount].fontStyle = " underline"
      end Case
    end if
  end if
end

on endSprite me
  the keyDownScript = EMPTY
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail