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
Composite Images with Alpha
Hide a range of sprite channels
007 Fonts
Change FillCycles Continuously
Library dmm_xls for work with Microsoft Excel files
Psycho Pong
Res Mode
MagicTools Xtras
Inconsistent Buttons
E-mailExec 3 Pro
 

 

 

Behavior Auto Save and Load Text

Added on 9/29/1999

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: TimmRyan

Just drag onto text fields (that have a unique name) and it will automatically store and retrieve the data for that field using setPref and getPref.

---------------------------------------------
--this behavior will load a field from a pref file based on it"s name,
--and save it"s data on end sprite to the same pref file.
--The Default is currently set to " " (a space)

--by Timm Ryan
property mysprite, themember, myPrefName, myDefault

on beginsprite me
  mySprite = sprite(me.spriteNum)
  theMember  = mySprite.member
  myPrefName = themember & ".txt"
  myData = getPref(myPrefName)
  if voidP(myData) then
    myData = myDefault
  end if
  theMember.text = myData
end

on endsprite me
  mytext = theMember.text
  setPref(myPrefName, myText)
end

on getPropertyDescriptionList
  return [ #myDefault: [#comment: "Default Text", #format:  #string, #default: " " ]]
end getPropertyDescriptionList

 


Contact

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

Send e-mail