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
Light Sensitive Text Dropshadow
Vector Shape - Create Grid
Rollover Fader-Alphamania
Copy My Text
Volume of Sprite
Ripple Follow Sprite-Alphamania
Fake-3D Motion
Magic Button
Vector Shape - Create Rectangle
Tempo Lingo
 

 

 

Behavior Add a unique property to a property list

Added on 9/11/2003

 

Compatibilities:

This item has not yet been rated

Author: Sander Falise

This function is basically the same as the addProp function for property lists, but it deletes all properties with the name of the property you want to add. This makes sure your lists stay small and prevents errors because lists will no longer have duplicate entries. Usage is simple: addAProp(listName, propertyName, value) listName is a propery list, propertyName can be either a string or a property, value can be anything. If no value has been specified, the property will be deleted. No value is NOT the same as "" (an empty string) or 0 (zero). I hope you find this usefull, good luck coding!

-- before adding a property to a list, delete all properties with the same name
on addAProp me, a, p, v
  if ilk(p) = #string then s = symbol(p)
  repeat while a.deleteProp(s)    
  end repeat
  if ilk(v) <> #void then a.addProp(s, v)  
  return a  
end

 


Contact

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

Send e-mail