
KC8 contentPane API
===================


Functions:
==========

getPage()
---------
Returns the current page of multi page content



setContent ( type, source [, transition, transitTime [, clipRect [, initObject ]]] )
------------------------------------------------------------------------------------
Type                       Source

0 text                     string containing text
1 html text                string containing html text
2 external text            filename of text file
3 external html text       file name of html text file
4 external graphic         file name of swf, gif, png or jpg file
5 symbol library mc        linkage ID of movieclip
6 symbol library bitmap    linkage ID of bitmap
7 bitmap                   bitmap

Transition

0 Crossfade
1 Dissolve
2 Left to right
3 Top to bottom

TransitTime

Value between 0 and 5
representing the amount of seconds the transition takes

ClipRect

Rectangle of the flash.geom.Rectangle type representing the area to clip.
When the content is a movie(clip), objects sometimes start outside the stage area resulting in a problem when trying to recognise the width and height of the movie(clip). This problem is solved by the ability to manually set the region that should be displayed.

InitObject

When content type is 'symbol library mc', you can pass an initObject to the specified symbol library mc.



Alternative syntax for multipage documents:

setContent ( pageArray, startPage [, transition, transitTime ] )
----------------------------------------------------------------
pageArray is an array of pages that make up the content.
Each array item is a sub array containing the parameters for a normal setContent. 

StartPage is the number of the page to display in the beginning.

The transition parameters can be used to set an initial transition that is used instead of the normal one specified for the first page to display.

example:

pages = new Array();
pages.push([3,'firstPage.html']);
pages.push([2,'secondPage.txt',0,3]);
pages.push([4,'thirdPage.jpg',1,2]);
myContentPane.setContent(pages,1,0,2.5);



setContentFilters ( filterArray )
---------------------------------
Sets the filters of the content.
When using content filters, text background will be ignored and set to transparent.

example:

myContentPane.setContentFilters([new flash.filters.DropShadowFilter(2)]);


setNewTextFormat ( textFormat )
-------------------------------
Analog to the textfield.setNexTextFormat function


setPage ( pageNumber )
----------------------
Sets the current page when multi page content is displayed.


setScrollPos ( hsPos , vsPos )
------------------------------
Sets the position of the scrollers. Both can have a value between 0 and 1.
setScrollPos(0,0) sets the scrollers to the top left.
setScrollPos(1,1) sets the scrollers to the botom right.
SetScrollPos(0.5,0.5) sets the scrollers to the middle.


setTextFormat ( [beginIndex], [endIndex], textFormat)
-----------------------------------------------------
Analog to the textfield.setTextFormat function



Properties:
===========

autoHide
--------
Possible values are 0, 1, 2 and 3.
0 means hide no scrollbars
1 means hide the horizontal scrollbar if possible
2 means hide the vertical scrollbar if possible.
3 means hide both scrollbars if possible.

Notes:
- This can only be set when setting up the component or just before setting new content



backgroundColor
---------------
Analog to textfield.backgroundColor
Gets / sets the background color of the text when content is text.


barTrans
--------
When set to true, only scrolltracks and buttons are visible during a transition. When set to false the bars are also visible.


embedFonts
----------
Analog to textfield.embedFonts


htmlText
--------
Analog to textfield.htmlText
Content has to be text.


ignoreCR
--------
Boolean value, true by default.
Windows textfiles often use both cr and lf resulting in blank lines between each line of text. When set to true, cr is ignored when using external text content.


ignoreLF
--------
Boolean value, false by default.
When set to true, lf is ignored when using external text content.


length
------
Analog to textfield.length


styleSheet
----------
Analog to textfield.styleSheet


text
----
Analog to textfield.text
Content has to be text.


wordWrap
--------
Analog to textfield.wordWrap



Events:
=======

onScroll ( hsPos , vsPos )
--------------------------
Event occuring when content is scrolled.


onTransit
---------
Event occuring just before the content transition takes place.
This gives you for example the ability to se the position of the scrollbars before the content is first displayed.



Known limitations :
===================

- The minimum size of the component is 75 x 75 pixels.

- When setting htmlText, styleSheet, text, wordWrap or using setTextFormat the content is reset to the top left because of the unability to predict the changes to the lay-out of the text.

- Text or htmlText properties behave a bit slower compared to the textfield ones so if you are building up a string it's better to use a temporary variable and set the result in the end to the contentPane.

- The combination of very long texts and font embedding may result in rendering problems. Most likely you won't use texts that long but in case you do you can solve the problem by turning off font embedding.

- Setting a movie(clip) with dynamic textfields as content may result in problems rendering the dynamic text it contains.

- When using html text with images inside it, it's important to specify the width and height of the images otherwise the width and the height of the text can not be detected right.

- Due to security restrictions inside the Flash Player a content transition doesn't work when content is an external graphic stored on another domein.



Remarks :
=========

- When the focus is set to the movie the mouse wheel can be used for vertical scrolling when hovering over the component.

- Right clicking the component gives you the ability to zoom the content.

