fl.livepreview
public class LivePreviewParent
继承LivePreviewParent Inheritance MovieClip Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

LivePreviewParent 类为 SWC 文件或选择 ActionScript 3.0 时要导出的编译剪辑提供时间轴。

在组件实例上设置属性或者在舞台上调整组件实例大小时,Flash 会调用该类的方法,后者又将调用组件代码中的方法来设置属性并调整组件大小。

如果您的组件在处于实时预览模式时必须实现特定动作,请使用下面的代码来测试实时预览模式:

var isLivePreview:Boolean = (parent != null && getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent");

LivePreviewParent 类支持定义 setSize() 方法,该方法使用 widthheight 值来调整组件大小。 如果不定义 setSize() 方法,该对象将单独设置 widthheight 属性。

也可以使用该类,在不创建 SWC 文件的情况下,创建自定义实时预览 SWF 文件;不过,通过下列方式来创建组件实时预览文件也许更容易:

若要以这种方式创建组件实时预览文件,请执行以下步骤:

  1. 创建一个新的 Flash 文档。
  2. 将其文档类设置为 fl.livepreview.LivePreviewParent。
  3. 将组件拖到舞台上并将其放在 x 和 y 坐标均为 0 的位置。
  4. 检查以确保组件参数保持为默认设置。 如果从“库”面板或“组件”面板拖动组件,请执行以上相同的操作。
  5. 从主菜单中选择“修改”>“文档”,然后针对“匹配”选项单击“内容”。
  6. 单击“确定”。
  7. 发布该文件以查看作为自定义实时预览 SWF 文件的结果 SWF 文件。
  8. 在库面板中右键单击该资源,并从上下文菜单中选择组件定义。
  9. 在“组件定义”对话框中,可以为组件指定自定义实时预览 SWF 文件。

在某些情况下,您可能希望使用与您的组件完全不同的自定义实时预览 SWF 文件。 请查看 fl.containers.UILoader 组件的实时预览,以了解这样的示例。 该实时预览不使用 UILoader 的属性,也不实现这些属性的 getter 和 setter 函数。 不过,它要实现 setSize() 方法,该方法使用 widthheight 参数,以新的大小来绘制组件。




公共 属性
 属性定义方
 InheritedaccessibilityProperties : AccessibilityProperties
此显示对象的当前辅助功能选项。
DisplayObject
 Inheritedalpha : Number
指示指定对象的 Alpha 透明度值。
DisplayObject
 InheritedblendMode : String
BlendMode 类中的一个值,用于指定要使用的混合模式。
DisplayObject
 InheritedbuttonMode : Boolean
指定此 sprite 的按钮模式。
Sprite
 InheritedcacheAsBitmap : Boolean
如果设置为 true,则 Flash Player 将缓存显示对象的内部位图表示形式。
DisplayObject
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritedcontextMenu : ContextMenu
指定与此对象相关联的上下文菜单。
InteractiveObject
 InheritedcurrentFrame : int
[read-only] 指定播放头在 MovieClip 实例的时间轴中所处的帧的编号。
MovieClip
 InheritedcurrentLabel : String
[read-only] 在 MovieClip 实例的时间轴中播放头所在的当前标签。
MovieClip
 InheritedcurrentLabels : Array
[read-only] 返回由当前场景的 FrameLabel 对象组成的数组。
MovieClip
 InheritedcurrentScene : Scene
[read-only] 在 MovieClip 实例的时间轴中播放头所在的当前场景。
MovieClip
 InheriteddoubleClickEnabled : Boolean
指定此对象是否接收 doubleClick 事件。
InteractiveObject
 InheriteddropTarget : DisplayObject
[read-only] 指定拖动 sprite 时经过的显示对象,或放置 sprite 的显示对象。
Sprite
 Inheritedenabled : Boolean
一个布尔值,指示影片剪辑是否处于活动状态。
MovieClip
 Inheritedfilters : Array
包含当前与显示对象关联的每个滤镜对象的索引数组。
DisplayObject
 InheritedfocusRect : Object
指定此对象是否显示焦点矩形。
InteractiveObject
 InheritedframesLoaded : int
[read-only] 从流式 SWF 文件加载的帧数。
MovieClip
 Inheritedgraphics : Graphics
[read-only] 指定属于此 sprite 的 Graphics 对象,在此 sprite 中可执行矢量绘画命令。
Sprite
 Inheritedheight : Number
指示显示对象的高度,以像素为单位。
DisplayObject
 InheritedhitArea : Sprite
指定一个 sprite 用作另一个 sprite 的点击区域。
Sprite
 InheritedloaderInfo : LoaderInfo
[read-only] 返回一个 LoaderInfo 对象,其中包含加载此显示对象所属的文件的相关信息。
DisplayObject
 Inheritedmask : DisplayObject
调用显示对象被指定的 mask 对象遮罩。
DisplayObject
 InheritedmouseChildren : Boolean
确定对象的子项是否支持鼠标。
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
指定此对象是否接收鼠标消息。
InteractiveObject
 InheritedmouseX : Number
[read-only] 指示鼠标位置的 x 坐标,以像素为单位。
DisplayObject
 InheritedmouseY : Number
[read-only] 指示鼠标位置的 y 坐标,以像素为单位。
DisplayObject
  myInstance : DisplayObject
组件实例。
LivePreviewParent
 Inheritedname : String
指示 DisplayObject 的实例名称。
DisplayObject
 InheritednumChildren : int
[read-only] 返回此对象的子项数目。
DisplayObjectContainer
 InheritedopaqueBackground : Object
指定显示对象是否由于具有某种背景颜色而不透明。
DisplayObject
 Inheritedparent : DisplayObjectContainer
[read-only] 指示包含此显示对象的 DisplayObjectContainer 对象。
DisplayObject
 Inheritedprototype : Object
[static] 对类或函数对象的原型对象的引用。
Object
 Inheritedroot : DisplayObject
[read-only] 对于加载的 SWF 文件中的显示对象,root 属性是此 SWF 文件所表示的显示列表树结构部分中的顶级显示对象。
DisplayObject
 Inheritedrotation : Number
指示 DisplayObject 实例距其原始方向的旋转程度,以度为单位。
DisplayObject
 Inheritedscale9Grid : Rectangle
当前有效的缩放网格。
DisplayObject
 InheritedscaleX : Number
指示从注册点开始应用的对象的水平缩放比例(百分比)。
DisplayObject
 InheritedscaleY : Number
指示从对象注册点开始应用的对象的垂直缩放比例(百分比)。
DisplayObject
 Inheritedscenes : Array
[read-only] 一个由 Scene 对象组成的数组,每个对象都列出了 MovieClip 实例中场景的名称、帧数和帧标签。
MovieClip
 InheritedscrollRect : Rectangle
显示对象的滚动矩形范围。
DisplayObject
 InheritedsoundTransform : SoundTransform
控制此 sprite 中的声音。
Sprite
 Inheritedstage : Stage
[read-only] 显示对象的舞台。
DisplayObject
 InheritedtabChildren : Boolean
确定对象的子项是否支持 Tab 键。
DisplayObjectContainer
 InheritedtabEnabled : Boolean
指定此对象是否遵循 Tab 键顺序。
InteractiveObject
 InheritedtabIndex : int
指定 SWF 文件中的对象按 Tab 键顺序排列。
InteractiveObject
 InheritedtextSnapshot : TextSnapshot
[read-only] 返回此 DisplayObjectContainer 实例的 TextSnapshot 对象。
DisplayObjectContainer
 InheritedtotalFrames : int
[read-only] MovieClip 实例中帧的总数。
MovieClip
 InheritedtrackAsMenu : Boolean
指示属于 SimpleButton 或 MovieClip 对象的其它显示对象是否可以接收鼠标释放事件。
MovieClip
 Inheritedtransform : Transform
一个对象,具有与显示对象的矩阵、颜色转换和像素范围有关的属性。
DisplayObject
 InheriteduseHandCursor : Boolean
布尔值,指示当鼠标滑过其 buttonMode 属性设置为 true 的 sprite 时是否显示手指形(手形光标)。
Sprite
 Inheritedvisible : Boolean
显示对象是否可见。
DisplayObject
 Inheritedwidth : Number
指示显示对象的宽度,以像素为单位。
DisplayObject
 Inheritedx : Number
指示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 x 坐标。
DisplayObject
 Inheritedy : Number
指示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 y 坐标。
DisplayObject
公共 方法
 方法定义方
  
初始化舞台的缩放和对齐模式、设置 myInstance 属性、将 myInstance 调整到适当大小,以及使用 ExternalInterface 类将函数公开给 Flash。
LivePreviewParent
 Inherited
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
DisplayObjectContainer
 Inherited
将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。
DisplayObjectContainer
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦听器对象,以使侦听器能够接收事件通知。
EventDispatcher
 Inherited
指示安全限制是否会导致出现以下情况:在列表中忽略了使用指定 point 点调用 DisplayObjectContainer.getObjectsUnderPoint() 方法时返回的所有显示对象。
DisplayObjectContainer
 Inherited
确定指定显示对象是 DisplayObjectContainer 实例的子项还是该实例本身。
DisplayObjectContainer
 Inherited
将事件调度到事件流中。
EventDispatcher
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。
DisplayObject
 Inherited
返回位于指定索引处的子显示对象实例。
DisplayObjectContainer
 Inherited
返回具有指定名称的子显示对象。
DisplayObjectContainer
 Inherited
返回 DisplayObject 的 child 实例的索引位置。
DisplayObjectContainer
 Inherited
返回对象的数组,这些对象位于指定点下,并且是该 DisplayObjectContainer 实例的子项(或孙子项,依此类推)。
DisplayObjectContainer
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
返回一个矩形,该矩形根据 targetCoordinateSpace 参数定义的坐标系定义显示对象的边界,但不包括形状上的任何笔触。
DisplayObject
 Inherited
将 point 对象从舞台(全局)坐标转换为显示对象的(本地)坐标。
DisplayObject
 Inherited
gotoAndPlay(frame:Object, scene:String = null):void
从指定帧开始播放 SWF 文件。
MovieClip
 Inherited
gotoAndStop(frame:Object, scene:String = null):void
将播放头移到影片剪辑的指定帧并停在那里。
MovieClip
 Inherited
检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。
EventDispatcher
 Inherited
指示对象是否已经定义了指定的属性。
Object
 Inherited
计算显示对象,以确定它是否与 obj 显示对象重叠或相交。
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
计算显示对象,以确定它是否与 x 和 y 参数指定的点重叠或相交。
DisplayObject
 Inherited
指示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
将 point 对象从显示对象的(本地)坐标转换为舞台(全局)坐标。
DisplayObject
 Inherited
将播放头转到下一帧并停止。
MovieClip
 Inherited
将播放头移动到 MovieClip 实例的下一场景。
MovieClip
  
onResize(width:Number, height:Number):void
通过调用用户定义的方法,或者通过单独设置 width 和 height 属性,将舞台上组件实例的大小调整为指定尺寸。
LivePreviewParent
  
onUpdate(... updateArray):void
更新组件实例的属性。
LivePreviewParent
 Inherited
在影片剪辑的时间轴中移动播放头。
MovieClip
 Inherited
将播放头转到前一帧并停止。
MovieClip
 Inherited
将播放头移动到 MovieClip 实例的前一场景。
MovieClip
 Inherited
指示指定的属性是否存在、是否可枚举。
Object
 Inherited
从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。
DisplayObjectContainer
 Inherited
从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦听器。
EventDispatcher
 Inherited
更改现有子项在显示对象容器中的位置。
DisplayObjectContainer
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
允许用户拖动指定的 Sprite。
Sprite
 Inherited
停止影片剪辑中的播放头。
MovieClip
 Inherited
结束 startDrag() 方法。
Sprite
 Inherited
交换两个指定子对象的 Z 轴顺序(从前到后顺序)。
DisplayObjectContainer
 Inherited
swapChildrenAt(index1:int, index2:int):void
在子级列表中两个指定的索引位置,交换子对象的 Z 轴顺序(前后顺序)。
DisplayObjectContainer
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。
EventDispatcher
事件
 事件摘要定义方
 Inherited Flash Player 获得操作系统焦点并变为活动状态时调度。EventDispatcher
 Inherited 将显示对象添加到显示列表中时调度。DisplayObject
 Inherited 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。DisplayObject
 Inherited 用户在同一 InteractiveObject 上按下并释放用户指针设备的主按钮时调度。InteractiveObject
 Inherited Flash Player 失去操作系统焦点并变为非活动状态时调度。EventDispatcher
 Inherited 如果 InteractiveObject 的 doubleClickEnabled 标志设置为 true,当用户在该对象上快速连续按下两次并释放指针设备的主按钮时调度。InteractiveObject
 Inherited 播放头进入新帧时调度。DisplayObject
 Inherited 显示对象获得焦点后调度。InteractiveObject
 Inherited 显示对象失去焦点后调度。InteractiveObject
 Inherited 用户按下某个键时调度。InteractiveObject
 Inherited 用户尝试使用键盘导航更改焦点时调度。InteractiveObject
 Inherited 用户释放某个键时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户在 InteractiveObject 实例上按下指针设备按钮时调度。InteractiveObject
 Inherited 用户尝试使用指针设备更改焦点时调度。InteractiveObject
 Inherited 用户移动 InteractiveObject 上的指针设备时调度。InteractiveObject
 Inherited 用户将指针设备从 InteractiveObject 实例上移开时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户将指针设备移动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,用户在 InteractiveObject 实例上释放指针设备按钮时调度。InteractiveObject
 Inherited 在 Flash Player 窗口中,鼠标滚轮滚动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited 将要从显示列表中删除显示对象时调度。DisplayObject
 Inherited 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。DisplayObject
 Inherited 将要更新和呈现显示列表时调度。DisplayObject
 Inherited 用户将指针设备从 InteractiveObject 实例上移开时调度。InteractiveObject
 Inherited 用户将指针设备移动到 InteractiveObject 实例上时调度。InteractiveObject
 Inherited 对象的 tabChildren 标志值发生更改时调度。InteractiveObject
 Inherited 对象的 tabEnabled 标志发生更改时调度。InteractiveObject
 Inherited 对象的 tabIndex 属性值发生更改时调度。InteractiveObject
属性详细信息
myInstance属性
public var myInstance:DisplayObject

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

组件实例。

构造函数详细信息
LivePreviewParent()构造函数
public function LivePreviewParent()

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

初始化舞台的缩放和对齐模式、设置 myInstance 属性、将 myInstance 调整到适当大小,以及使用 ExternalInterface 类将函数公开给 Flash。

方法详细信息
onResize()方法
public function onResize(width:Number, height:Number):void

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

通过调用用户定义的方法,或者通过单独设置 widthheight 属性,将舞台上组件实例的大小调整为指定尺寸。

该方法由 Flash Player 调用。

参数

width:NumbermyInstance 实例的新宽度。
 
height:NumbermyInstance 实例的新高度。

onUpdate()方法 
public function onUpdate(... updateArray):void

语言版本 : ActionScript 3.0
Player 版本 : Flash Player 9.0.28.0

更新组件实例的属性。 当属性值发生变化时,Flash Player 将调用该方法。 该方法更新所有的组件属性(无论它们是否发生了变化)。

参数

... updateArray — 参数名称和值的数组。





 

评论添加到页面后给我发送电子邮件 | 评论报告

当前页: http://livedocs.adobe.com/flash/9.0_cn/ActionScriptLangRefV3/fl/livepreview/LivePreviewParent.html