Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-02-2008, 06:13 PM   #1
dialectric
Senior Member
 
dialectric's Avatar
 
Join Date: May 2006
Location: USA
Posts: 614
Default server-side Compiled C++ to Flash? possible?

Hi,

I am trying to sort out how best to go about a project which is a word game. It requires as an input an array of all of the words that can be made from a sequence of 2-8 letters (anagrams). There are several examples in C, and a few in python, that generate this output, and I would like to know if its possible to compile C code in some way to have it run on a server, receive a string of 2-8 letters, and either produce the array of possible words as an xml, or somehow send said array directly to an SWF (AS2 or 3).

Alternatively, could this be run locally and use external interface calls?

This ideally would support multiple dictionary files, starting with SOWPODS.
One example of such a utility, with source, is Ken Silverman's FindWords, from http://advsys.net/ken/utils.htm

I am currently attempting to code the word finder in flash, but expect that it will be much slower than a c++ tree-based version - and I don't really understand tree search yet.

- dialectric
dialectric is offline   Reply With Quote
Old 12-02-2008, 08:09 PM   #2
yell0wdart
jordanrift.com
 
Join Date: Sep 2007
Location: Phoenix, AZ
Posts: 366
Default

Was it compiled in Visual Studio? If so, you should be able to use ASP.NET and C# or VB to write a basic facade in the code behind of your aspx page or a basic web service to reference your compiled C++ assemblies.
__________________

bad developer

Jordan Rift
yell0wdart is offline   Reply With Quote
Old 12-03-2008, 05:37 PM   #3
dialectric
Senior Member
 
dialectric's Avatar
 
Join Date: May 2006
Location: USA
Posts: 614
Default

Hi Yellowdart,

Thanks for the suggestions. Its actually an uncompiled *.c source file - which I assume means its not C++ after all. In another thread someone suggested trying to use the relatively new adobe alchemy to incorporate the C code into a flash project, which, since actionscript is the only language I'm proficient in, might be somewhat easier to attempt than getting into .NET or VB as well. Not much discussion of alchemy yet on these boards, but I'm hoping not to mess with the C code much, and just take the output for AS3.

- dialectric
dialectric is offline   Reply With Quote
Old 12-03-2008, 05:51 PM   #4
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

FYI, you do need to mess with the C++ code when using in Alchemy... It won't be major, but you at least need to make some changes... That's what I have seen in Max at least...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 12-04-2008, 01:57 PM   #5
dialectric
Senior Member
 
dialectric's Avatar
 
Join Date: May 2006
Location: USA
Posts: 614
Default

One question about how to structure this adobe Alchemy project: in checking a set of user letters, or words, against a dictionary, (in this case the sowpods.txt file which is widely available, contains 260,000 words, and is 2.6 mb uncompressed), would it be best, speedwise, to include the dictionary as a string in the AS code, as a string in the C code, as some other datatype, or as an imported file?

- dialectric
dialectric is offline   Reply With Quote
Old 12-04-2008, 02:43 PM   #6
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Well... Alchemy is all new to me as well so I might not be giving you right information...

A simplified version of Alchemy is that you create SWF/SWC out of your C/C++ codes and execute a function defined in it from the ActionScript...
So, technically it does not matter where your data file is located... But I'd use external text file rather than hard coding that into your code base... and probably separate them into smaller chunks like sowpods_a.txt, sowpods_b.txt, ... , sowpods_z.txt so that the files are lighter to handle...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
flash to jpg/pdf server side wrgood ActionScript 2.0 0 06-12-2008 10:31 PM
flash calling server side script only once pandu_asorg ActionScript 2.0 1 04-03-2008 02:00 PM
Flash Media Server 2... trying to stream a simple video BradThor Flash Media Server 3 10-09-2006 01:30 PM
Flash Nav issues w/ Server Side Includes unwrittendevin Server-Side Scripting 0 09-21-2006 04:43 PM
CyanBlue's 5000th Post - Useful Threads List CyanBlue Projectors and CDs 104 02-25-2005 01:13 PM


All times are GMT. The time now is 06:50 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.