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
QWI Script Styler
How to find the computer's IP Address at runtime
Puzzler II - Slide Puzzle
Toggle ActionsEnabled Property of a Flash Sprite
Circular Rollover behavior
blending on casts
2D Collision from Explore Science
JTMR KoolMarquee
Check for activeX component
Reverse a list
 

 

 

Behavior List Maker

Added on 1/28/2000

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MarkDaggett

This code will take items from a text field and then convert every item to an entry in the list.

--list maker --
--Mark Daggett 1999
-- mark@flavoredthunder.com
-- http://www.flavoredthunder.com
--this behavior was created because often times with director you need to create lists that are
--either to large or change to much to hard code them into the behavior themselves.
--This property will take all the contents of a field and add them to a list. It will also use what ever item delimiter that you choose.
-- Right now the only output function is the getInfo handler which returns a random value from the list to the outPut field.

property pField --this is the field to pull info from
property pTemp -- this is a temp field
property pOutField -- this is the outPut Field
property pList
property pDelimiter -- this is the property for the delimiter
on beginSprite me
  set the itemDelimiter = pDelimiter
  set pTemp = ""
  set pList = list()
  set pTemp = the text of field pField
  repeat with newItems = the number of items of pTemp down to 1
    
    addAt pList, count(pList)+1 ,item newItems of pTemp
  end repeat
  
end

on getInfo me
  put getAt(pList, random(count(pList))) into field pOutField
end
on getPropertyDescriptionList me
  set pdlist to [:]
  addprop pdlist, #pField, [#comment:"Field where content is stored", #format:#field, #Default:""]
  addprop pdlist, #pOutField, [#comment:"Field to out put contents", #format:#field, #Default:""]
  addprop pdlist, #pDelimiter, [#comment:"What is your item delimiter", #format:#string, #Default:"|"]
  return pdlist
end getPropertyDescriptionList

 


Contact

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

Send e-mail