Skip to content

Instantly share code, notes, and snippets.

@mattcolman
Last active December 13, 2015 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattcolman/4975121 to your computer and use it in GitHub Desktop.
Save mattcolman/4975121 to your computer and use it in GitHub Desktop.
Adding assets
# 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