Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbackeus/actionscript-prototypes
Bunch of handy prototypes to make actionscript development easier. Inspired by ruby, rails and jQuery etc.
https://github.com/dbackeus/actionscript-prototypes
Last synced: 10 days ago
JSON representation
Bunch of handy prototypes to make actionscript development easier. Inspired by ruby, rails and jQuery etc.
- Host: GitHub
- URL: https://github.com/dbackeus/actionscript-prototypes
- Owner: dbackeus
- Created: 2008-09-05T16:03:35.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2008-09-29T08:44:16.000Z (over 16 years ago)
- Last Synced: 2024-11-09T01:59:18.836Z (2 months ago)
- Language: ActionScript
- Homepage:
- Size: 117 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
Awesome Lists containing this project
- awesome-actionscript-sorted - actionscript-prototypes - Bunch of handy prototypes to make actionscript development easier. Inspired by ruby, rails and jQuery etc. (Unsorted / Other API)
README
== Description
Sweet prototypes for actionscript that extend core classes with stuff to make your life easier.
In need of documentation and is under quite heavy development.
== Usage
Move the prototypes directory over to your .fla directory or add a classpath so your compiler can find it.
Import the namespace before including:
import prototypes.*Include everything with:
Prototype.includeAll()
Include all functions from a specific prototype by:
MovieClipPrototype.includeAll()
Include a specific function from a specific prototype by:
MovieClipPrototype.include( "isMouseOver" )
The last one remains quite untested at the moment so can't promise that it works.== Gotchas
To use the extensions on Number directly on a number without using a variable you need to enclose it in parenthesis or the compiler will shoot syntax errors at you.
// Syntax error
trace( 1.day.ago )
// Works just fine!
trace( (1).day.ago )
// Also works
var n = 1
trace( n.day.ago )
Sometimes you might want to use each on a non variableized array. The flash compiler has some truly weird behaviour when it comes to this. Here's the breakdown.// Silent failure with adobe compiler, works with MTASC given that you specifically ended the previous line with a ;
['asdf', 'qwer'].each( function(element) { trace(element) } )
// Enclosing the whole thing in parenthesis makes it work on both compilers
(['asdf', 'qwer'].each( function(element) { trace(element) } ))
// Works with the adobe compiler but not with MTASC
new Array('asdf', 'qwer').each( function(element) { trace(element) } )
// Pre assigning the array to a variable always works
var a = ['asdf', 'qwer]
a.each( function(element) { trace(element) } )