Last active
December 13, 2015 21:08
-
-
Save mattcolman/4975121 to your computer and use it in GitHub Desktop.
Adding assets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add a bitmap | |
newBitmap = @bitmap('my_bitmap') | |
@stage.addChild(newBitmap) | |
# extract frame 2 from a spriteSheet and use it as a bitmap | |
newSpriteSheet = @spriteSheet('my_spritesheet') | |
newSpriteSheet.bitmapFromFrame(2) | |
@stage.addChild(newSpriteSheet) | |
# add a BitmapAnimation | |
newAnimation = @animation('my_animation') | |
newAnimation.gotoAndPlay('all') | |
@stage.addChild(newAnimation) | |
# play a sound | |
newSound = @playSound(newSound) | |
# add a MovieClip | |
newMovieclip = @newMovieClip('my_movieclip', 'my_class') | |
@stage.addChild(newMovieclip) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment