Accessing Properties
Cool Focus applets provide several properties which you can read (to receive information) or write (to set a value), or both. You can find details of the properties supported by each applet in the Applet Index.

Accessing these properties is very straightforward. Here's an example which retrieves the value of the 'stagewidth' property, available in all applets:

var sw = example.stagewidth;
//sw now contains the width of the applet loaded into the 'example' movieclip
example._x = mymovie._x - sw;
//the 'example' movieclip is moved to be immediately to the left of a movieclip named 'mymovie'
Setting a writeable property is just as easy. This example forces an applet to select a particular menu item using the 'selectitem' property:
example.selectitem = 4;
Notes
  • Properties are not available until the applet has fully loaded. If you want to access properties as soon as possible after loading, create a callback function for the applet's onLoaded event and make the changes you need in that function.

  • Most properties are read-only or write-only. In most cases nothing bad will happen if you try to write to a read-only property, but nothing useful will happen either. Similarly, reading a write-only property will return a value, but it won't be a meaningful value.

  • Take note of the type of object a property represents in the Applet Index to ensure you pass or receive a Number, String (etc.) as appropriate.