Communication between MaxGUI and HTML (Flash) doc

BlitzMax Forums/MaxGUI Module/Communication between MaxGUI and HTML (Flash) doc

Shifty Geezer(Posted 2010) [#1]
I currently use BlitzFlash with Blitz3D for my educational application, only the latest Flash update has killed integration, rendering all my work worthless. :(

Would it be possible for me to launch a Flash animation in the MaxGUI HTML viewer, and communicate between it and a BlitzMAX application?


ima747(Posted 2010) [#2]
Not an expert with HTML view but it depends on how you handle the communication... basic call and response should be handleable through the use of HTMLVIEW_NONAVIGATE flag on the HTML view, making it so links create GadgetAction events which you can trap and do what you need to with. Then you can respond via HtmlViewGo() to redirect to a new URL (same URL with different flags perhaps if it's the same flash file...)

That would work well enough for me for integrating something web based, but I flee from flash for many many reasons so don't know if that's enough for your needs...


Shifty Geezer(Posted 2010) [#3]
Thanks ima747. I need constant data updates to the Flash file as it responds to user actions in the application. I use SwishMAX for my flash editor, which has the option to import variables via URL and export vairables via POST method. This is clearly designed with server-side scripting in mind. However, I also need communication to read the Flash animation's state, to control aspects of the Blitz application - notably when to start and when to stop.

Basically I need full bidrectional comms in realtime.


ima747(Posted 2010) [#4]
Hmmm, the only thing I can think of in that case would be to find or roll your own micro http daemon and direct comms at that. So basically the flash portion of your program would talk to the bmax core via the TCP stack... depending on how much control over the raw posts and ports etc. that you have it could be as easy as opening a port and listening, but if you have to implement a full http comm suite to get it to play nice then it could get quite tedious if you can't find a module to handle it for you...

Not to dissuade you from using flash in such a way, but just for my own curiosity, why are you embedding flash (presumably as a UI) and not just rolling the whole thing in either bmax, or flash? What's the benefit from the mix for you?


Shifty Geezer(Posted 2010) [#5]
Nah, it's not for a UI. When my educational program asks questions, I have an interchangeable response animation that adds variety and engages the children. eg. Boys will typically like am avatar to score a penalty when they get a question right, whereas a girl might want...a horse to jump the fence, maybe. I need an open creation format for people to create new content that can be embedded.

There's nothing to challenge Flash in that department, with cheap and widespread editors like Swish. I'm not in a position to create my own format, renderer, and editor, nice as that'd be! Thus I have to use Flash for the rewards system. The application itself is pretty simple and maybe could be created in Flash, although I'm pretty sure it couldn't when I started 3 years ago, and my Flash knowledge isn't up to the task.

At the moment I have a finished, working Blitz3D implementation, save for Adobe creating a murderous new Flash release. I'm after the quickest, easiest solution!


ima747(Posted 2010) [#6]
Righto...

Personally I would pick 1 environment and stick with it, probably flash since as you said you need the animations etc. to be remotely manageable and you don't want to write a proprietary format and the tools to create files etc.

Good luck with Adobe not breaking everything in the mean time :0)

Not that video is amazingly easy to integrate with bmax (still looking for a module I like) but if you're just using animated feedback elements then an mpeg might be even better than flash... though there may be other file size concerns etc...


markcw(Posted 2010) [#7]
When you say "BlitzFlash" do you mean the one that accode used to sell here:
http://web.archive.org/web/20061012205950/www.accode.com/blitz.htm

Which was also discussed here: http://www.blitzmax.com/Community/posts.php?topic=51053

Or do you mean a Bmx version of Beaker's B+ code here:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1461

I haven't tried Beaker's code but it could be too slow for a constant stream of data.

Otherwise you could use a combination of sockets and xml, as suggested here:
http://www.realsoftware.com/listarchives/realbasic-games/2005-05/msg00327.html