Integrating Flash into a C++ project

Started by
5 comments, last by dougbinks 11 years, 10 months ago
Hello everyone,

About half a year ago, I started learning c++, using the SDL library. I've managed to obtain a fairly good understanding of the library, and the language as well, allowing me to create simple 2d games. Before I started with C++ however, I used to do all my projects in Actionscript 3.0. Now..this question might be a little noobish, but I thought that maybe one of you could point me in the right direction. smile.png I noticed that a lot of games these days use Actionscript 3.0 and Flash to do their GUI.

The question is; How can I integrate my Actionscript 3.0 code into my C++ project? I've done a google search, but all the tutorials I encountered are a little bit out of my league. Just a link to an article that explains it from a beginners point of view, or something that can point me in the right direction would be helpful enough smile.png.

Thanks in advance!
Advertisement
here are your options:


pure flash + actionscript:

http://tulrich.com/geekstuff/gameswf.html // free, lack of proper documentation, diffucult setup
http://www.scaleform.com/ // very expensive, easy setup, support

browser integration: (browser in your game)

QtWebkit // free, difficult to integrate
Berkelium // free, difficult to integrate
Awesomium // costly, easy to integrate
chromiumembedded // free, difficult to integrate

as you see, if you dont want pay thousands of dolars you need to get ready for many sleepless nights.
There are many pieces of middleware that support Flash for UI, especially in game consoles.

As mentioned, they cost several thousand dollars.

Professional studios can easily justify the cost since it saves many months of effort. The small fee is offset by a huge time savings. Hobby projects, the offset is not so much.
There is librocket which looks pretty interesting but I admit I have never used it (although I really want to).

In addition, the only way you're going to integrate flash into an engine is to get a copy of the AS3.0 spec and then work from there (or plonk down the money for Scaleform GFX UI). Like others have said, it is overkill (and it even tends to be for a lot of AAA games). If you really would like to use flash in a project, I would suggest taking a look at UDK and UnrealScript and then go from there. You can pull off some really awesome stuff with it:

[media]
[/media]
You could also take a look at GameSWF - a C++ open source flash player designed for game UIs. It was the basis behind the commercial Scaleform game UI middleware.

Note that libRocket doesn't actually play flash, but it's quite useful for UIs if you want a html and css style data driven approach.
Thanks for the replies everyone. Very enlightening! I think I might try that GameSWF, and see how far I can go with it. I'm usually not afraid of spending countless nights into something like this. Anyway..I've also taken a look at the UDK, but I haven't really found out whether or not I can actually use C++ in it, instead of it's own UnrealScript. It's not that I mind using it though, but I think it's better to learn one language at the time :)
UDK can use C++ by calling DLLBind from UnrealScript. You'll still need UnrealScript for a lot of things though.

This topic is closed to new replies.

Advertisement