One of the ways I implemented the callbacks for SharpFlash lies in how the application was created. SharpFlash is a multi-threaded application. One thread is the Active-X control (the Flash player) and another thread is a socket server I created. Upon startup, the Flash player connects to the socket server, and when a function is done executing, the socket server sends a message to the flash client passing it the appropriate results. It's nothing overly complicated, but I thought it was a pretty clever solution. I'll post the client-side flash code for this sometime in the future. Jesse has a copy of the code, but it still hasn't quite stabalized yet, and I'm sure he's sick of me emailing him updates. ;-)
There are still some things I need to work out before releasing anything to the public. For one, because each application is it's own socket server, it runs a little slower than expected (not to mention it's all C# managed code here...). I have some optimizations in mind to improve performace, but I just haven't had the time to try implementing anything yet. Additionally, each server tries to use the same port (I just picked 5558 for kicks), only one program can run at a time. I'll need to modify the code to keep trying ports until one is found, then set a variable in the Flash movie so it knows which port to connect to. Either that, or I should try to create one instance of the server for all Applications that stays in memory until all "SharpFlash created" applications close. This is probably the best solution, but would require the most of my time to figure out.
Anyway, to tantalize some tastebuds, I decided to include a preview image of what I have working so far. I've just implemented the "title bar button" options tonight (i.e. you can now build .exe's without a close button, for instance). Check out the screenshot: ![]()
I think that's about it for tonight. Of course I have more to talk about, but I'll save that for another time as this is already getting long. I have a whole lot of things I want to do with this program, and I'm really excited about everything (gee, can't you tell?). I want to get it out the door ASAP, but I also don't want to release anything that's crap either. Either way, I WILL be releasing source with this, once it stabalizes, and I welcome the community to dive in on the development.
I envision this as being a great learning tool and application overall for the Flash community. I hope that people will be able to use this on an enterprise level in the future, once the feature buildout nears completion.
So much to do... so little time...

Leave a comment