SWFAdapter – Proxy to Communicating to Flash 8 SWFs from Flash 9

Filed under: Articles — Robert Taylor at 11:01 am on Monday, December 11, 2006

A new member to the FlashInterface family is in the works. This little guy will be called SWFAdapter. It uses ExternalInterface and the AS 3.0 Proxy class. SWFAdapter is not an upgrade or replacement to FlashInterface, rather a different means to talk to Flash 8 SWFs. By using the Proxy class, you can address the object, properties and functions as if it resided natively inside the Flash 9 player. This solution will not offer all the bells and whistles of FlashInterface, so if you are looking for a more robust solution you might consider it. For more information on the FlashInterface solution click here.

So what does the API currently look like for SWFAdapter?

var movie = new SWFAdapter(”flash/sample.swf”, new SWFLoader());
addChild(movie.content);

Scenario 1 - Inline Assignment from different objects

movie.dot.label.abc = 123;
trace(movie.dot.label.abc); // (Optional)
movie.dot.label.text = movie.dot.label.abc;

var pos:Number = movie.dot._x;
movie.dot._x = pos + 20;

Scenario 2 - Inline Assignment from same object

movie.dot.label.text = movie.dot.label.text;

Scenario 3 - Direct calls to root functions

movie.gotoAndStop(++count);
movie.hide();

Scenario 4 - Property Assignments

movie.dot._visible = false;
movie.box._x = 20;
movie.dot.label.text = “2″;
movie.dot.label._x = 100;

Scenario 5 - Complex Inline Property Assignments

movie.dot.label.text += “X”;
movie.dot.label.text = movie.dot.label.text + ” goodbye”;

Scenario 6 - Property Getters

trace(movie.dot.label.text);
trace(movie.myObject.name);

Scenario 7 - Complex Numeric Assignments

movie.dot._x += movie.dot._x;
movie.dot.label._x += 20;
movie.dot._x++;

trace(movie.dot._x)
movie.dot._x+=20;
trace(movie.dot._x);

Scenario 8 - Property Assignments from Another Movie

movie.dot._x = movie2.dot._x;

Currntly Testing
movie.x = 123;
movie2.x = movie.x;
trace(movie._x, movie2._x, movie.x, movie2.x);

If you want to play around with the files, that I am currently working on, download them here. Got input or feedback, ideas, anything, email me!

Download SWFAdapter workspace here.

FlashInterface video tutorials (01-04) available

Filed under: Articles — Robert Taylor at 8:32 am on Wednesday, December 6, 2006

Get a jump start on using FlashInterface in your projects. This first set of videos will go over installing, setup and building a quick test demo in the Flash 8 authoring environment.

http://www.flashextensions.com/tutorials.php 

Wanted - FlashInterface Samples and Examples

Filed under: Articles — Robert Taylor at 9:46 am on Tuesday, December 5, 2006

Some of you have emailed me regarding projects you have been creating or working on that are using FlashInterface. If you have been working on a project that is accessible via the web, send me a link to the webpage via email or this post. I will post examples on the FlashInterface page for all to see! If you haven’t started a project with FlashInterface, what are you waiting for!!!

FlashInterface 2.1 Released (Major Release)

Filed under: Articles — Robert Taylor at 9:39 am on Tuesday, December 5, 2006

If you have been using FlashInterface 1.0 for projects, you will want to upgrade to this new release. It has major improvements to the prior version. Here are some of the changes that it includes.

  • Streamlined API

I don’t think it could get any simpler! (but you never know). You no longer have to be concerned with finding out the ID of the SWF to register a SWF to use FlashInterface. All the ties into the classes are now reside internally to the class. The only time you need to know the ID is when you want to communicate directly to that particular SWF.

  • Global Dispatching

All members subscribed to an event receive it with a single dispatch. You no longer need to send it to each SWF individually.

  • Switch On / Off public access

You can make your public functions accessible or inaccessible with the new publish function. Determine when items are available to other SWFs.

  • Compatibility with Flash 8, Flash 9, and Flex 2 applications

This release has been tested with the different platforms and frameworks. It also provides examples of using it in each environment.

  • New and improved examples and documentation

Online and Flash 8 Authoring documentation has been dramatically improved. Explanations on how to use the functions is now better explained in the online documentation with this new interface.

Anyone attempting to build an application that mixes Flash 8 and 9 SWFs should use FlashInterface. It has been designed specifically to enable developers to easily overcome the hurdles presented between working within both ActionScript Virtual Machines (AVM).

Enjoy this new release! Visit FlashInterface page.