Packagecom.adobe.portfolio.previews
Classpublic class Preview
InheritancePreview Inheritance NavSkinnableComponent Inheritance spark.components.supportClasses.SkinnableComponent
Implements IPreview

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The Preview class extends NavSkinnableComponent to preview single and multipage documents, as well as audio and video content.



Public Properties
 PropertyDefined By
  aspectRatio : Number
The aspect ratio of the preview
Preview
  doubleClickEnabled : Boolean
[override] [write-only] Override to propagate the doubleClickEnabled property to sub-components of Preview.
Preview
  enabled : Boolean
[override]
Preview
  model : IPreviewModel
The current preview model.
Preview
  pageNavigationEnabled : Boolean
Whether page navigation is enabled (via keyboard, mousewheel)
Preview
 InheritedskinState : String
The current skin state
NavSkinnableComponent
  smallPreview : Boolean
Whether the preview is a "small" preview that should not have next/prev buttons in the multipage case.
Preview
  thumbnailPriority : int
The priority for generating this thumbnail.
Preview
  usePlatformPreview : Boolean
[read-only] Whether this preview should use platform preview (as opposed to navigator preview).
Preview
Protected Properties
 PropertyDefined By
 InheritedautoListen : AutoListen
NavSkinnableComponent
 InheritedautoWatch : AutoWatch
NavSkinnableComponent
  deferredRequest : Object
Preview
  lastAttachmentRequest : IAttachment
Preview
  modelWatcher : ChangeWatcher
Preview
  thumbnailMgr : ThumbnailManager
[static]
Preview
  thumbsData : Object
Preview
Public Methods
 MethodDefined By
  
Constructor.
Preview
 Inherited
Creates autoListen and autoWatch for automatically tracking listeners and watchers.
NavSkinnableComponent
  
generateThumbnail(id:*, attachment:IAttachment, previewSize:Point = null, downSampleOK:Boolean = true, onThumbComplete:Function = null):void
Generate a thumbnail.
Preview
  
Return true if the preview is a single or multipage preview (not an audio or video).
Preview
 Inherited
Uses autoListen and autoWatch to remove all listeners and watchers.
NavSkinnableComponent
 Inherited
setCurrentState(stateName:String, playTransition:Boolean = true):void
[override] Sets the current component state and skin state.
NavSkinnableComponent
  
Stop the playback of media content in this preview.
Preview
Protected Methods
 MethodDefined By
 Inherited
addListener(listener:IEventDispatcher, type:String, handler:Function, useCapture:Boolean = false, priority:int = 0):void
NavSkinnableComponent
 Inherited
addWatcher(watcher:ChangeWatcher):void
NavSkinnableComponent
  
attachSkin():void
[override]
Preview
 Inherited
detachSkin():void
[override]
NavSkinnableComponent
  
ensureMultipageThumbnailsReady(bottomPage:int, topPage:int):void
Preview
  
[override]
Preview
  
getModelThumbnail(pageNumber:int):Bitmap
Preview
  
initStates():void
[override]
Preview
  
measure():void
[override]
Preview
  
onScrollComplete(e:Event):void
Preview
  
partAdded(partName:String, instance:Object):void
[override]
Preview
  
partRemoved(partName:String, instance:Object):void
[override]
Preview
  
requestMultiPageThumbnails(id:*, attachment:IAttachment, previewSize:Point = null, downSampleOK:Boolean = true, onThumbComplete:Function = null):void
Preview
  
requestThumbnail(id:*, attachment:IAttachment, previewSize:Point, pageNumber:uint, downSampleOK:Boolean, priority:int, onThumbComplete:Function = null):void
Preview
  
setModelThumbnail(thumbnail:Bitmap, pageNumber:int):void
Preview
  
shouldUseNewBitmap(oldBitmap:BitmapData, newBitmap:BitmapData):Boolean
Returns true if newBitmap dimensions are a sufficiently better fit than oldBitmap given the current dimensions of the preview; false otherwise.
Preview
Events
 Event Summary Defined By
  Dispatched when the user requests to extract the previewed content.Preview
  Dispatched when the user requests to show info for the previewed content.Preview
