Communicate betwen C# and an embeded Flash application
The External API allows an ActionScript developer to easily interact with the container program that is hosting Flash Player 8 and vice versa. The majority of the time, this will most likely be a Web browser, but this does not always have to be the case.
As many C# developers know, it is easy to house an ActiveX control (the IE version of Flash Player) in a .NET Windows application. This means we can now load an SWF in our Windows application and easily send data back and forth. Keep in mind that the keyword in this statement is "easily;" although possible before, it was not nearly as simple as the External API makes it now!
C# to ActionScript Communication
As I said before, communication between Flash Player and its container has been made extremely easy. The new class that makes this process so easy is the ExternalInterface. We will begin in the ActionScript. First, we need to import this new class so we can use it (as2 only, in as3 it will work without the import):
import flash.external.ExternalInterface;
Next, we have to register any function we want to make available externally:
ExternalInterface.addCallback("addText", addText);
Basically, the code above will allow us to call the addText function (which I will show in a minute) from the C# application.
The addText function is as below. Basically, it takes a string input and appends it to a text box
function addText(val:String):void { inTxt.appendText(val + "\n"); // append text recieved from c# }
That's it from the ActionScript side. Now all we need to do is call the function from C#. First, I add an instance of the Flash Player ActiveX control to my form and load the SWF we created in the form's constructor:
private AxShockwaveFlash player; public DemoForm () { ... player.LoadMovie(0, Application.StartupPath + "\\EITest.swf"); player.Play(); ... }
Next, all we have to do is call the externalized method when desired. In my case, it is in response to the user clicking the send button:
private void sendBtn_Click(object sender, EventArgs e) { player.CallFunction("" + outTxt.Text + ""); }
ActionScript to C# Communication
Again, you will need to use the ExternalInterface in the ActionScript:
function send(evt : Event):void { ExternalInterface.call("sendText", outTxt.text); // function to call and it's parameters outTxt.text = ""; // reset text box }
As you can see, I am calling a method sendText and passing the input string as a parameter. Now to receive the message in C#, we first have to subscribe to the FlashCall event. You can do this in the constructor or from the activex properties panel on events tab.
Now the call made in ActionScript will be received in the request property of the event argument. For my particular call, the XML will look like this:
<invoke name="sendText" returntype="xml"> <arguments> <string>some text message here</string> </arguments> </invoke>
So now all we have to do is parse the XML in the event handler and invoke the C# function locally:
private void player_FlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent e) { // message is in xml format so we need to parse it XmlDocument document = new XmlDocument(); document.LoadXml(e.request); // get attributes to see which command flash is trying to call XmlAttributeCollection attributes = document.FirstChild.Attributes; String command = attributes.Item(0).InnerText; // get parameters XmlNodeList list = document.GetElementsByTagName("arguments"); // Interpret command switch (command) { case "sendText" : resultTxt.Text = list[0].InnerText; break; case "Some_Other_Command" : break; } }
Viola!
I have made the simple example discussed available here.
Xobni Makes Life Easier. Really. It Does.
Xobni is a new plugin for Outlook 2007 users and it kicks your email capabilities ass.
Email search. Way faster than the current Outlook07 search. When I started typing in the first two or three letters in Xobni it immediately began pulling up emails with those letters used. It has been a time saver because Outlook takes forever to search through 2 years of emails. With Xobni, it's pulling them up in seconds.
Email Analytics. Fancy little graph showing you the frequency of email usage between you and your contact. Below the graph, it shows you the number of messages sent in and out and the contacts rank based on that number.
Click-to Functions. Click on their phone number, click to schedule time with person (creates a default email and pulls your availability from your calendar!), or click to email this person.
Network. Shows you all the people you and that person are associated with.
Conversations. Shows you the history of correspondence between you and that person. How easy!
Files Exchanged. Shows you all the files you and that person have exchanged. How convenient!
Fun Facts. Share fun facts with your contacts, such as who responds the fastest to your emails.
Unlike many Outlook add-ons, Xobni seems to add its functionality without dragging down Outlook's performance, or worse, crashing it. It's useful and it doesn't get in the way. There's no reason not to try it, but be warned: it's still in beta, so just because others haven't had problems doesn't mean you'll get away scot-free.
And the download link.
Enjoy
World Builder
When i first started this blog i said to myself I'm not gonna post dumb videos from all over just to keep visitors busy. But this video makes the exception. It's fantastic.
This award winning short was created by filmmaker Bruce Branit, widely known as the co-creator of '405'. World Builder was shot in a single day followed by about 2 years of post production. Branit is the owner of Branit VFX based in Kansas City.
In his own words: "A strange man builds a world using holographic tools for the woman he loves."
Hope you like it
Visual versioning for designers
The company, Gird Iron Sofware, calls Flow a “Visual Workflow Manager.” I call it a miracle.
Programmers had versioning tools since the begining now it's time for the designers to get theirs. And it's a really good one.
Flow follows a project’s workflow by tracking and mapping out the revisions a file has gone through during your work process. It manages your project files, how they’re related to each other, and where they’re located.

How It Works
Say that you have a final document for a client. It’s a PDF file that includes particular fonts and several images. Drop that PDF file onto Flow, and the application maps out the assets and the iterations of those assets for you. Double-click on a previous revision of an asset, such as one of the images, and Flow finds it on your computer instantly. Flow will let you know if you are missing any of the fonts in a project file.
Flow doesn’t care what the names of the files are; it identifies them through an ID number so even if you can’t remember what you named a file, Flow will find it for you and map it.
Flow not only gives you a history of a file and its iterations but allows you to revert to any version as needed. They call this “Visual Versioning.” You can also perform a “Visual Search” to locate any file and to see a visual diagram of how it fits into the project you’re working on.

Asset Tracking
One of my favourite features is the asset tracking across multiple programs. Without any intervention from the designer, Flow will detect copy/paste and import functions from application to application. That means it can tell that you've created a vector in Illustrator, imported it into Photoshop, and then exported it to JPG and added it to an HTML file.
Project Reports
Another nice feature is the ability to track how much time was spent working on a particular file or on a project as a whole. This actually fits quite nicely with how I used to determine how much time was spent on a project. I've often gone through my email and phone logs to see which project I was working on at any given time. Timesheets have always been a hassle and this would definitely help me get a more accurate view of where my time is being spent.

Versioning
I like how it'll automatically version the files that you are working on and even tracks when you do Save As. You'll be able to configure how far back a file is versioned so as not to eat up your entire hard drive (although considering I barely use 20% of my drive now, I'm not overly concerned). It creates thumbnails of each version, letting you quickly eyeball changes from version to version. It'll even track files on network drives or on removable storage.
Check out their video for a quick demo and a bit more details. For full details, just go and download it
Firefox and User Agent Switcher
Download and install the User Agent Switcher from here
Read popular magazines for free as a IPhone
Zinio is a company that is providing popular magazines like Reader's Digest, CosmoGirl, Elle, Macworld, Men's Health, National Geographic, Playboy, Penthouse and books in a digital format for free. These magazines are served as high resolution images and are the exact replica of the real magazines.
To read these magazines inside Firefox, first download User Agent switcher addon for Firefox. Go to Tools>User Agent Switcher>Options >Options. Click on User Agents and then click on Add. Now fill in the fields as follows:
Description: iPhone
User Agent: Mobile Safari 1.1.3 (iPhone; U; CPU like Mac OS X; en)
App Name: AppleWebKit/420+ (KHTML, like Gecko)
App Version: Version/3.0
Platform: Mobile/1A542a Safari/419.3
So we have added iPhone as a user agent. Then click on Tools>User Agent Switcher and click iPhone to set the user agent to iPhone. We are now ready to begin.
Proceed to http://imgs.zinio.com/iphone/ and read all your favorite magazines for free!
Walk in google shoes
Well, the googlebot is allowed access to webpages that are normally restricted to registered users (members-only sites). This is mainly because the site owners want their websites to be searchable via google but at the same time preventing non-members from accessing.
Go to Tools>User Agent Switcher>Options >Options. Click on User Agents and then click on Add. Now fill in the fields as follows:
Description: Googlebot
User Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
App Name: Googlebot
App Version: 2.1
You are done, congrats, your browser will now be recognised as a googlebot!
To revert back, click on Tools–>User Agent Switcher–>Default

