Category Archives: javascript

jQuery Online Training

I will be conducting an online training for jQuery enthusiasts in association with More details can be found here:

Learn how to create dynamic, visually-appealing web applications from two experienced JQuery developers in this 8 weeks online training with practical project

Learn how to use the jquery and how they all fit together, to develop web applications like the pros.
Get hands-on coding experience and answers to your questions so you can start creating your own JQuery application with confidence.
Save time and frustration by focusing exclusively on jQuery development for 8 Weeks with expert guidance.
All Online!
Live weekly webinars

Flash and JavaScript Integration

Flash and JavaScript Integration

Follow these easy steps to make flash communicate with JavaScript code and vice versa.

a) Flash to JavaScript: Making Flash call a JavaScript function

JavaScript Function Code. To be put in the HTML

<script language=”JavaScript”>
function alertMe(){
alert(“Hello, world”);

Flash Code. To be put in any event of button, frame, where ever required:

import flash.external.ExternalInterface;
function callJavaScript(){“alertMe”);

Please note that due to default security these codes will not work if the flash is loaded locally.
To test this, you will either need to upload your .swf and .html to a server and request the files from the server.
OR you will need to set the global security settings( Google it to know how!)

b) JavaScript to Flash : Making JavaScript call a Flash Function.

Flash function code that needs to be called:

import flash.external.ExternalInterface;
function startPlaying(){
ExternalInterface.addCallback(“startPlaying”, this, startPlaying);

Java Script code to call the method in the flash:

<script language=”JavaScript”>
var myflashref;
function getReference(){
if (navigator.appName.indexOf(“Microsoft”) != -1 )
myflashref = window.flashObject;
myflashref = window.document.flashObject;
function playFlash(){
getReference(); //getting the flash reference.
myflashref.startPlaying(); //call the method in the flash

Well, I leave it up to you now to do some R&D and make data pass through flash and JavaScript and vice-versa!

Feel free to leave clarification requests.