swfobject and flash ExternalInterface


/ Published in: ActionScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2.  
  3. var chatTall = null; //SET TO NULL UNTIL LOADED
  4.  
  5. function sendGen(genType) {
  6. chatTall.sendGender(genType);
  7. } //SEND USING FLASH ExternalInterface
  8.  
  9.  
  10. var flashvars = {};
  11. var params = {};
  12. var attributes = { id: "chatTall", name: "chatTall" };
  13.  
  14. swfobject.embedSWF("signup/images/drillcams/chatTall.swf", "flashcontent", "138", "419", "9", false, flashvars, params, attributes, function(e) { chatTall = e.ref;});
  15. </script>
  16.  
  17.  
  18.  
  19. /*ActionScript*/
  20.  
  21.  
  22. import flash.external.ExternalInterface;
  23.  
  24. function genType(str:String):Void {
  25. debugTxt.text = str;
  26. }
  27.  
  28. ExternalInterface.addCallback("sendGender",this,genType);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.