View Sidebar
AS2, AS3 Communication using Local Connection

AS2, AS3 Communication using Local Connection

September 27, 2012 23:32

ActionScript Virtual Machine that runs AS3(AVM2) and AS2(AVM1) are¬†completely different from each other, so both the swf’s cant¬†communicate with each other.

The LocalConnection Class have a common implementation in both the virtual machines. The LocalConnection class lets you create a LocalConnection object that can invoke a method in another LocalConnection object.

The communication can be:

Within a single SWF file

Between multiple SWF files

Between content (SWF-based or HTML-based) in AIR applications

Between content (SWF-based or HTML-based) in an AIR application and SWF content running in a browser

For setting up communication between AS2 and AS3 Swf, we need to create a sender and receiver in both the swfs. In the example here we will pass a text value from respective swf to another swf. A AS2 swf is loaded within AS3 swf.

Source Files

If you like the article please share

Leave a reply

You must be logged in to post a comment.