Getting the server side of things to talk to Flash

brutfood

Registered
I went for Ask a volunteer because I thought perhaps this question was too specific - but maybe not. Feel free to make this thread public if you think others may benefit.

I've just bought OS X (10.1) because I wanted to get into developing server-side code. The included documentation is inadequate in this respect.

My specific problem at the moment is that I want to get a server to talk to Macromedia Flash (.swf). I want to be able to save and retrieve variables.

I can crack the Flash side of things. On the Server, I want either to be able to receive information, do a bit of easy text processing perhaps, then either create small text files and a directory structure. Or send out the appropriate text file data when a .cgi script is asked in the right way.

I want to be able to allow multiple users to access the data that correspond to them - but no-one else. I want a solution that is portable to other types of server. In fact, I just want to use my mac as a development platform - It won't have to (and doesn't have the ability to) talk to the outside world. Later I'd like to set up my own server on the Internet - but that's another story for another time.

My main problem is getting started. Assume I know nothing - however I'm happy with any programming language applicative, imperative, logical, Assember/DSP, hex etc. It's a sort of psychological flaw that I love this stuff.

So, how do I get from the lovely aqua interface to something that lets me write the code I want to write? What else do I need? (Without spending any more money that is).

Daniel
 
I see that I've had 3 viewings but no replies to my query.

I apologise if my question was stupid, or if I got any of the termanology wrong - but I'm new, and mostly ignorant about the server side of things.

Please tell if if the way I phrased my question made no sense.

I just need some pointers really. How do I write and test CGI scripts for example. I can handle the programming side of things - but how do I invoke the environment that they operate in?

Daniel
 
I've never designed a web app with a Flash frontend (or anything else with a Flash forntend, really), but I assume it can't be a whole lot different from a web app with an HTML front end (which I do have a bit of experience with). Hopefully I can nudge you in the right direction. Let me know if you need more detail on anything, and I'll try to help.

first, check out the chapter in the Flash manual about forms (I have Flash 4, and this is in chapter 11). This should give you a basic understanding of how to call cgi scripts using Flash.

Now, the cgi scripts themselves should go in
/Library/WebServer/CGI-Executables

The URL that this maps to would be something like:
http://host.domain.tld/cgi-bin/
(this (and many other Apache settings) can be changed by monkeying with /etc/httpd/httpd.conf -- see www.apache.org for more details).

For the actual scripts, why not use Perl, since it's already installed an fairly easy to learn, and also portable. Doco on the perl CGI module can be found at: http://www.perldoc.com/perl5.6.1/lib/CGI.html and probably in the local Perl docs on your hard drive. You probably don't care about all the html generation stuff, just how to get the parameters from a POST or GET.

As for limiting the data to certain users, you need to work out some kind of authentication system in your scripts. If you want this to scalable to a large number of users, you will probably be looking at installing some kind of back-end database as well. I've been able to compile Postgres on MacOS X without too much hassle. I've heard the MySQL has easier-to-use command line tools, and it will probably compile as well. Both of these databases are free, I believe.
 
Thank you,

I'll have a read and a play around with this stuff. I'm also investigating XML for passing information around, as Flash 5 has lots of instructions for this.

Daniel
 
Back
Top