SimpleCard is a skinnable renderer for an IAttachment. It implements IListItemRenderer,
so it can be used as an item renderer for relevant containers. The skin is not required
to provide all the relevant controls, which allows this object to act as the core for
both simple (mini-nav) and complex (basic click-through card) rendering.
[override]
Returns the current skin state of this instance, which is
a variant of the component state depending on
whether or not the component is selected.
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
Skin Part
Description
Defined By
icon:mx.controls.Image
Required: false Part Type: Static
The icon image for the card
SimpleCard
paddingGroup:mx.core.UIComponent
Required: false Part Type: Static
A UI Component whose left/right/top/bottom values can be adjusted to fit card
UI to a particular aspect ratio without affecting the bounds of the card.
SimpleCard
ribbon:spark.components.Group
Required: false Part Type: Static
A skin part representing the ribbon component that should be visible when the user
is editing the attament in an external application.
SimpleCard
Skin States
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
Enables and disables double click events for this card.
Implementation public function set doubleClickEnabled(value:Boolean):void
downSampleOK
property
downSampleOK:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Indicates whether it is OK to reduce the size of the
image.
Implementation public function get downSampleOK():Boolean public function set downSampleOK(value:Boolean):void
dragging
property
dragging:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the item renderer is being dragged;
otherwise false.
Implementation public function get dragging():Boolean public function set dragging(value:Boolean):void
dropShadowPreference
property
dropShadowPreference:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The drop shadow effect preference. This is a string specifying
the preferred location for a drop shadow effect on this component.
This is used as a hint to skins when specifying filters. The
possible values are "none", "bottom", and "rear".
This property can be used as the source for data binding.
Implementation public function get dropShadowPreference():String public function set dropShadowPreference(value:String):void
Indicates whether generation of the thumbnail image is enabled or not.
Implementation public function get enableThumbnailGeneration():Boolean public function set enableThumbnailGeneration(value:Boolean):void
fileName
property
fileName:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The file name of this card's underlying attachment.
This property can be used as the source for data binding.
Implementation public function get fileName():String public function set fileName(value:String):void
generateThumb
property
generateThumb:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Indicates whether or not to generate a thumbnail image for the card
Implementation public function get generateThumb():Boolean public function set generateThumb(value:Boolean):void
invalidPreview
property
protected var invalidPreview:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
If true the preview for this card is invalid.
isOpen
property
isOpen:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the attachment is open in a native editor;
otherwise false.
This property can be used as the source for data binding.
Implementation public function get isOpen():Boolean public function set isOpen(value:Boolean):void
itemIndex
property
itemIndex:int
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The index of the item in the data set
that this renderer is visualizing.
Implementation public function get itemIndex():int public function set itemIndex(value:int):void
label
property
label:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The String to display in the item renderer.
The host component of the item renderer can use the
itemToLabel() method to convert the data item
to a String for display by the item renderer.
For controls like List and ButtonBar, you can use the
labelField or labelFunction properties
to specify the field of the data item that contains the String.
Otherwise the host component uses the toString() method
to convert the data item to a String.
Implementation public function get label():String public function set label(value:String):void
mediumPreviewHasGlow
property
mediumPreviewHasGlow:Boolean [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
A boolean specifying if the skin should apply a glow to the mid-level preview
This property can be used as the source for data binding.
Implementation public function get mediumPreviewHasGlow():Boolean
modDate
property
modDate:Date
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The modification date of this card's underlying attachment.
This property can be used as the source for data binding.
Implementation public function get modDate():Date public function set modDate(value:Date):void
mouseIsOver
property
mouseIsOver:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns true if the mouse is over the card;
returns false otherwise.
Implementation protected function get mouseIsOver():Boolean protected function set mouseIsOver(value:Boolean):void
padding
property
padding:Point [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the horizontal and vertical padding for this UI component.
Implementation public function get padding():Point
preferredPreviewState
property
preferredPreviewState:String [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The preferred preview state for this card
Implementation protected function get preferredPreviewState():String
prefersMediaPreview
property
prefersMediaPreview:Boolean [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Does this card's attachment have a preferredPreviewState of AUDIO or VIDEO
Implementation protected function get prefersMediaPreview():Boolean
A string specifying the preferred type of rollover effect on this component.
This is used as a hint to skins when specifying filters.
Possible values are "none", "glow", and "scale".
This property can be used as the source for data binding.
Implementation public function get rollOverPreference():String public function set rollOverPreference(value:String):void
Implementation public function set visible(value:Boolean):void
Constructor Detail
SimpleCard
()
Constructor
public function SimpleCard()
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Default constructor for SimpleCard.
Method Detail
commitProperties
()
method
override protected function commitProperties():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Save the current properties of this card.
extensionFromAttachment
()
method
protected function extensionFromAttachment():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns the file extension for the attachment.
If the attachment is a folder, this returns null.
Returns
String
generateThumbnail
()
method
protected function generateThumbnail():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Generate a thumbnail image for the underlying attachment.
getAspectRatio
()
method
protected function getAspectRatio():Number
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the aspect ratio of the thumbnail for the attachment.
Returns
Number — The aspect ratio as a single number representing width/height
getCurrentSkinState
()
method
override protected function getCurrentSkinState():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns the current skin state of this instance, which is
a variant of the component state depending on
whether or not the component is selected.
Returns
String
getDimensionsUsingPreview
()
method
public function getDimensionsUsingPreview(fitWidth:Number, fitHeight:Number):Point
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the dimensions of the preview image.
getDimensionsUsingPreview() takes into consideration
both the padding and the aspect ratio when calculating the
dimensions. The padding does not affect the aspect ratio.
Parameters
fitWidth:Number — The maximum width to allow
fitHeight:Number — The maximum height to allow
Returns
Point — The width and height of the preview image as an
ordered pair: (width, height).
getPreviewSize
()
method
protected function getPreviewSize():Point
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the size of the preview image
Returns
Point — the width and height of the preview image as an (x,y) pair.
handlePreview
()
method
protected function handlePreview():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Have the collectionManager handle the preview for
the underlying attachment.
hostPageCountChanged
()
method
protected function hostPageCountChanged(val:uint):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
This function is called if the page count of the multipage model
has changed
Parameters
val:uint — If 0 then do nothing; otherwise invalidate the preview.
initPageCount
()
method
protected function initPageCount():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Initialize the page count for the preview multipage model
to the page count of the underlying attachement.
invalidatePreview
()
method
public function invalidatePreview(invalidateModel:Boolean = false, generateThumb:Boolean = true):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Invalidate the current preview state for the card
Parameters
invalidateModel:Boolean (default = false) — If true then nulify the preview model.
generateThumb:Boolean (default = true) — If true then generate a thumbnail image.
invalidatePreviewFromSetData
()
method
protected function invalidatePreviewFromSetData():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Invalidate the preview because a new data object to be rendered has been set
mimeTypeFromAttachment
()
method
protected function mimeTypeFromAttachment():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns the MIME type for the attachment.
If the attachment is a folder, this returns null.
Returns
String
onAspectRatioChanged
()
method
protected function onAspectRatioChanged(event:PropertyChangeEvent):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The event handler for changes in aspect ratio of the thumbnail.
Parameters
event:PropertyChangeEvent — the change in aspect ratio event
onAttachmentChange
()
method
protected function onAttachmentChange(evt:Event):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Handles changes in the underlying attachement events
Parameters
evt:Event — The change in the underlying attachement event
onEnableDynamicThumbnails
()
method
protected function onEnableDynamicThumbnails(value:Boolean):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Handle the enabling of dynamic thumbnails.
This function makes sure that cards supporting multi-page
start listening for page events.
Parameters
value:Boolean — If true cards supporting multi-page
will start listening for page events.
onHostPropertyChange
()
method
protected function onHostPropertyChange(event:PropertyChangeEvent):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
A listener for PropertyChangeEvents on the collectionManager.
Parameters
event:PropertyChangeEvent — The host's PropertyChangeEvent to be handled.
onIconChange
()
method
protected function onIconChange(event:Event):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Handle icon change events
Parameters
event:Event — icon change event
partAdded
()
method
override protected function partAdded(partName:String, instance:Object):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
This function is called when a skin has added a skin part for this card instance.
Parameters
partName:String
instance:Object
partRemoved
()
method
override protected function partRemoved(partName:String, instance:Object):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
This function is called when a skin has removed a skin part for this card instance.
Parameters
partName:String
instance:Object
setAspectRatio
()
method
protected function setAspectRatio(value:Number, mediaValue:Boolean = false):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Set the aspect ratio of the thumbnail for the attachment.
Parameters
value:Number — The aspect ratio as a single number representing width/height
mediaValue:Boolean (default = false) — Set to true if the card for an audio or
video attachment; otherwise set to false.
setAspectRatioField
()
method
protected function setAspectRatioField(value:Number):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Set the aspect ratio of the appropriate field for the attachment
Parameters
value:Number — The aspect ratio as a single number representing width/height
setLayoutBoundsSize
()
method
override public function setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean = true):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Sets the layout size of the card. This is the size that
the card element uses to draw on screen.
If the width and/or height parameters are left unspecified,
Flex sets the element's layout size to its preferred width and/or
preferred height.
Note that calls to the setLayoutBoundSize() method can affect
the layout position, so call setLayoutBoundPosition() after
calling setLayoutBoundSize().
Parameters
width:Number — The desired width for the card
height:Number — The desired height for the card
postLayoutTransform:Boolean (default = true) — When postLayoutTransform is true,
the specified sizes are those of the card's bounding box. The bounding box
is in card's parent coordinate space and is calculated from the card's layout size,
layout position and layout transform matrix.
toString
()
method
override public function toString():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The String to display in the item renderer.
For controls that do not have labelField
or labelFunction properties to specify the field
of the data item that contains the string to display,
use toString() to convert the data item to a string.
Returns
String — The String to display in the item renderer.
updatePreview
()
method
protected function updatePreview(oldRenderer:ISimpleCard):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Update the preview for this card.
Parameters
oldRenderer:ISimpleCard — The previous simpleCard renderer to use
as the basis for the updated preview
updatePreviewModelListeners
()
method
protected function updatePreviewModelListeners(adding:Boolean):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Update the listeners for preview model events.
Parameters
adding:Boolean — Set to true if you are adding attachments
updateRenderer
()
method
public function updateRenderer(oldRenderer:ISimpleCard):void