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/4975167 to your computer and use it in GitHub Desktop.
Save mattcolman/4975167 to your computer and use it in GitHub Desktop.
Movieclips
@documentMC = @newMovieClip('movieclip_filename', 'MyClassName')
# If you enter the class name as the filename you can import the main timeline from the FLA,
# unless you have specifically changed the name of the Document class.
@mainCnt.addChild @documentMC
# **** MONSTER **** #
monster = @documentMC.monster
monster.onClick = =>
monster.gotoAndPlay('correct')
monster.onAnimationEnd = (key) =>
console.log 'Monster.animationEnded', key
monster.gotoAndStop('correct')
# **** SQUARE **** #
square = @documentMC.square
@tweenMax.to(square, 1, {alpha:0, repeat:-1, yoyo:true})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment