Welcome Guest, Not a member yet? Register   Sign In
How to connect flash database and CI anyone had any idea?

[eluser]chazy (aldever calvo)[/eluser]
Anyone can help me pls?

Theres a database called 'flash' or do you mean connecting to a database using flash?

[eluser]chazy (aldever calvo)[/eluser]
i mean connecting flash to my database for web application...

You need to explain this more for us to help you

Do you want to display flash video?

Which has nothing to do with a database.

Please explain what you want.


[eluser]chazy (aldever calvo)[/eluser]
no, it's not a video, it's an interactive environment, a simulated laboratory.
i am having an undergrad thesis about an online laboratory which is interactive and implemented a simulater in flash...
and i used ci for my web page...
my problem is.. i dont know how to connect the flash environment which is an swf into my database...
the output of flash will be the student grade after a student performed an activity in the simulator and i need to store the student grade in my database which is in postgres...

[eluser]Derek Allard[/eluser]
OK, so you have a webpage generated by CI that has a flash file (SWF) inserted on it. You want the SWF to talk to a postgres database. So CodeIgniter will NOT be talking to your db, but rather this simulated lab will... is that right?

If so, these forums aren't really your best bet for finding help. Flash is basically a sandboxed environment, and you'd essentially need to handle all the db logic from within your swf file. I'd suggest you try an actionscript forum.

[eluser]chazy (aldever calvo)[/eluser]
i think i found a solution in one of the forums... amfphp and ci...
but im still trying to configure it... Smile
thanks for the replies ^_^

We use flash connected to a codeigniter app pretty heavily. You can really send anything back and forth. We use the cairngorm framework for our flex app which has a good Services model built in that lets you just call any codeignter controller and do whatever you want with the response. You can send it xml, json, or whatever you want. AMFPHP would surely be better performance though.

[eluser]chazy (aldever calvo)[/eluser]
any good sources for integrating cairngorm and codeigniter?..i would like to give it a try... i am 100% done with my site in ci... and i am going to embed .swf in one of the pages... whats lacking is inserting data into flash..


I am not really good at CI so I cannot answer your question to the max. But I can clear up things for you and for some readers.

Flash is an interface. More like an HTML. Flash/AS3 is like HTML/javascript. So anything you want to send to your server, CI or any PHP, you'll have to send it in a form like: POST, GET,... And then your server script (CI in this case) will handle it (filtering, security, session, ...).

When the server sends back data to your flash interface, flash will need XML standard. The disadvantage of that is that, any hacker can read it (just by using a flash decompiler to get your AS3 code, and Charles to catch the XML data sent to it). But if you are unaware with that, going XML is the easiest way. Another disadvantage of XML if the amount of unnecessary data sent back and forth. I mean all of these XML brackets and tags ...

To solve these problems, Adobe made a more secure way to interact with AS3 than XML. They call it AMF. That way, the form and data sent are encrypted. It is more difficult (not impossible) to hack it. And the server needs codes to decrypt it. There are a lot of ways to do it based on your server type. Microsoft server has their way, Coldfusion has a different way, some use C/C++ for fast perfomance, some are selling theirs, some are free... Talking about PHP, there are few free code you can use: AMFPhP, ZendAMF, ... I think CI prefers AMFPhP, but it is not very maintained anymore, developers start to move to ZendAMF or something else. As PHP 5.3 is becoming more popular, I think that AMFPhP is going to fade out in few years.

For ZendAMF: check this out http://ellislab.com/forums/viewthread/180414/
For AMFPhp: check this out http://codeigniter.com/wiki/Amfphp_and_CI/

But if you are good at CI and do not want to burden with external code, just go with XML style. Google XML ActionScript and you'll find lots and lots of tutorial there.

Theme © iAndrew 2016 - Forum software by © MyBB