Editing
Creating Custom Lipsync Code in Flash
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===TRACE=== Honestly, when it comes to updating applications like Flash, there are many negatives. The layout is atrocious-- it doesn't respect the economy of my screen at all, and it always seems to be getting in the way of itself. BUT, there IS one ''blamstarp'' of a new feature that updating has granted me, a TRUE CARTOON BOON: '''<u>AUTOMATED LIPSYNC</u>'''! So. Again. * Since automated lipsync will create a series of timed mouth frames in your Timeline with pretty accurate results, how do I then convert those frames into the more compact AS3 code I've grown accustomed to? Moving forward, in many situations, it now makes a lot more sense to start off with the Automated Lipsync feature, modify that in any place where it's wrong, then somehow convert the frames into code. My silly but serviceable technique goes thusly. I thought of putting a little command to <code>trace</code> (If you're wondering, <code>trace</code> means to output some kind of alert text when testing a Flash movie, much like all the output code we've been receiving this whole time) out a code at the start of each mouth frame I chose, but since for this Lipsync feature, I have to turn the mouth into a Graphic instead of a Movie Clip (in the MAIN scene, not embedded inside ''"joeava"'' like earlier-- for this part in the process, I have to take it out of that hierarchy), it doesn't respect ActionScript commands anymore. So, therefore, INSIDE the mouth Graphic, I made a SEPARATE Movie Clip that would run the <code>trace</code> command-- and as bad as that sounds, it gets me What I Want. Here's the code placed in the Movie Clip on my ''"mm"'' frame: <nowiki>if (MovieClip(root).currentTime>0) { MovieClip(root).n = MovieClip(root).n+1; var stopCheck = "this.doOnce"+MovieClip(root).n; trace ("if (currentTime > "+MovieClip(root).currentTime+" && "+stopCheck+"!=1){"+stopCheck+" = 1;MovieClip(root).joeava.joehead.gotoAndStop(\"mm\");}"); }</nowiki> And the other mouth shapes would have the same script, save it be the phoneme name it calls its own. In this situation, there IS no actual buttons or textboxes for the tool-- now, thanks to the last quandary, I've decided on just using the Timer element with a Small Circle of Friends: <nowiki>// REFRESH LIPSYNC VARIABLES for(var a:int=0; a<1000; a++) { this["doOnce" + a] = 0; } // CREATING NEW LIPSYNC SCRIPT var n:Number = 0; var currentTime:Number; // CONSTANTLY UPDATING SCRIPTS stage.addEventListener(Event.ENTER_FRAME, EnterFrameLoop); stage.addEventListener(Event.ENTER_FRAME, DialogueScript); function EnterFrameLoop(e:Event):void { currentTime = Math.round(getTimer() - startTime)/1000; } var startTime = getTimer(); function DialogueScript(e:Event):void { var att = (getTimer() - startTime)/1000; }</nowiki> So now, when I export out a new Test Movie from Flash, when the line plays in the Timeline, it spits out the corresponding timing code, like so-- [[File:lipsynctool3.png|500px]] One last hiccup-- the first time through, every line is a little over 100 milliseconds off. Just wait for the line to play through again, and the second time through it'll be correctly timed, if you'll just direct your attention over ''here''-- [[File:lipsynctool4.png|500px]] It might sound less than optimal to have to actually watch the dialogue animation twice, let alone ONCE, but... as an animator, this is as fast a process as I've ever gotten to for getting out proper lipsync, so I'M not complaining. S'faster than any rendering process I've ever heard wind of. This right here is the cool, cool breeze of mouth-shape undulations bobblin' oh-so smooth, like ''[https://youtu.be/X1Yxw_AayQg?t=28 Spooky]'' from Kid's Typing. Like carykh, nothing refreshes me more than that [https://www.youtube.com/watch?v=ItVnKlwyWwA smooth, smooth flap'o'th'lip].
Summary:
Please note that all contributions to notfire's wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
notfirewiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information