Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Wait for a Keypress
Giving a shadow for a sprite
Noise Algorithm - Imaging Lingo
Toggle ButtonsEnabled Property of a Flash Sprite
XtrAgent
Sharpen Filter - Imaging Lingo
cXtraSoundRec
Multi Cropper
Happy Hour Fonts
Show Me the Movie
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail