This content has been marked as final. Show 6 replies
These are always fun projects.
To answer your last question first, you could send all the text along in the url. It would look something like this:
The text is url encoded, which Flash can do for you.
Then in the PHP (or whatever server side language you use) you can pass the text into the SWF object easily, using FlashVars. Or if you don't want to use any server side language at all, you could actually do the same thing but link directly to the .swf, like this:
Then in the .swf the variable "mytext" is available.
But you are exactly right, this would mean that anyone could insert any message they want. This isn't that big of a deal, since it's just a harmless message wrapped in an animation, but the url is pretty messy looking. If you had some way to hide the url from the user, ie using an HTML <a> tag with friendly text, that would largely fix that problem.
I think that would be a perfectly fine solution for a fun little app like this.
Now, to do it with a clean url, you will need to user server-side scripting, though nothing too intense. You wouldn't have to get into XML, but you would probably want to use a database. Or you could actually use the server-side script to simply create text files. Then you create a link that looks more like:
You could either pull a row out of a database with that id, and feed it into the Flash (Flash will treat it just like a text file, so you still use LoadVars, only the url points to a PHP which returns text, rather than an actual text file), or you could pass that id into Flash and Flash loads up 1432.txt.
Hope that helps and good luck!
Thanks for the many options you list.
I would want to go for this:
- create on 'input page' on which people would create their xmas cards in the following way. All the date to be stored in a database so the 'clena URL version' can be implemented:
1) click a button 'create new card'
2) enter the greeting bit of the card ('Hi Bob,'
3) enter the body of the message
4) enter the sign off ('Have a good one, Ed')
5) enter recipient email
6) enter their own email
7) click preview
8) have a choice of edinting the message (back to previous page) or sending it off
- for the viewing o9f the card:
-- the link is a clean link (i.e. no message text in the URL)
-- the .swf loads in one row of the database as a text file loading the 'greetings', 'body' and 'signOff' vars
How do I get the swf to load the right data from the database?
How to I prepare the data from the db so that flash can read it as it would read a text file to fill its variables? I will be using php for this.
I'll tryu and figure much of this out in the course of my morning here - but do youhave any pointers to pre existin scripts -- woudl be very much appreciated. I am used to developing apps with php and mySQL, usually using the interakt php stuff, now it's calleed the adobe developers tool box (but has lsot a lot f its original functionality); and am reasonably up to speed with actionscript v2
OK, so I got the database set up and working and I got the swf set up and working.
the problem is how to I get them work together?
I have a php page on my server now that based on an ID number I am sending it, it returns a text file that the swf can read and nicely load into the it and display.
How to I get the ID into the swf so that this call can be made from the swf.
So far I have tested it with the link hared coded into it, so I know it would work if flash made that call, but I need flash to somehow pick it up from it external html page that is created by the php script.
Is this possible?
that's exactly what I ended up using! took me a whiule to find and I started to loose believe that this possibility HAS TO exist!
So our proof of concept scraped in with about 5 minutes to spare at 4.55pm !