Skip to content

Instantly share code, notes, and snippets.

@devboy
Created November 4, 2011 12:03
Show Gist options
  • Save devboy/1339193 to your computer and use it in GitHub Desktop.
Save devboy/1339193 to your computer and use it in GitHub Desktop.
Mixins with include in AS3
// ActAsDog.as
public function bark(): void
{
trace("bark");
}
// ActAsCat.as
public function meow(): void
{
trace("meow");
}
// CatDogHybrid.as
package
{
class CatDogHybrid
{
include "ActAsCat.as"
include "ActAsDog.as"
}
}
// Test.as
var hybrid = new CatDogHybrid();
hybrid.meow() // meow
hybrid.bark() // bark
@tschneidereit
Copy link

tschneidereit commented Nov 4, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment