I have a new project that I am trying to build. I want to be
able to send information into an swf file dynmaically, store it and
finally display it on that .swf file. In the past I used text files
(information obviously stored in the text file), but it will not
work this time because I want to change the information dynamically
on the web (html form).
I was thinking about setting up an html form that would post
data to a php page, and then send that info to the swf. My only
concern with ths method that data dosn't stay there. If I run the
.swf file before I use the form, the swf will compain that there is
no info. And thats sorta my point. I want to data to "be there",
and only changes if resend the form.
You need to have some location where the data is stored.
Reading data into a swf is dynamic and volitile. When you read data
into a swf you are only reading it into memory really, not into the
actual swf document. This means that anytime you reload the page
you are going to lose the data. This means you have to have
somelocation where the data is saved. In your previous experience
you did this via a text file.
Since you have access to a server with PHP you could have
your HTML/PHP form write out an XML document to the server. The swf
file would read in this XML everytime it loads. The XML document
would only ever change anytime you resubmit your HTML/PHP form and
the XML file is rewritten.
Of course you could jsut as easily write a text file out of
PHP and read it in like you have done previously. XML is simpler in