RRDescription

redrocketcms.components.RRDescription

 

Description contains html code. It may contain line breaks, and massive amounts of text, so beware.

p id:String

Static. This id is the sybolID linkage necessary for dynamic attachment using attachMovie().

 

Example Usage. Identical functionally to dropping the Description component on the stage:

import redrocketcms.components.RRDescription; this.attachMovie(RRDescription.id, "description", this.getNextHighestDepth());

p useScrollbar:Boolean (Scrollbar - Use)

Write-only. If true, you must have the Macromedia v2 UIScrollBar Component available in your library. This will add the ability to scroll non-autoSized textfields and will also shorten the width of the Component by the width of the scrollbar.

 

Note you can customize the scrollbar the same way you normally would using the Macromeida v2 Component architecture.

p autoHideScrollbar:Boolean (Scrollbar - Autohide)

Write-only.

 

false (default) - the scrollbar will be visible whether or not the textfiled is in fact scrollable. If the textfield dose not require scrolling, and autoHideScrollbar is false, the scrollbar will still be visible, but in a "disabled" state.

 

true - the component will attempt to decipher if the scrollbar is necessary. If scrolling is not necessary, it will turn off the scrollbar and resize the textfield back to it’s original state. Note: when this happens, there may be a visible "flicker" when the textfield resizes.

p page:Number

Read/Write

 

1-based (i.e. page 1 is the first page, not 0)

sets the viewable area to the page specified, or returns the current page.

 

Note: using any of the page properties will set in motion an internal process of creating page metrics, and as a result may (and probably will) create extra line breaks to fill the last page so that there are even pages.

p pages:Number

Read-only

 

returns the total number of pages for the calculated page metrics of the description.

 

Note: using any of the page properties will set in motion an internal process of creating page metrics, and as a result may (and probably will) create extra line breaks to fill the last page so that there are even pages.

m pageup():Number

scrolls the description viewable up one page.

 

returns the current page after the scolling occurs, so if you were on page 2, it would return page 1.

 

Note: using any of the page properties will set in motion an internal process of creating page metrics, and as a result may (and probably will) create extra line breaks to fill the last page so that there are even pages.

m pagedown():Number

scrolls the description viewable down one page.

 

returns the current page after the scolling occurs, so if you were on page 2, it would return page 3.

 

Note: using any of the page properties will set in motion an internal process of creating page metrics, and as a result may (and probably will) create extra line breaks to fill the last page so that there are even pages.

p stylesheet:Object (Stylesheet)

This property has relaxed typing, so you can use it one of two ways.

 

Method 1: url-based

you can assign a url to this property to apply an external stylesheet to the html. Keep in mind, there will be a slight pause until the stylesheet loads.

 

Method 2: object-based

you can also pass in an actionscript object based stylesheet. this format is almost instananeous.

//Method 1 //desc is an instance of the RRDescription Class desc.stylesheet = "/assets/style/style.css" //Method 2 //desc is an instance of the RRDescription Class import TextField.StyleSheet; var ss:StyleSheet = new StyleSheet(); ss.setStyle("emphasized", {color:'#000000',fontWeight:'bold'}); desc.stylesheet = ss;

p STYLESHEET:Object (Static)

This is a static method that effects all RRDescription class instances. This property has relaxed typing, so you can use it one of two ways.

 

Method 1: url-based

you can assign a url to this property to apply an external stylesheet to the html. Keep in mind, there will be a slight pause until the stylesheet loads.

 

Method 2: object-based

you can also pass in an actionscript object based stylesheet. this format is almost instananeous.

// Method 1 import redrocketcms.components.RRDescription; RRDescription.STYLESHEET= "/assets/style/style.css" //Method 2 import TextField.StyleSheet; import redrocketcms.components.RRDescription; var ss:StyleSheet = new StyleSheet(); ss.setStyle("emphasized", {color:'#000000',fontWeight:'bold'}); RRDescription.STYLESHEET = ss;

e onPageChange()

Event fired when the page property of the description instance changes.

e styleLoaded()

Event that fires when a stylesheet is loaded an applied to the instance. This even tgets fired even if the stylesheet is not external.

e htmlReady()

Event that fires once the instance is ready. For some strange reason, when applying html to a textfield in flash, the metrics of the textfield are not available immediately. This function fires once the sizes.rendering is complete and ready to go.

Context

redrocketcms.classes.collector.auditable.Context

 

The base class for contextual classes Title and Description.

p font:String (Font Face)

Write-only. Sets the font face of the Component. Use "_sans" for non-embedded fonts. Also, keep in mind that the Component sees this value as a String literal, so if you embed fonts in the library, for example "Arial", do not use the psudo-font "*Arial" as it wil not work correctly. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

p size:Number (Font Size)

Write-only. Sets the size of the text. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

 

p leading:Number (Leading (Pixels))

Write-only. Sets the Leading, or line spacing between each line of text. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

 

p letterSpacing:Number (Letter Spacing)

Write-only. Sets the spacing, in pixels between each character.

p bold:Boolean (Set as Bold)

Write-only. Sets the text as bold. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

 

p italic:Boolean (Set as Italic)

Write-only. Sets the text as italic. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

 

p align:String (Justification)

