View Full Version : flash and CPP
mmakrzem
05-10-2006, 04:14 AM
Does anyone here know if it is possible to imbed CPP function's into flash? I have a lot of CPP code that accesses custom hardware, that I would like to be able to call from within flash to make everything work together.
Xiotex
05-10-2006, 05:35 AM
Depends in how you are hosting the flash player... if you are talking about the bare bones player on a bare bones web page then not likely unless you can trap javascript commands via some java/ActiveX plugin.
If however you are hosting the player through some kind of ActiveX method in your own executable then look into hooking the fscommand mechanism and use this to communicate back and forth with the flash player.
mmakrzem
05-11-2006, 04:11 AM
OK. I'll take a look to see if I can find some examples of fscommand being used with CPP
iopred
05-11-2006, 08:33 PM
Flash 8 has a more advanced implementation of FSCommand now, its the flash.external.ExternalInterface class, you can check out the Flash documentation here:
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002200.html
Additionally, you can make a simple XML Socket and go through that, a few small applications do that such as SOS, which allows trace commands outside of the Flash IDE.
As for C++, I'm not sure how much documentation there is, but atleast in VC++ and VB it used to be incredibly easy to embed a Flash movie and call FSCommands, not sure about External Interface however.
mmakrzem
05-12-2006, 04:13 AM
Flash 8 has a more advanced implementation of FSCommand now, its the flash.external.ExternalInterface class, you can check out the Flash documentation here:
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002200.html
Additionally, you can make a simple XML Socket and go through that, a few small applications do that such as SOS, which allows trace commands outside of the Flash IDE.
As for C++, I'm not sure how much documentation there is, but atleast in VC++ and VB it used to be incredibly easy to embed a Flash movie and call FSCommands, not sure about External Interface however.
I'm very new to flash so I find building anything still to be a challenge.
I took a look at flash.external.ExternalInterface however I don't have a clue what to do with it. I also couldn't find any examples.
In my current project i had that issue too, i used a little "trick"
in flash i just have a "myaction" variable. I read every frame in my game.
then a good old switch / case with all possibilities. and resets it to 0 if i processed the action. Not perfect, but that works and it's easy to set up.
Jmc.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.