Integration with the Macromedia Scrollbars

The MulticolumnTextField component integrates with the Macromedia scrollbar components in a similar manner to standard dynamic text fields. The component comes with three properties (mtfpagesize, mtfminscroll, and mtfmaxscroll) to enable correct integration with the scrollbar, and these should be used to set the scrollbar properties. The following example demonstrates the procedure:

  1. Create three layers on your timeline.
     
  2. Name the bottom layer component, place an instance of the Multicolumn Text Field component on the layer and give it the instance name 'myInstance'.
     
  3. Name the middle layer 'scroll bar', place an instance of your Macromedia scrollbar on the layer and give it the instance name 'myScrollBar'.
     
  4. Name the top layer script and, selecting the timeline keyframe, enter the following script into the ActionScript panel:
     

//assign content to the Multicolumn Text Field component
myInstance.mtftext = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer...";
//assign the properties of the Multicolumn Text Field to the scrollbar
myScrollBar.setScrollProperties(myInstance.mtfpagesize, myInstance.mtfminscroll, myInstance.mtfmaxscroll);
//assign the changeHandler function to the scrollbar
myScrollBar.setChangeHandler ("scroller");
//create the scrollbar's function
function scroller () {
//Each time function is called alter mtfscroll to match scrollbar position
  myInstance.mtfscroll = myScrollBar.getScrollPosition();
}

Note:
Content can be assigned to the MulticolumnTextField component via the custom interface. If this is the preferred method then do not re-assign the content in the script.

Note:
The content specified in this example would not be sufficient to cause the creation of more than one column, it has been reduced in size for the purposes of demonstration.