Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Matan/AS3CoreInterfaces
AS3 core display layer interfaces e.g. IDisplayObject, ISprite, etc
https://github.com/Matan/AS3CoreInterfaces
Last synced: 3 months ago
JSON representation
AS3 core display layer interfaces e.g. IDisplayObject, ISprite, etc
- Host: GitHub
- URL: https://github.com/Matan/AS3CoreInterfaces
- Owner: Matan
- Created: 2010-09-11T15:41:06.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2011-06-13T13:10:34.000Z (over 13 years ago)
- Last Synced: 2024-07-30T02:23:52.910Z (3 months ago)
- Language: ActionScript
- Homepage: http://doesflash.com/2010/09/as3-core-interfaces/
- Size: 160 KB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
- awesome-actionscript-sorted - AS3CoreInterfaces - AS3 core display layer interfaces e.g. IDisplayObject, ISprite, etc (Unsorted / Other API)
README
h1. AS3 Core Interfaces
Three very small libraries that contains the missing interfaces of the display objects. Flash Player version 9, 10, 10.1 and 10.2 separately built to suit your project's needs.
h1. Each SWC contains
* IDisplayObject
* IDisplayObjectContainer
* IInteractiveObject
* IMovieClip
* ISpriteh1. Why?
Using interfaces are very important, but for some reason Adobe decided not to implement interfaces for the display layer. The reason behind this is to ensure that you extend the existing display classes when building your application. Personally I think a simple compile time error would have done the trick. :)
These interfaces will aid you when you are building display objects that are generic and reusable. E.g. Lets say you create an overlay system that displays any display object that extends your custom interface of IOverlay. Great, this works perfectly, but lets say you want access some of the "standard" Sprite properties like "x", "y", etc - you can't because you are referring to you overlays as IOverlay. To simply fix this all you need to do is extend you IOverlay interface from ISprite, it then automatically inherits all properties. Problem Solved!
h1. Note!
When referring to display objects as interfaces you'll need to cast into DisplayObject to be able to add them to the stage, because the argument requirement is DisplayObject and not IDisplayObject.