SharpFlash, a first look

| No Comments

As I mentioned in my previous post, one of the projects that I'm working on in my free time has a working title of "SharpFlash". It gets its name because it integrates C# and Flash to form a single application. I'm so original it's not even funny.

It's still very much in the early phases, but I've made a lot of progress with it so far. The idea behind SharpFlash is that it exposes a rich API in Flash to allow .swf movies to interact with Windows when making standalone .exe's.

Check out the following code sample on how to open up a "Browse for file" dialog from within Flash:
// these include file requirements will go away in future versions
// but for now they're necessary
#include "SharpFlash.as"
#include "sfSystem.as"

// bring up the browse for file dialog when my_btn is pressed
my_btn.onPress = function() {
  sfSystem.Dialogs.BrowseForFile_Open( "initial.swf", ["SWF (*.swf)", "*.swf"], "C:\\", "Select main .swf file . . .", browse_Callback);
}

browse_Callback = function (success, fileName) {
  if (success) {
    _root.status_txt.text = "The file selected is: " + fileName;
  }
}

There's a lot of behind the scenes magic in those two .as file includes that make this all happen. I'll be shedding some light on that sometime later this weekend, but for now I'm late for dinner.

This is 4th of July weekend, a holiday here in the United States. I'll be off of work for the next 3 days and will probably be making as much progress as I can with SharpFlash. Expect a post sometime soon detailing how I implemented the ActionScript API. Stay tuned as the drama unfolds....

Leave a comment



About this Entry

This page contains a single entry by darron published on July 3, 2003 7:35 PM.

First Post was the previous entry in this blog.

SWFHeaderInfo is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02