AFComponents.com

Description Pane (AS 3.0) V. 1.1 API Docs



Properties

Name Type Description
content String Text to be shown in the Description Pane.

Example

myDescrPane.content = "This is a test!";
contentStyle Object Defines the appearance of the content in the Description Pane.

  1. align:String - Sets text alignment (left, center, right)
  2. font:String - Sets text font
  3. color:Number - Hexadecimal color value (0x000000) of text
  4. size:Number - text size
  5. embed:Boolean - Embed the font (true) or use device fonts (false). Embedded fonts must be in your library and exported for ActionScript.
  6. isHTML:Boolean - Defines whether text is HTML (true) or not (false)
  7. verticalPadding:Number - Padding on top and bottom of text
  8. horizontalPadding:Number - Padding on left and right of text
  9. autoSize:Boolean - Defines whether Description Pane should resize to content (true) or not (false)
  10. textFormat:TextFormat - ActionScript-only custom TextFormat

Example

myDescrPane.contentStyle = {align:"center", font:"Arial", color:0xFF0000, size:14, embed:false, isHTML:false, verticalPadding:2, horizontalPadding:2, autoSize:true};


ActionScript TextFormat Example

var myTextFormat = new TextFormat();

with (myTextFormat) {
    align = "center";
    font = "Arial";
    color = 0x0000FF;
    size = 15;
}

myDescrPane.contentStyle = {embed:false, isHTML:false, horizontalPadding:5, verticalPadding:5, textFormat:myTextFormat};
delay Object Delay timer to show and hide the Description Pane.

  1. enabled:Boolean - Indicates whether to use delay (true) or not (false).
  2. show:Number - How long to delay before showing the Description Pane (Milliseconds, 1000 = 1 second)
  3. hide:Number - How long to delay before hiding the Description Pane (Milliseconds, 1000 = 1 second)

Example

myDescrPane.delay = {enabled:true, show:0, hide:3000};
offset Object Offsets the Description Pane from it's original position. This allows you to adjust placement when using the setOwner() method (shown below).

  1. x:Number
  2. y:Number

Example

myDescrPane.offset = {x:0, y:100};
shapeStyle Object Defines the style of the Description Pane background.

  1. fill:Boolean - Indicates whether to fill the background (true) or not (false).
  2. fillColor:Number - RGBA color value (0xRRGGBBAA) of fill. The last set of digits (AA) indicate alpha (00 = 0%,  FF = 100%).
  3. stroke:Boolean - Indicates whether to stroke the background (true) or not (false).
  4. strokeColor:Number - RGBA color value (0xRRGGBBAA) of stroke. The last set of digits (AA) indicate alpha (00 = 0%,  FF = 100%).
  5. strokeThickness:Number - Width of the stroke in pixels.
  6. cornerRadius:Number - Radius for rounded rectangle.

Example

myDescrPane.shapeStyle = {fill:true, fillColor:0x00FF0088, stroke:true, strokeColor:0x00000011, strokeThickness:2, radius:7};
transition Mixed Indicates show and hide transition. Can be a string for predefined transitions, or a transition object.

Example

myDescrPane.transition = "Wipe";


ActionScript Transtion Example


import fl.transitions.*;
import fl.transitions.easing.*;

myDescrPane.transition = {type:Wipe, direction:Transition.IN, duration:1, easing:Strong.easeOut, startPoint:2};
visibility String Sets visibility of the Description Pane (on, off, autohide).

  1. DescriptionPaneVisibility.ON - Description Pane is visible by default.
  2. DescriptionPaneVisibility.OFF - Description Pane is not visible by default.
  3. DescriptionPaneVisibility.AUTOHIDE - Description Pane visibility is controlled by owner (see setOwner() method below).

Example

import com.afcomponents.descriptionpane.DescriptionPaneVisibility;

myDescrPane.visibility = DescriptionPaneVisibility.OFF;

Methods

Name Return Type Description
show( void ) Void Shows the Description Pane using the specified transition and delay if it is enabled.

Example

myDescrPane.show();
hide( void ) Void Hides the Description Pane using the specified transition and delay if it is enabled.

Example

myDescrPane.hide();
setOwner( initObj:Object ) Void Sets the owner of the Description Pane. The Description Pane will resize and move with the owner and it will also show and hide when the mouse is over and out of the owner, respectively and visibility is set to DescriptionPaneVisibility.AUTOHIDE.

  1. owner:DisplayObject - The reference to the owner object.
  2. align:String - Optional where the Description Pane will be placed on the owner.
  3. w:Number - Optional new width of the Description Pane as a percentage of the owner (0 = 0%, 0.5 = 50%, 1 = 100%).
  4. h:Number - Optional new width of the Description Pane as a percentage of the owner (0 = 0%, 0.5 = 50%, 1 = 100%).

Example

import com.afcomponents.descriptionpane.DescriptionPanePosition;

myDescrPane.setOwner({owner:some_instance, align:DescriptionPanePosition.BOTTOM_CENTER, w:0.9, h:0.2});

Events

Name Return Value Description
MouseEvent.* Description Pane supports all standard Adobe Flash Mouse Events, unless it is added to an owner with setOwner().

Example

import flash.events.MouseEvent;

function descrPaneClick(event:MouseEvent) {
    trace(event.type);
    trace(event.target);
}
myDescrPane.addEventListener(MouseEvent.CLICK, descrPaneClick);
INITIALIZE target
type
Triggered when the Description Pane is ready for commands.

Example

import com.afcomponents.events.AFComponentEvent;

function descrPaneInit(event:AFComponentEvent) {
    trace(event.target);
    trace(event.type);
}
myDescrPane.addEventListener(AFComponentEvent.INITIALIZE, descrPaneInit);
SHOW target
type
Triggered when the Description Pane show(); method has been called.

Example

import com.afcomponents.events.AFComponentEvent;

function descrPaneShow(event:AFComponentEvent) {
    trace(event.target);
    trace(event.type);
}
myDescrPane.addEventListener(AFComponentEvent.SHOW, descrPaneShow);
HIDE target
type
Triggered when the Description Pane show(); method has been called.

Example

import com.afcomponents.events.AFComponentEvent;

function descrPaneHide(event:AFComponentEvent) {
    trace(event.target);
    trace(event.type);
}
myDescrPane.addEventListener(AFComponentEvent.HIDE, descrPaneHide);
CHANGE target
type
property
value
Triggered any time a property changes on the Description Pane.

Example

import com.afcomponents.events.AFComponentEvent;

function descrPaneChange(event:AFComponentEvent) {
    trace(event.target);
    trace(event.type);
    trace(event.property + " has changed to " + event.value);
}
myDescrPane.addEventListener(AFComponentEvent.CHANGE, descrPaneChange);



© 2005-2007 advanced flash components