app idea - not sure how to go bout it!

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
cardi777
Forum Commoner
Posts: 54
Joined: Sun Mar 29, 2009 4:26 am

app idea - not sure how to go bout it!

Post 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
crazycoders
Forum Contributor
Posts: 260
Joined: Tue Oct 28, 2008 7:48 am
Location: Montreal, Qc, Canada

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

Post 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?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post 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
crazycoders
Forum Contributor
Posts: 260
Joined: Tue Oct 28, 2008 7:48 am
Location: Montreal, Qc, Canada

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

Post by crazycoders »

In MVC, aint:

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

???
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

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

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post 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
(#10850)
Post Reply