forked from as3/as3-utils
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIDisplayObject.as
More file actions
26 lines (25 loc) · 737 Bytes
/
IDisplayObject.as
File metadata and controls
26 lines (25 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package utils.display
{
import flash.display.DisplayObject;
/**
* An interface to work around the lack of interface for display objects.
* Especially useful when you want to type a variable with an interface
* and add it to the stage without type casting to DisplayObject each time
* (and running the risk of an error).
*
* @example <listing version="3.0">
* var d:IDisplayObject = new ClassThatImplementsIDisplayObject();
* addChild(d.asDisplayObject());
* </listing>
*
* @author Mims H. Wright
*/
public interface IDisplayObject
{
/**
* Returns a representation of the object as a DisplayObject.
* Usually would return the object itself.
*/
function asDisplayObject():DisplayObject;
}
}