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!
===SEGUND=== It took years of intense struggle, but I had made that big jump from AS2 in MX to AS3 in CS6. That's not where my learning curve hits a decline, though-- recently, having to switch systems forced my upgrading hand AGAIN. Around this Time, I was faced with a new challenge in my pipeline, since I had perfected my ability to make this space-bar puppetry technique work, but ONLY for games. So. * How do I successfully export out my coded lipsync as a VIDEO, if I wanted to use it in an actual animated project? I had to adjust the code for the tool just a scootchamagootch to function with being exported out. Not EVERY AS3 code is perfectly compatible with being exported out, but thankfully for me (see what I had to do to export vector art from Flash as pixel art from [https://www.deviantart.com/homestarrunnertron/art/Vector-to-Pixel-in-Flash-THE-TUTORIAL-492072874 MX/CS6] to [https://www.deviantart.com/homestarrunnertron/art/Vector-to-Pixel-in-Flash-Animate-v2-2020-825684091 modern-day]), enough of the stupid-simple stuff works, and it's mainly stupid-simple stuff I gravitate to, even when I have to chain a whole bunch of that stupid-simple stuff together pretty inelegantly. (How's that for an oxymoron?) Here's the modified code, which instead of being tethered to counting the playhead position of a sound file (which exported video doesn't seem to understand), it just counts up a generic Timer element, instead. <nowiki>// REFRESH LIPSYNC VARIABLES for(var a:int=0; a<1000; a++) { this["doOnce" + a] = 0; } // BUTTONS play_btn.addEventListener(MouseEvent.CLICK, startSound); stop_btn.addEventListener(MouseEvent.CLICK, stopSound); // IMPORTING var SyncSound:Sound = new joe014(); var SyncChannel:SoundChannel = new SoundChannel(); // DURATION var duration:Number = Math.round(SyncSound.length)/1000; durationBox.text = String(duration); // START BUTTON function startSound(e:MouseEvent):void { SyncChannel.stop(); for(var a:int=0; a<1000; a++) { this["doOnce" + a] = 0; } var startat = Number(startatBox.text) * 1000; SyncChannel = SyncSound.play(startat); } play_btn.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); // STOP BUTTON function stopSound(e:MouseEvent):void { SyncChannel.stop(); } // CREATING NEW LIPSYNC SCRIPT var n:Number = 0; var currentTime:Number; stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); function myKeyDown (e:KeyboardEvent):void { if (e.keyCode == Keyboard.SPACE) { if (n==0) { n=196; } if (currentTime>0) { n = n+3; currentTime = currentTime-0.0; var stopCheck = "this.doOnce"+n; trace ("if (currentTime > "+currentTime+" && "+stopCheck+"!=1){"+stopCheck+" = 1;MovieClip(root).joeava.joehead.gotoAndPlay(2);}"); } } } // CONSTANTLY UPDATING SCRIPTS stage.addEventListener(Event.ENTER_FRAME, EnterFrameLoop); stage.addEventListener(Event.ENTER_FRAME, DialogueScript); function EnterFrameLoop(e:Event):void { currentTime = Math.round(SyncChannel.position)/1000; currentBox.text = String(currentTime); } var startTime = getTimer(); function DialogueScript(e:Event):void { var att = (getTimer() - startTime)/1000; if (att > 1.744 && this.doOnce2!=1){this.doOnce2 = 1;MovieClip(root).joeava.joehead.gotoAndPlay("nn");} if (att > 1.788 && this.doOnce3!=1){this.doOnce3 = 1;MovieClip(root).joeava.joehead.gotoAndStop("ah");} if (att > 1.9 && this.doOnce5!=1){this.doOnce5 = 1;MovieClip(root).joeava.joehead.gotoAndPlay("oo");} // EC TETERA, EC TETERA, EC TETERA sounds like some kind of unearthly beast. }</nowiki> Then you just Export Video/Media, and the mouth timing will perfectly export out intact!
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