Skin Parts

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
  Required: false Part Type: Static
An optional skin part that's used to display an audio preview.
Preview
  
icon:mx.controls.Image
Required: false Part Type: Static
An optional skin part that's used to display an icon.
Preview
  
scrollPad:ScrollPad
Required: false Part Type: Static
An optional skin part that's used to display a multi-page preview.
Preview
  
thumbnail:mx.controls.Image
Required: false Part Type: Static
An optional skin part that's used to display a single thumbnail preview.
Preview
  Required: false Part Type: Static
An optional skin part that's used to display a video preview.
Preview
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.


 Skin State Description Defined By
  
audio
Preview
  
audioHover
Preview
  
pagingThumbnail
Preview
  
pagingThumbnailHover
Preview
  
thumbnail
Preview
  
thumbnailHover
Preview
  
video
Preview
  
videoHover
Preview
Public Constants
 ConstantDefined By
  AUDIO : String = audio
[static] The "audio" state of the Preview and its skin.
Preview
  PAGING_THUMBNAIL : String = pagingThumbnail
[static] The "pagingThumbnail" state of the Preview and its skin.
Preview
 InheritedSTATE_DISABLED : String = disabled
[static]
NavSkinnableComponent
 InheritedSTATE_NORMAL : String = normal
[static]
NavSkinnableComponent
  THUMBNAIL : String = thumbnail
[static] The "thumbnail" state of the Preview and its skin.
Preview
  VIDEO : String = video
[static] The "video" state of the Preview and its skin.
Preview
Property Detail
aspectRatioproperty
aspectRatio:Number

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The aspect ratio of the preview

This property can be used as the source for data binding.


Implementation
    public function get aspectRatio():Number
    public function set aspectRatio(value:Number):void

See also

deferredRequestproperty 
protected var deferredRequest:Object

doubleClickEnabledproperty 
doubleClickEnabled:Boolean  [write-only] [override]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Override to propagate the doubleClickEnabled property to sub-components of Preview.


Implementation
    public function set doubleClickEnabled(value:Boolean):void
enabledproperty 
enabled:Boolean[override]


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
lastAttachmentRequestproperty 
protected var lastAttachmentRequest:IAttachment

modelproperty 
model:IPreviewModel

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The current preview model.

This property can be used as the source for data binding.


Implementation
    public function get model():IPreviewModel
    public function set model(value:IPreviewModel):void

See also

modelWatcherproperty 
protected var modelWatcher:ChangeWatcher

pageNavigationEnabledproperty 
pageNavigationEnabled:Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.1
Runtime Versions : Flash Player 10.1, AIR 2.0

Whether page navigation is enabled (via keyboard, mousewheel)

This property can be used as the source for data binding.


Implementation
    public function get pageNavigationEnabled():Boolean
    public function set pageNavigationEnabled(value:Boolean):void
smallPreviewproperty 
smallPreview:Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Whether the preview is a "small" preview that should not have next/prev buttons in the multipage case.

This property can be used as the source for data binding.


Implementation
    public function get smallPreview():Boolean
    public function set smallPreview(value:Boolean):void
thumbnailMgrproperty 
protected static var thumbnailMgr:ThumbnailManager

thumbnailPriorityproperty 
thumbnailPriority:int

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The priority for generating this thumbnail. It can a priority defined by the ThumbnailManager, but is not limited to those values. The priority is used by the ThumbnailManager to control a priority queue for thumbnail generation.


Implementation
    public function get thumbnailPriority():int
    public function set thumbnailPriority(value:int):void

See also

thumbsDataproperty 
protected var thumbsData:Object

usePlatformPreviewproperty 
usePlatformPreview:Boolean  [read-only]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Whether this preview should use platform preview (as opposed to navigator preview).


Implementation
    public function get usePlatformPreview():Boolean
Constructor Detail
Preview()Constructor
public function Preview()

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Constructor.

Method Detail
attachSkin()method
override protected function attachSkin():void

ensureMultipageThumbnailsReady()method 
protected function ensureMultipageThumbnailsReady(bottomPage:int, topPage:int):void

