flash.external.ExternalInterface example
Friday 16 September 2005 – Filed under: Flash – 3 Comments
An exciting new feature introduced with the Flash 8 Player is ExternalInterface. This feature allows you to communicate seamlessly between Flash and its container, usually the browser. I put together a simple example to demonstrate how ExternalInterface works.
Basically, ExternalInterface.call enables Flash to call a function in Javascript, while Javascript can just as easily access functions within your Flash movie.
No more getURL("javascript:.."), fscommand or setVariable hassle!
I can hear some of you think: “Can’t be that easy, bet it won’t work with Firefox or Safari.”. Well, it really is that easy. All major browsers support ExternalInterface. IE uses ActiveX technology to support it; Firefox and Safari (1.3+) rely on the NP Runtime API.
Enough text, here’s a simple demo:
Download the source files (both Actionscript and HTML/Javascript file are included) to see how this demo works.
« previously: Return of Screenweaver next: MovieClip.scale9Grid example »
3 Responses
Leave a Reply
Recent Articles
- New bike
- FLV Player 2.0.25 released
- No custom headers for Flash file upload. Why?
- Building AIR with FDT
- Adobe MAX 2007
- FLV Player 2.0 released
- The new Photoshop logo
- mProjector WindowResizer class
Advertisement
Categories
- Art & Design (4)
- Flash (37)
- FLV Player (9)
- Software (16)
- User Experience Design (3)
- Various (8)
- Work (6)
Tuesday 14 August 2007 at 00:26
Thank you! Always some nice links out there
Saturday 22 September 2007 at 20:44
Combining with ajax this sample gonna be cool. Thanks man.
Sunday 15 June 2008 at 03:27
err…. is it only me who received “FlashObject is not defined” ?