Write-only. Sets the justification, or horizontal alignment of the text. Four possible values:

 

  • "—-" (3 dashes) - allow the formatting from the rich-text editor to control justification
  • "left" - aligns left
  • "right" - aligns right
  • "center" - centers text
  • "justify" - evenly spaces out each line so that the text aligns both left and right

 

p color:Number (Font Color (0x000000))

Write-only. Sets the color of the text using hexadecimal notation (0x00000) without parenthesis. A value of "—-" (3 dashes) will not set the format, but allow the formatting from the rich-text editor to control it.

 

p embedFonts:Boolean (Embed Font Glyphs)

Write-only. If true, allows flash to render the text with internal font outlines. Use caution here. If you set this value to true, but dont embed the font you specify in the "Font Face" property, the text will just fail to show up.

 

Another important thing to keep in mind is that the Description class contains html text, which may or may not contain bold and italic text. If you choose to embed fonts, and bold and/or italic words exist, those outlines must be embedded in the movie as well, or they too will fail to show up.

p autoSize:Boolean (Auto Size)

Write-only. Sets the sizing method of the textfield. Four possible values:

 

  • "none" - the size of the textfield will be the size of the bounding box of the component. if there are more lines than there are viewable lines in the textfield, the remaining text will be hidden (unless you enable the scrollbar)
  • "left" - sizes the component by keeping the width the same, and expanding the component height to match the maximum viewable size for the textfield.
  • "right" - sizes the component by keeping the width the same, and expanding the component height to match the maximum viewable size for the textfield.
  • "center" - sizes the component by keeping the width the same, and expanding the component height to match the maximum viewable size for the textfield.

 

Note: setting autoSize to anything other than "none" will trigger a "resize" event when it resizes.

p multiline:Boolean (Multiline + Wordwrap)

Write-only. Sets both the multiline and wordwrap in the same property. Note: Title by default is set to false, Description, by default is set to true.

p selectable:Boolean (Set as Selectable)

Write-only. If true, allows the user to select (copy) the text from the textfield.

p border:Boolean (Show Border)

Write-only. Sets the visibility of the textfield border.

p background:Boolean (Show Background)

Write-only. If true, sets an opaque background to the textfield.

p borderColor:Number (Border Color)

Write-only. Sets the color of the border. Applies only if the border property is set to true. Use hexadecimal notion without quotes (i.e 0x000000)

p backgroundColor:Number (Background Color)

Write-only. Sets the color of the background. Applies only if the background property is set to true. Use hexadecimal notion without quotes (i.e 0x000000)

p aliasType:String (Anti-Alias Policy)

Write-only. Sets the antialiasing of the textfield. The use of "Crisp" or "Sharp" use flash 8’s new text rendring capabilities. There are 3 options, and the floow closely to Adobe Photoshop’s alias settings.

  • "Strong" - strong aliasing for large fonts
  • "Crisp" - sharper aliasing for small text
  • "Sharp" - pixel snapping. much like ClearType

 

p text:String

Read/Write. You can read/write the contents of the textfield at will if you wish to overwirte//modify/animate. If the text conatins html code, it will return only the raw text.

p htmlText:String

Read/Write. You can read/write the contents of the textfield at will if you wish to overwirte//modify/animate. If the text does not contain html code, it will wrap the return text in a html wrapper with all the style information.

p textWidth:Number

Read-only. Returns the width of the text within the bouding box of the textfield.

p textHeight:Number

Read-only. Returns the height of the text within the bouding box of the textfield.

Collector

redrocketcms.classes.Collector

 

The Collector class searches for data within it’s heirarcy. It will search for the closeset Provider and store the data.

p data:Object

The data property is a dump of the data that feeds the Component/Class. Typically, this is an object with properties or sub-objects that have exhaustive data realting to the component.

 

To find out what is in the data object you could write something like this:

// where _api is the component/class you are trying to read from. var data = _api.data; for (var prop in data) trace (prop + ": " + data[prop]);

Component

thetainteractive.classes.architecture.Component

 

This is the base class for any class that is a Libray-based component. This class sets up the EventDispatcher, and base functions.

m setSize(width:Number, height:Number):Void

Sets the size of the bounding box of the component.

 

param width:Number

the size, in pixels of the width of the component. pass null if you do not want to set a width.

 

param height:Number

the size, in pixels of the height of the component. pass null if you do not want to set a height.

 

see also:

width

height

p width:Number

Sets the size of the component width in pixels.

p height:Number

Sets the size of the component height in pixels.

m move(x:Number, y:Number):Void

Moves the component.

 

param x:Number

moves the component x pixels horizontally.

 

param y:Number

moves the component y pixels vertically.

m invalidate()

The invalidate function is a very important function. Usually, invalidate is called internally by other methods to redraw the component.

 

However, it is a public method, and by calling invalidate() on any component that uses an invalidation routine essentially "redraws" the entire component.

 

Care should be taken not to continually call invaidate() on any one component on a loop or onEnterFrame() function. invalidate is usually processor and memory intensive for one frame, so be sure to call it when you are sure that you want the component to redraw.

 

Another note is that many of the components are nested within other components, and they are linked together visually. Therefore, calling invalidate() on one component may cause multiple ares to redraw, again, another reason to use sparingly.

e resize()

Event dispatched to listeners when the setSize() method is called. Note: this is also called if the width/height propeties are set.

e move()

Event Dispathced when the component is moved using the move() method.