Skip to content Skip to sidebar Skip to footer

Can I Sync HTML Text Or Divs With SWF (Flash Character Animation)?

I have flash animation (swf) in my HTML Page. Now, I like to have my flash animated character (700kb) to speak dialogues, the related text should pop and go in the html side of the

Solution 1:

Perhaps you need to run some code from flash file, there is a good tool for it - ExternalInterface

for example as3 code:

class Character {
  public function say(msg:String):void
  {
    trace(msg);
    ExternalInterface.call('say', msg);
  }
}

js code on the html page where your swf embedded:

<script>
function say(msg) {
  alert('character says: ' + msg);
}
</script>

So when you run character.say('hi') you'll get new message in flash console (from trace) and popup with your message.

Hope this helps.


Post a Comment for "Can I Sync HTML Text Or Divs With SWF (Flash Character Animation)?"