Parameters

bottomPage:int
 
topPage:int

generateThumbnail()method 
public function generateThumbnail(id:*, attachment:IAttachment, previewSize:Point = null, downSampleOK:Boolean = true, onThumbComplete:Function = null):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Generate a thumbnail.

Parameters

id:* — An arbitrary id that is used to prune multiple duplicate requests.
 
attachment:IAttachment — The attachment used to generate the thumbnail.
 
previewSize:Point (default = null) — The desired size of the thumbnail in pixels.
 
downSampleOK:Boolean (default = true) — A boolean that indicates whether it's ok to return a downsampled thumb
 
onThumbComplete:Function (default = null) — An optional callback function that is called when the thumbnail generation is complete. It takes the form

function onThumbComplete(pageNumber:uint, retWidth:Number, retHeight:Number):void

getCurrentSkinState()method 
override protected function getCurrentSkinState():String

Returns
String
getModelThumbnail()method 
protected function getModelThumbnail(pageNumber:int):Bitmap

Parameters

pageNumber:int

Returns
Bitmap
initStates()method 
override protected function initStates():void

isThumbnailState()method 
public function isThumbnailState():Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Return true if the preview is a single or multipage preview (not an audio or video).

Returns
Boolean
measure()method 
override protected function measure():void

onScrollComplete()method 
protected function onScrollComplete(e:Event):void

Parameters

e:Event

partAdded()method 
override protected function partAdded(partName:String, instance:Object):void

Parameters

partName:String
 
instance:Object

partRemoved()method 
override protected function partRemoved(partName:String, instance:Object):void

Parameters

partName:String
 
instance:Object

requestMultiPageThumbnails()method 
protected function requestMultiPageThumbnails(id:*, attachment:IAttachment, previewSize:Point = null, downSampleOK:Boolean = true, onThumbComplete:Function = null):void

Parameters

id:*
 
attachment:IAttachment
 
previewSize:Point (default = null)
 
downSampleOK:Boolean (default = true)
 
onThumbComplete:Function (default = null)

requestThumbnail()method 
protected function requestThumbnail(id:*, attachment:IAttachment, previewSize:Point, pageNumber:uint, downSampleOK:Boolean, priority:int, onThumbComplete:Function = null):void

Parameters

id:*
 
attachment:IAttachment
 
previewSize:Point
 
pageNumber:uint
 
downSampleOK:Boolean
 
priority:int
 
onThumbComplete:Function (default = null)

setModelThumbnail()method 
protected function setModelThumbnail(thumbnail:Bitmap, pageNumber:int):void

Parameters

thumbnail:Bitmap
 
pageNumber:int

shouldUseNewBitmap()method 
protected function shouldUseNewBitmap(oldBitmap:BitmapData, newBitmap:BitmapData):Boolean

Returns true if newBitmap dimensions are a sufficiently better fit than oldBitmap given the current dimensions of the preview; false otherwise.

Parameters

oldBitmap:BitmapData
 
newBitmap:BitmapData

Returns
Boolean
stopPlayback()method 
public function stopPlayback():void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Stop the playback of media content in this preview.

Event Detail
handleFileExtract Event
Event Object Type: com.adobe.portfolio.events.PreviewEvent

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Dispatched when the user requests to extract the previewed content.

See also

handleFileInfo Event  
Event Object Type: com.adobe.portfolio.events.PreviewEvent

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Dispatched when the user requests to show info for the previewed content.

See also

Constant Detail
AUDIOConstant
public static const AUDIO:String = audio

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The "audio" state of the Preview and its skin. Used to preview audio file types.

PAGING_THUMBNAILConstant 
public static const PAGING_THUMBNAIL:String = pagingThumbnail

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The "pagingThumbnail" state of the Preview and its skin. Used to preview multipage file types.

THUMBNAILConstant 
public static const THUMBNAIL:String = thumbnail

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The "thumbnail" state of the Preview and its skin. Used to preview most file types.

VIDEOConstant 
public static const VIDEO:String = video

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The "video" state of the Preview and its skin. Used to preview video file types.