Facial Expressions

[swf src=”http://petj.mmd.eal.dk/downloads/dice.swf” height=400 width=550]

Here is a method where you can control a movie inside another movie. The strange beast on the top left has a dice face. It’s the same movie as the dice rolling. So by changing the frame you can control fairly complex animations.


/*
FACIAL EXPRESSIONS
How to control a movie inside another movie.
In a keyframe try the following:
*/


addEventListener(Event.ENTER_FRAME,faceshift);
function faceshift(event:Event) {
kitty.kFace.gotoAndStop(3); // stops at face 3
}

The trick is in this codeline:

  • kitty.kFace.gotoAndStop(3);

Here you control a movie inside another movie. So on the stage you see a kitty. Inside kitty is a movieclip named kFace. By gotoAndStop / Play you can control animations like facial expressions and similar.

Tip: use onEnterFrame or buttons in order to control the movies.

Enable Notifications OK No thanks

We use cookies - more information

Multimusen.dk will set a few cookies from Doubleclick, Google and the Social Media plugins they ay set some cookies. Some of my pages use APIs - such as YouTube, LinkedIn, Google Fonts, Google Maps, Mapbox, Spotify, Jetpack, Twitter, Facebook &c.. Such plugins may set the odd cookie.

Close