Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Sin Path Movement
Director 7 Demystified
Play different Movies For Different Game Levels
DirGames Discussion List
Which Keys
zWinVer Xtra
A char scroller
Billenium Transitions Xtra v1.3
Sound 1 CuePoint
Mosaic-Alphamania
 

 

 

Behavior Correct entry

Added on 8/10/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: SunilBalan

This is a script to check the correct entry. This can be useful while developing CBT"s.

Download PC Source    Download Mac Source
property spriteNum, currentWord, pNav1, pNav2, pAnswer

on beginSprite me
  currentWord = ""
  sprite(spriteNum).member.text = ""
  sprite(spriteNum).member.editable = true
end

on keyDown me
  if the key = return then
    dontPassEvent
    if currentWord = pAnswer then
      case pNav1 of
        "Go Next Frame":Go the frame + 1
        "Go Previous Frame":Go the frame -1
        "Go Next Marker": Go Next
        "Go Previous Marker": Go previous
        "Go Loop": Go Loop
        "Exit":quit
        "Go to frame -2": Go the frame -2
        "Go to frame +2": Go the frame +2
      end case
    else
      case pNav2 of
        "Go Next Frame":Go the frame + 1
        "Go Previous Frame":Go the frame -1
        "Go Next Marker": Go Next
        "Go Previous Marker": Go previous
        "Go Loop": Go Loop
        "Exit":quit
        "Go to frame -2": Go the frame -2
        "Go to frame +2": Go the frame +2
      end case
      currentword = ""
    end if
  else
    dontPassEvent
    if the keyCode = 51 then
      if currentWord.char.count > 1 then
        howMany = (currentWord.char.count - 1)
        currentWord = currentWord.char[1..howMany]
      else
        currentWord = ""
      end if
    else
      if "1234567890abcdefghijklmnopqrstuvwxyz-. " contains the key then
        currentWord = currentWord & the key
      end if
    end if
    theText = ""
    if currentWord.char.count > 0 then
      repeat with x = 1 to currentWord.char.count
        theText = currentword
      end repeat
    end if
    sprite(spriteNum).member.text = currentword
  end if
end

on getPropertyDescriptionList me
  p_list = [:]
  addProp p_list, #pAnswer, [#format :#string, #default :"Correct display",#comment :"Type your correct word"]
  actionlist=["Go Next Frame","Go Previous Frame","Go Next Marker","Go Previous Marker","Go Loop","Exit","Go to frame -2", "Go to frame +2"]
  addProp p_list, #pNav1, [#comment: "Where to go if correct?" ,#format:#String, #range:actionlist,#default:actionlist[8]]
  addProp p_list, #pNav2, [#comment: "Where to go if wrong?" ,#format:#String,#range:actionlist,#default:actionlist[1]]
  return p_list
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail