Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
3D games online. New cosmic world of Tensoric.
Installed ActiveX
Game protector
Dr.Explain - help file tool
Property Inspector
Add Your file to windows Startup
ZGTSB-ButtonDown
Director 7 and Lingo Authorized
Frogger by J.R.D.R.
Scale-Alphamania
MediaMacros Xtras Mall
 

 

 

Behavior Wait for a Keypress

Added on 7/6/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KumarK

Wait for a Keypress

---- written for Director 8 ---
---- Kumar.K ----
---- kumark@icode.com ----

------ Custom Properties ------

property  WhereTo,whichkey

------ Get Behavior Description List ------
on getPropertyDescriptionList me
  set description = [:]
  if the currentspritenum <> 0 then exit
  actionlist=["Go Next Frame","Go Next Marker","Go Previous Marker","Go Loop","Exit"]
  keylist=["Backspace Key","Enter Key","Return Key","Space Key","Tab Key","Left Arrow","Right Arrow","Up Arrow","Down Arrow"]
  addProp description, #whichkey, [#comment: "wait for Which Key ?",#format:#String,#range:keylist,#default:keylist[1]]  
  addProp description, #WhereTo, [#comment: "What Next(after a Key press or Mouse Click) ?",#format:#String,#range:actionlist,#default:actionlist[1]]
  return description
end getPropertyDescriptionList
------ Get Behavior Description List ------

-- Get Behavior description --
on getBehaviorDescription me
  return
    "Wait for a KeyPress" & RETURN & RETURN &
    "This Behavior make the playback head hold on a frame untill a key press . " &
    "PARAMETERS:" & RETURN &
    "* Which Key :" & RETURN &
    "* What to Do after Key press."
end getBehaviorDescription
-- Get Behavior description --

------ Availbale for only Frame Script ------
on isOKToAttach (me, aSpriteType, aSpriteNum)
  case aSpriteType of
    #graphic:
      return false
    #script:
      return true
  end case
end isOKToAttach
------ Availbale for only Frame Script ------

-- Events --
on ExitFrame me
  go the frame
end ExitFrame

on keydown
  case whichkey of
    "Backspace Key":if the key=backspace then whatnext
    "Enter Key":  if the key=Enter then whatnext
    "Return Key":  if the key=RETURN then whatnext
    "Space Key":if the key=space then whatnext
    "Tab Key": if the key=Tab then whatnext  
    "Left Arrow":if the keycode = 123 then whatnext
    "Right Arrow":if the keycode = 124 then whatnext  
    "Up Arrow":   if the keycode = 126 then whatnext  
    "Down Arrow":   if the keycode = 125 then whatnext        
  end case  
end keydown
------ Events ------

----custom handlers----
on whatnext
  case WhereTo of
    "Go Next Frame":Go the frame + 1
    "Go Next Marker": Go Next
    "Go Previous Marker": Go previous
    "Go Loop": Go Loop
    "Exit":quit
  end case
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