Category Archives: adobe

Flex builder free for students

If you’re a student or a faculty at educational institutions worldwide, its time to rejoice. You can now get Adobe Flex Builder 2.0 for free!

Adobe Flex 2 will be available to qualified education end-users for free download on Adobe.com in early November.

Catch the full news here

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.