PageRenderTime 114ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/src/fp9/com/lookmum/view/Component.as

https://github.com/ricick/lookmum
ActionScript | 881 lines | 458 code | 110 blank | 313 comment | 8 complexity | 92bab6ab367a6566468c48e4d1a89164 MD5 | raw file
  1. package com.lookmum.view
  2. {
  3. import com.lookmum.events.ComponentEvent;
  4. import flash.accessibility.AccessibilityImplementation;
  5. import flash.accessibility.AccessibilityProperties;
  6. import flash.display.DisplayObject;
  7. import flash.display.DisplayObjectContainer;
  8. import flash.display.Graphics;
  9. import flash.display.InteractiveObject;
  10. import flash.display.LoaderInfo;
  11. import flash.display.MovieClip;
  12. import flash.display.Scene;
  13. import flash.display.Sprite;
  14. import flash.display.Stage;
  15. import flash.events.Event;
  16. import flash.events.EventDispatcher;
  17. import flash.events.FocusEvent;
  18. import flash.events.IEventDispatcher;
  19. import flash.events.KeyboardEvent;
  20. import flash.events.MouseEvent;
  21. import flash.geom.Point;
  22. import flash.geom.Rectangle;
  23. import flash.geom.Transform;
  24. import flash.media.SoundTransform;
  25. import flash.text.TextSnapshot;
  26. import flash.ui.ContextMenu;
  27. import flash.utils.getQualifiedClassName;
  28. /**
  29. * Dispatched after a component changes size
  30. * @eventType com.lookmum.events.Event.RESIZE
  31. */
  32. [Event(name="resize", type="com.lookmum.events.Event")]
  33. /**
  34. * Dispatched after a component changes size
  35. * @eventType com.lookmum.events.Event.MOVE
  36. */
  37. [Event(name="move", type="com.lookmum.events.Event")]
  38. /**
  39. * Dispatched after a component shows
  40. * @eventType com.lookmum.events.Event.SHOW
  41. */
  42. [Event(name="show", type="com.lookmum.events.Event")]
  43. /**
  44. * Dispatched after a component hides
  45. * @eventType com.lookmum.events.Event.HIDE
  46. */
  47. [Event(name="hide", type="com.lookmum.events.Event")]
  48. /**
  49. * ...
  50. * @author Phil Douglas
  51. */
  52. public class Component extends MovieClip implements IComponent
  53. {
  54. private var _target:MovieClip;
  55. private var frameCounter: int;
  56. public function Component(target:MovieClip)
  57. {
  58. if (!target)
  59. {
  60. throw new Error('No MovieClip supplied to Component ' + getQualifiedClassName(this));
  61. }
  62. _target = target;
  63. createChildren();
  64. frameCounter = 0;
  65. //addEventListeners();
  66. super.addEventListener(Event.ADDED, onAdded);
  67. target.addEventListener(Event.ENTER_FRAME, onEnterFrame);
  68. arrangeComponents();
  69. }
  70. private function onEnterFrame(e:Event):void
  71. {
  72. frameCounter++;
  73. if (frameCounter == totalFrames)
  74. {
  75. dispatchEvent(new Event(Event.COMPLETE));
  76. }
  77. }
  78. /**
  79. * Listen for added to stage. If component itself is added, swap with target.
  80. * @param e
  81. */
  82. private function onAdded(e:Event):void
  83. {
  84. var _parent:DisplayObjectContainer = super.parent;
  85. if (!_parent) return;
  86. e.stopImmediatePropagation();
  87. var index:int = _parent.getChildIndex(this);
  88. _parent.removeChild(this);
  89. _parent.addChildAt(target, index);
  90. }
  91. /**
  92. * Return the MovieClip being controlled by the component.
  93. */
  94. public function get target():MovieClip { return _target; }
  95. //{region event listeners
  96. override public function addEventListener (type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void {
  97. super.addEventListener(type, listener, useCapture, priority, useWeakReference);
  98. target.addEventListener(type, onEvent, useCapture, priority, useWeakReference);
  99. }
  100. protected function onEvent(e:Event):void {
  101. dispatchEvent(e.clone());
  102. }
  103. /// Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
  104. override public function hasEventListener (type:String) : Boolean{
  105. return target.hasEventListener(type);
  106. }
  107. /// Removes a listener from the EventDispatcher object.
  108. override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void {
  109. super.removeEventListener(type, listener, useCapture);
  110. target.removeEventListener(type, listener, useCapture);
  111. }
  112. /// Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
  113. override public function willTrigger (type:String) : Boolean{
  114. return target.willTrigger(type);
  115. }
  116. //}
  117. /**
  118. * Create any child components
  119. */
  120. protected function createChildren():void {
  121. }
  122. /**
  123. * Arrange any child components
  124. */
  125. protected function arrangeComponents():void{
  126. }
  127. public function setFocus():void {
  128. if (stage) {
  129. stage.focus = target;
  130. }
  131. }
  132. public function getIsFocus():Boolean {
  133. return (stage) ? stage.focus == target : false;
  134. }
  135. /**
  136. * Destroy the component and remove it from the display list.
  137. */
  138. public function destroy():void{
  139. if (parent) {
  140. parent.removeChild(target);
  141. }
  142. }
  143. //{region override MovieClip properties and methods
  144. /**
  145. * Specifies the number of the frame in which the playhead is located in the timeline of the MovieClip instance.
  146. */
  147. override public function get currentFrame () : int {
  148. return target.currentFrame;
  149. }
  150. /**
  151. * The current label in which the playhead is located in the timeline of the MovieClip instance.
  152. */
  153. override public function get currentLabel () : String {
  154. return target.currentLabel;
  155. }
  156. /**
  157. * The label at the current frame in the timeline of the MovieClip instance.
  158. */
  159. /*
  160. override public function get currentFrameLabel () : String {
  161. return target.currentFrameLabel;
  162. }
  163. */
  164. /**
  165. * Returns an array of FrameLabel objects from the current scene.
  166. */
  167. override public function get currentLabels () : Array {
  168. return target.currentLabels;
  169. }
  170. /**
  171. * The current scene in which the playhead is located in the timeline of the MovieClip instance.
  172. */
  173. override public function get currentScene () : Scene {
  174. return target.currentScene;
  175. }
  176. /**
  177. * A Boolean value that indicates whether a movie clip is enabled.
  178. */
  179. override public function get enabled () : Boolean {
  180. return target.enabled;
  181. }
  182. override public function set enabled (value:Boolean) : void {
  183. target.enabled = value;
  184. }
  185. /**
  186. * The number of frames that are loaded from a streaming SWF file.
  187. */
  188. override public function get framesLoaded () : int {
  189. return target.framesLoaded;
  190. }
  191. /**
  192. * An array of Scene objects, each listing the name, the number of frames, and the frame labels for a scene in the MovieClip instance.
  193. */
  194. override public function get scenes () : Array {
  195. return target.scenes;
  196. }
  197. /**
  198. * The total number of frames in the MovieClip instance.
  199. */
  200. override public function get totalFrames () : int {
  201. return target.totalFrames;
  202. }
  203. /**
  204. * Indicates whether other display objects that are SimpleButton or MovieClip objects can receive mouse release events.
  205. */
  206. override public function get trackAsMenu () : Boolean {
  207. return target.trackAsMenu;
  208. }
  209. override public function set trackAsMenu (value:Boolean) : void {
  210. target.trackAsMenu = value;
  211. }
  212. /**
  213. * [Undocumented] Takes a collection of frame (zero-based) - method pairs that associates a method with a frame on the timeline.
  214. */
  215. /*
  216. override public function addFrameScript (frame:int, method:Function) : void {
  217. return target.addFrameScript(frame, method);
  218. }
  219. */
  220. /**
  221. * Starts playing the SWF file at the specified frame.
  222. */
  223. override public function gotoAndPlay (frame:Object, scene:String = null) : void {
  224. return target.gotoAndPlay(frame, scene);
  225. }
  226. /**
  227. * Brings the playhead to the specified frame of the movie clip and stops it there.
  228. */
  229. override public function gotoAndStop (frame:Object, scene:String = null) : void {
  230. return target.gotoAndStop(frame, scene);
  231. }
  232. /**
  233. * Sends the playhead to the next frame and stops it.
  234. */
  235. override public function nextFrame () : void {
  236. return target.nextFrame();
  237. }
  238. /**
  239. * Moves the playhead to the next scene of the MovieClip instance.
  240. */
  241. override public function nextScene () : void {
  242. return target.nextScene();
  243. }
  244. /**
  245. * Moves the playhead in the timeline of the movie clip.
  246. */
  247. override public function play () : void {
  248. return target.play();
  249. }
  250. /**
  251. * Sends the playhead to the previous frame and stops it.
  252. */
  253. override public function prevFrame () : void {
  254. return target.prevFrame();
  255. }
  256. /**
  257. * Moves the playhead to the previous scene of the MovieClip instance.
  258. */
  259. override public function prevScene () : void {
  260. return target.prevScene();
  261. }
  262. /**
  263. * Stops the playhead in the movie clip.
  264. */
  265. override public function stop () : void {
  266. return target.stop();
  267. }
  268. //}
  269. //{region overriden Sprite properties and methods
  270. /**
  271. * Specifies the button mode of this sprite.
  272. */
  273. override public function get buttonMode () : Boolean {
  274. return target.buttonMode;
  275. }
  276. override public function set buttonMode (value:Boolean) : void {
  277. target.buttonMode = value;
  278. }
  279. /**
  280. * Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped.
  281. */
  282. override public function get dropTarget () : DisplayObject {
  283. return target.dropTarget;
  284. }
  285. /**
  286. * Specifies the Graphics object that belongs to this sprite where vector drawing commands can occur.
  287. */
  288. override public function get graphics () : Graphics {
  289. return target.graphics;
  290. }
  291. /**
  292. * Designates another sprite to serve as the hit area for a sprite.
  293. */
  294. override public function get hitArea () : Sprite {
  295. return target.hitArea;
  296. }
  297. override public function set hitArea (value:Sprite) : void {
  298. target.hitArea = value;
  299. }
  300. /**
  301. * Controls sound within this sprite.
  302. */
  303. override public function get soundTransform () : SoundTransform {
  304. return target.soundTransform;
  305. }
  306. override public function set soundTransform (sndTransform:SoundTransform) : void{
  307. target.soundTransform = sndTransform;
  308. }
  309. /**
  310. * A Boolean value that indicates whether the pointing hand (hand cursor) appears when the mouse rolls over a sprite in which the buttonMode property is set to true.
  311. */
  312. override public function get useHandCursor () : Boolean {
  313. return target.useHandCursor;
  314. }
  315. override public function set useHandCursor (value:Boolean) : void {
  316. target.useHandCursor = value;
  317. }
  318. /**
  319. * Lets the user drag the specified sprite.
  320. */
  321. override public function startDrag (lockCenter:Boolean = false, bounds:Rectangle = null) : void {
  322. return target.startDrag(lockCenter, bounds);
  323. }
  324. /**
  325. * Ends the startDrag() method.
  326. */
  327. override public function stopDrag () : void {
  328. return target.stopDrag();
  329. }
  330. override public function toString () : String {
  331. return "[object "+getQualifiedClassName(this)+"]";
  332. }
  333. //}
  334. //{region overriden DisplayObjectContainer properties and methods
  335. /**
  336. * Determines whether or not the children of the object are mouse enabled.
  337. */
  338. override public function get mouseChildren () : Boolean {
  339. return target.mouseChildren;
  340. }
  341. override public function set mouseChildren (enable:Boolean) : void {
  342. target.mouseChildren = enable;
  343. }
  344. /**
  345. * Returns the number of children of this object.
  346. */
  347. override public function get numChildren () : int {
  348. return target.numChildren;
  349. }
  350. /**
  351. * Determines whether the children of the object are tab enabled.
  352. */
  353. override public function get tabChildren () : Boolean {
  354. return target.tabChildren;
  355. }
  356. override public function set tabChildren (enable:Boolean) : void {
  357. target.tabChildren = enable;
  358. }
  359. /**
  360. * Returns a TextSnapshot object for this DisplayObjectContainer instance.
  361. */
  362. override public function get textSnapshot () : TextSnapshot {
  363. return target.textSnapshot;
  364. }
  365. /**
  366. * Adds a child object to this DisplayObjectContainer instance.
  367. */
  368. override public function addChild (child:DisplayObject) : DisplayObject{
  369. return target.addChild(child);
  370. }
  371. /**
  372. * Adds a child object to this DisplayObjectContainer instance.
  373. */
  374. override public function addChildAt (child:DisplayObject, index:int) : DisplayObject{
  375. return target.addChildAt(child, index);
  376. }
  377. /**
  378. * Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point.
  379. */
  380. override public function areInaccessibleObjectsUnderPoint (point:Point) : Boolean {
  381. return target.areInaccessibleObjectsUnderPoint(point);
  382. }
  383. /**
  384. * Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
  385. */
  386. override public function contains (child:DisplayObject) : Boolean{
  387. return target.contains(child);
  388. }
  389. /**
  390. * Returns the child display object instance that exists at the specified index.
  391. */
  392. override public function getChildAt (index:int) : DisplayObject{
  393. return target.getChildAt(index);
  394. }
  395. /**
  396. * Returns the child display object that exists with the specified name.
  397. */
  398. override public function getChildByName (name:String) : DisplayObject{
  399. return target.getChildByName(name);
  400. }
  401. /**
  402. * Returns the index number of a child DisplayObject instance.
  403. */
  404. override public function getChildIndex (child:DisplayObject) : int{
  405. return target.getChildIndex(child);
  406. }
  407. /**
  408. * Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance.
  409. */
  410. override public function getObjectsUnderPoint (point:Point) : Array{
  411. return target.getObjectsUnderPoint(point);
  412. }
  413. /**
  414. * Removes a child display object from the DisplayObjectContainer instance.
  415. */
  416. override public function removeChild (child:DisplayObject) : DisplayObject{
  417. return target.removeChild(child);
  418. }
  419. /**
  420. * Removes a child display object, at the specified index position, from the DisplayObjectContainer instance.
  421. */
  422. override public function removeChildAt (index:int) : DisplayObject{
  423. return target.removeChildAt(index);
  424. }
  425. /**
  426. * Changes the index number of an existing child.
  427. */
  428. override public function setChildIndex (child:DisplayObject, index:int) : void{
  429. return target.setChildIndex(child, index);
  430. }
  431. /**
  432. * Swaps the z-order (front-to-back order) of the two specified child objects.
  433. */
  434. override public function swapChildren (child1:DisplayObject, child2:DisplayObject) : void {
  435. return swapChildren(child1, child2);
  436. }
  437. /**
  438. * Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
  439. */
  440. override public function swapChildrenAt (index1:int, index2:int) : void {
  441. target.swapChildrenAt(index1, index2);
  442. }
  443. //}
  444. //{region overriden InteractiveObject properties and methods
  445. override public function get accessibilityImplementation () : AccessibilityImplementation {
  446. return target.accessibilityImplementation;
  447. }
  448. override public function set accessibilityImplementation (value:AccessibilityImplementation) : void {
  449. target.accessibilityImplementation = value;
  450. }
  451. /**
  452. * Specifies the context menu associated with this object.
  453. */
  454. /*
  455. override public function get contextMenu():ContextMenu { return target.contextMenu; }
  456. override public function set contextMenu(value:ContextMenu):void
  457. {
  458. target.contextMenu = value;
  459. }
  460. */
  461. /**
  462. * Specifies whether the object receives doubleClick events.
  463. */
  464. override public function get doubleClickEnabled () : Boolean {
  465. return target.doubleClickEnabled;
  466. }
  467. override public function set doubleClickEnabled (enabled:Boolean) : void{
  468. target.doubleClickEnabled = enabled;
  469. }
  470. /**
  471. * Specifies whether this object displays a focus rectangle.
  472. */
  473. override public function get focusRect () : Object {
  474. return target.focusRect;
  475. }
  476. override public function set focusRect (focusRect:Object) : void {
  477. target.focusRect = focusRect;
  478. }
  479. /**
  480. * Specifies whether this object receives mouse messages.
  481. */
  482. override public function get mouseEnabled () : Boolean {
  483. return target.mouseEnabled;
  484. }
  485. override public function set mouseEnabled (enabled:Boolean) : void{
  486. target.mouseEnabled = enabled;
  487. }
  488. /**
  489. * Specifies whether this object is in the tab order.
  490. */
  491. override public function get tabEnabled () : Boolean {
  492. return target.tabEnabled;
  493. }
  494. override public function set tabEnabled (enabled:Boolean) : void {
  495. target.tabEnabled = enabled;
  496. }
  497. /**
  498. * Specifies the tab ordering of objects in a SWF file.
  499. */
  500. override public function get tabIndex () : int {
  501. return target.tabIndex;
  502. }
  503. override public function set tabIndex (index:int) : void {
  504. target.tabIndex = index;
  505. }
  506. //}
  507. //{region overriden DisplayObject properties and methods
  508. /**
  509. * The current accessibility options for this display object.
  510. */
  511. override public function get accessibilityProperties () : AccessibilityProperties {
  512. return target.accessibilityProperties;
  513. }
  514. override public function set accessibilityProperties (value:AccessibilityProperties) : void {
  515. target.accessibilityProperties = value;
  516. }
  517. /**
  518. * Indicates the alpha transparency value of the object specified.
  519. */
  520. override public function get alpha () : Number{
  521. return target.alpha;
  522. }
  523. override public function set alpha (value:Number) : void{
  524. target.alpha = value;
  525. }
  526. /**
  527. * A value from the BlendMode class that specifies which blend mode to use.
  528. */
  529. override public function get blendMode () : String{
  530. return target.blendMode;
  531. }
  532. override public function set blendMode (value:String) : void{
  533. target.blendMode = value;
  534. }
  535. /**
  536. * If set to true, Flash Player caches an internal bitmap representation of the display object.
  537. */
  538. override public function get cacheAsBitmap () : Boolean{
  539. return target.cacheAsBitmap;
  540. }
  541. override public function set cacheAsBitmap (value:Boolean) : void{
  542. target.cacheAsBitmap = value;
  543. }
  544. /**
  545. * An indexed array that contains each filter object currently associated with the display object.
  546. */
  547. override public function get filters () : Array{
  548. return target.filters;
  549. }
  550. override public function set filters (value:Array) : void{
  551. target.filters = value;
  552. }
  553. /**
  554. * Indicates the height of the display object, in pixels.
  555. */
  556. override public function get height () : Number{
  557. return target.height;
  558. }
  559. override public function set height (value:Number) : void {
  560. var event:Event = new Event(Event.RESIZE);
  561. target.height = value;
  562. dispatchEvent(event);
  563. }
  564. /**
  565. * Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
  566. */
  567. override public function get loaderInfo () : LoaderInfo{
  568. return target.loaderInfo;
  569. }
  570. /**
  571. * The calling display object is masked by the specified mask object.
  572. */
  573. override public function get mask () : DisplayObject{
  574. return target.mask;
  575. }
  576. override public function set mask (value:DisplayObject) : void{
  577. target.mask = value;
  578. }
  579. /**
  580. * Indicates the x coordinate of the mouse position, in pixels.
  581. */
  582. override public function get mouseX () : Number{
  583. return target.mouseX;
  584. }
  585. /**
  586. * Indicates the y coordinate of the mouse position, in pixels.
  587. */
  588. override public function get mouseY () : Number{
  589. return target.mouseY;
  590. }
  591. /**
  592. * Indicates the instance name of the DisplayObject.
  593. */
  594. override public function get name () : String{
  595. return target.name;
  596. }
  597. override public function set name (value:String) : void{
  598. target.name = value;
  599. }
  600. /**
  601. * Specifies whether the display object is opaque with a certain background color.
  602. */
  603. override public function get opaqueBackground () : Object{
  604. return target.opaqueBackground;
  605. }
  606. override public function set opaqueBackground (value:Object) : void{
  607. target.opaqueBackground = value;
  608. }
  609. /**
  610. * Indicates the DisplayObjectContainer object that contains this display object.
  611. */
  612. override public function get parent () : DisplayObjectContainer {
  613. return target.parent;
  614. }
  615. /**
  616. * For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file.
  617. */
  618. override public function get root () : DisplayObject{
  619. return target.root;
  620. }
  621. /**
  622. * Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
  623. */
  624. override public function get rotation () : Number{
  625. return target.rotation;
  626. }
  627. override public function set rotation (value:Number) : void{
  628. target.rotation = value;
  629. }
  630. /**
  631. * The current scaling grid that is in effect.
  632. */
  633. override public function get scale9Grid () : Rectangle{
  634. return target.scale9Grid;
  635. }
  636. override public function set scale9Grid (innerRectangle:Rectangle) : void{
  637. target.scale9Grid = innerRectangle;
  638. }
  639. /**
  640. * Indicates the horizontal scale (percentage) of the object as applied from the registration point.
  641. */
  642. override public function get scaleX () : Number{
  643. return target.scaleX;
  644. }
  645. override public function set scaleX (value:Number) : void{
  646. var event:Event = new Event(Event.RESIZE);
  647. target.scaleX = value;
  648. dispatchEvent(event);
  649. }
  650. /**
  651. * Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.
  652. */
  653. override public function get scaleY () : Number{
  654. return target.scaleY;
  655. }
  656. override public function set scaleY (value:Number) : void{
  657. var event:Event = new Event(Event.RESIZE);
  658. target.scaleY = value;
  659. dispatchEvent(event);
  660. }
  661. /**
  662. * The scroll rectangle bounds of the display object.
  663. */
  664. override public function get scrollRect () : Rectangle{
  665. return target.scrollRect;
  666. }
  667. override public function set scrollRect (value:Rectangle) : void{
  668. target.scrollRect = value;
  669. }
  670. /**
  671. * The Stage of the display object.
  672. */
  673. override public function get stage () : Stage{
  674. return target.stage;
  675. }
  676. /**
  677. * An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
  678. */
  679. override public function get transform () : Transform{
  680. return target.transform;
  681. }
  682. override public function set transform (value:Transform) : void{
  683. target.transform = value;
  684. }
  685. /**
  686. * Indicates the width of the display object, in pixels.
  687. */
  688. override public function get width () : Number{
  689. return target.width;
  690. }
  691. override public function set width (value:Number) : void{
  692. var event:Event = new Event(Event.RESIZE);
  693. target.width = value;
  694. dispatchEvent(event);
  695. }
  696. /**
  697. * Whether or not the display object is visible.
  698. */
  699. override public function get visible () : Boolean{
  700. return target.visible;
  701. }
  702. override public function set visible (value:Boolean) : void{
  703. target.visible = value;
  704. if (visible) {
  705. dispatchEvent(new ComponentEvent(ComponentEvent.SHOW));
  706. }else {
  707. dispatchEvent(new ComponentEvent(ComponentEvent.HIDE));
  708. }
  709. }
  710. /**
  711. * Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
  712. */
  713. override public function get x () : Number{
  714. return target.x;
  715. }
  716. override public function set x (value:Number) : void {
  717. var event:ComponentEvent = new ComponentEvent(ComponentEvent.MOVE);
  718. target.x = value;
  719. dispatchEvent(event);
  720. }
  721. /**
  722. * Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent DisplayObjectContainer.
  723. */
  724. override public function get y () : Number{
  725. return target.y;
  726. }
  727. override public function set y (value:Number) : void{
  728. var event:ComponentEvent = new ComponentEvent(ComponentEvent.MOVE);
  729. target.y = value;
  730. dispatchEvent(event);
  731. }
  732. /**
  733. * Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
  734. */
  735. override public function getBounds (targetCoordinateSpace:DisplayObject) : Rectangle{
  736. return target.getBounds(targetCoordinateSpace);
  737. }
  738. /**
  739. * Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
  740. */
  741. override public function getRect (targetCoordinateSpace:DisplayObject) : Rectangle{
  742. return target.getRect(targetCoordinateSpace);
  743. }
  744. /**
  745. * Converts the point object from Stage (global) coordinates to the display object's (local) coordinates.
  746. */
  747. override public function globalToLocal (point:Point) : Point{
  748. return target.globalToLocal(point);
  749. }
  750. /**
  751. * Evaluates the display object to see if it overlaps or intersects with the display object passed as a parameter.
  752. */
  753. override public function hitTestObject (obj:DisplayObject) : Boolean{
  754. return target.hitTestObject(obj);
  755. }
  756. /**
  757. * Evaluates the display object to see if it overlaps or intersects with a point specified by x and y.
  758. */
  759. override public function hitTestPoint (x:Number, y:Number, shapeFlag:Boolean = false) : Boolean{
  760. return target.hitTestPoint(x, y, shapeFlag);
  761. }
  762. /**
  763. * Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
  764. */
  765. override public function localToGlobal (point:Point) : Point{
  766. return target.localToGlobal(point);
  767. }
  768. //}
  769. }
  770. }