Page 1 of 1

app idea - not sure how to go bout it!

Posted: Sun Mar 29, 2009 4:36 am
by cardi777
Hi,

I was wanting to make a flash ap which uses mysql. I know that you need workaround for mysql to work in flash.

Basically, in the swf, I need a button to increment a mysql value, and display what the new value is.

mysql to flash...
I was thinking of using ajax to get the value from mysql, and flash vars in the html/java to send it to flash.

flash to mysql...
I was thinking of launching a java function from the swf which would in turn increment the mysql variable using ajax.

So basically making mysql and flash possible with ajax. Is this too far fetched??? I think i may be overshooting the line here. Perhaps there is a php alternative? Looking for some easier way of doing this :?

If anyone has any suggestions, plz lemme know!

Cheers,
Doug

Re: app idea - not sure how to go bout it!

Posted: Sun Mar 29, 2009 10:19 am
by crazycoders
I've never heard of flash communicating with MySQL. It might be possible but it's definitely not native.

What you want is a layer that executes your commands on the web server so:

1. HTML/FLASH = Presentation layer, you app runs and requests information from the user
2. FLASH/XML = Flash executes an XML request to the server in the form of a GET or POST at specific urls
3. PHP/XML/MySQL = PHP receives your call, analyses the content of the call, connects to the mysql server to execute operations and retrieve information and return the content in XML
4. FLASH/XML = Parses the returned XML and executes the appropriate actions on the animation and presents the information to the user

So three layers
FLASH = View/Control
PHP = View/Control
Mysql = Model

Am i clear?

Re: app idea - not sure how to go bout it!

Posted: Wed Apr 01, 2009 4:59 am
by josh
crazycoders wrote: So three layers
FLASH = View/Control
PHP = View/Control
Mysql = Model

Am i clear?
Actually it would be

flash - client tier, contains presentation and some business logic duplicated from business tier
php - business tier, contains XML presentation ( in the context of this flash application )
mysql - storage tier, contains 0 business logic

models = business logic

Re: app idea - not sure how to go bout it!

Posted: Wed Apr 01, 2009 6:48 am
by crazycoders
In MVC, aint:

Model = Data layer
View = Presentation layer
Controler = Business layer

???

Re: app idea - not sure how to go bout it!

Posted: Wed Apr 01, 2009 7:40 am
by josh
Nope, and MVC isnt really relevant here, besides the fact it happens to be a multi-tier architecture. What you suggested is called client server, not MVC

Re: app idea - not sure how to go bout it!

Posted: Wed Apr 01, 2009 1:17 pm
by Christopher
crazycoders wrote:In MVC, aint:

Model = Data layer
View = Presentation layer
Controler = Business layer

???
Just for the record:

Model = Data & Business (Domain) layer
View = Presentation layer
Controller = Presentation layer