Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flash General Questions > Other Flash General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-26-2005, 11:08 AM   #1
softz
Registered User
 
Join Date: May 2005
Posts: 16
Default PHP or XML for this Flash Project?????

Hey all
ok im want to make a news bar kinda of thing in flash
what would be best to use?
XML or PHP, want i want to happen is the client inputs a value, that displays in the flash moive on there home page, but i want the user to be able to change the value from there site, so they dnt need flash or any thingy, so they can just enter news, i dnt know which is easyer
i have been looking around for php and making a php input box, which send to a varaible, then to the flash, movie but ahvnt found anything yet, and ive been lookin for a week, so now im looking at XML but have no idea about it XML
so what would be best for this project?
PHP, XML or a flash movie on a differnt page(like an admin page) that would change the value of the flash movie on the home page(if that is possible)

cheers in advance
softz
softz is offline   Reply With Quote
Old 06-26-2005, 06:04 PM   #2
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

I would say use both PHP and XML. Have an admin page (it could be flash or html, it doesn't matter) where the client can type a news item into an input field. When they submit, send that form data to a PHP script. The PHP script can save the data to an XML file. The live flash movie can load that xml file and use the data to display the news.
sleekdigital is offline   Reply With Quote
Old 06-27-2005, 06:02 PM   #3
benlowry
Registered User
 
Join Date: Feb 2004
Location: QLD Australia
Posts: 60
Default

It would be redundant to use both XML And php for this purpose. XML should only be considered if it is to provide data to someone else's site, like an RSS feed.

The reason it is redundant is the data gets pulled from mysql as a pile of strings/numbers/whatever, and formatting it as xml requires changing (and enlarging) each item and the output overall. Meanwhile, flash will take that information almost directly as it comes out.

eg:
&m1=Buy our stuff now&m2=Sale starts tomorrow&m3=New stock arrives saturday&m4=whatever&num=4

All you need to do in that case is tack on a counter which increases as you iterate through the results.

XML has its uses, but when you're calling on the database directly and have the raw data it is unnecessary and of no benefit. If you were providing text to for flash movies on OTHER sites then XML would be the smarter choice, since then it wouldn't matter if they used it for Flash or anything else.
benlowry is offline   Reply With Quote
Old 06-27-2005, 06:08 PM   #4
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

First of all, this person never said anything about having a database available. Second, if your data is structured a certain way, you can still benefit from more structured format such as XML or JSON. RSS is not the only instance where you can benefit from using XML with Flash.
sleekdigital is offline   Reply With Quote
Old 06-27-2005, 06:18 PM   #5
benlowry
Registered User
 
Join Date: Feb 2004
Location: QLD Australia
Posts: 60
Default

The only benefit of using XML is that it is platform-neutral. All it is good for is transporting data from a to b, where b is someone else's site / software / whatever.

Since he said php it's fairly safe to assume there's a mysql database involved somewhere in the story. I may be wrong on that point, but in my experience when people say php they often mean php+mysql.

There is no benefit in re-formatting the data to be xml when you have direct access to the source.

Spot the unnecessary steps:
Flash requests data -> PHP reads the data -> Convert to XML -> Flash receives it -> Flash parses XML back into what it was really close to at step 2.

Last edited by benlowry; 06-27-2005 at 06:22 PM.
benlowry is offline   Reply With Quote
Old 06-27-2005, 06:25 PM   #6
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

I feel you are oversimplifying the scenario where your data has STRUCTURE. Yes you mention the primary use of XML, data transport. However, it also gives data structure. Yes there are better, less bloated formats, but XML is widely used and easy to work with in Flash. In this case this person's data may or may not need much structure, but I'm not going to assume that. But yeah, a simple URL encoded sting of variables might work for him.
sleekdigital is offline   Reply With Quote
Old 06-27-2005, 06:35 PM   #7
benlowry
Registered User
 
Join Date: Feb 2004
Location: QLD Australia
Posts: 60
Default

It sounds like the data in question is just flat data, little pieces of news being scrolled in a box.

If it were a more complex data structure then you would be right in considering XML, it would be a suitable choice.

<root>
<message>This is news piece 1</message>
<message>This is news piece 2</message>
<message>This is news piece 3</message>
</root>

For data like this all it does is chew unnecessary resources encapsulating the data, sending it (with +x% bloat), and then parsing it back into an array or whatever.
benlowry is offline   Reply With Quote
Old 06-27-2005, 06:36 PM   #8
sleekdigital
I like pizza!
 
Join Date: Feb 2003
Location: PA
Posts: 1,310
Send a message via AIM to sleekdigital Send a message via MSN to sleekdigital Send a message via Yahoo to sleekdigital
Default

Agreed I was thinking he might have things like images and links associated with each news item. I'd like to see JSON pick up some popularity among developers... it would work really well with Flash (well actually it DOES work well)

Last edited by sleekdigital; 06-27-2005 at 06:42 PM.
sleekdigital 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


All times are GMT. The time now is 09:30 PM.

///
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.