Category Archives: javascript

jQuery Online Training

I will be conducting an online training for jQuery enthusiasts in association with ITVidya.com More details can be found here: http://twrl.in/nvdm

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

BarCamp3 Preview

Finally BarCamp3 is here and I’m already excited.

The event will take place at Persistent System Pvt. Ltd, Pune on 7th July(Sat) 2007.

I will be speaking on two topics:

1. Mobile Visualization.
2. How to make a Flash Widget.

BarCamp Pune 3

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”);
}
</script>

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

import flash.external.ExternalInterface;
function callJavaScript(){
ExternalInterface.call(“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(){
play();
}
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;
else
myflashref = window.document.flashObject;
}
function playFlash(){
getReference(); //getting the flash reference.
myflashref.startPlaying(); //call the method in the flash
}
</script>

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.