Onideus_Mad_Hatter
MR-Disabled
Intergalactic Cowboy
Offline
Posts: 62
My Pointy Teeth
|
 |
« on: December 12, 2006, 12:47:16 AM » |
|
I gots nyah:
* Link Edited Out
And when you hit the save button it needs to produce an image that the user can actually save to their hard drive. Problem is that Flash can't save content created within itself outside of XML files, so unless it's an image preloaded into the SWFs library it can't be saved outright within itself (well maybe, it might be possible to hack the SWFs library within itself with the new image content but that'd take days just to attempt it and even then it might not actually work).
So because of that limitation I need something that can, PHP being the most obvious choice.
The problem I'm having is getting the pixel data to a PHP script so that it can build the final image. Right now, if I send over just the pixel hex codes, separated by commas I'm looking at roughly 172,032 characters that need transferred to the script. I tried to use GET variables and it just stalled, crashed and said the URI was too long.
So my next plan is to try and compress that data first within the Flash file and then once compressed send it to the PHP script that will uncompress it and then construct the final image.
I also tried to use POST variables and that didn't work, but I think the reason it didn't is because it defaults to GET variables if you're sending teh data to an external page/script rather than to the current page itself. So I might experiment with that, see if I can get it to work first before I try compressing the data.
What I'm wondering though is if there might be another option that I'm over looking. I did consider just transferring over the image file locations and having PHP use that to rebuild the final graphic on its end, but the problem with that is that you can alter the hue, saturation and lightness of the images from within the Flash file, so that would mean I would need to send over all the color matrices for each layer as well and that would be a MAJOR hassle, not to mention I don't think the color matrices would turn out exactly the same when used in PHP as they would in Flash.
Another method I've considered would be to have the Flash file save the pixel data in the form of an XML file and then have the PHP script simply work off that...the only downside to that is coming up with a viable means of session tracking. I was thinking I could use a basic file name with a date/time stamp on it and maybe include the users IP as apart of the file name, then after the XML file is created on the server it'll launch the PHP script which will then access the pixel data in the XML file, construct the savable image and then delete the XML file off the server.
I don't much like that option though because then it's sort of needlessly writing, deleting and rewriting data to the server constantly which equates to more wear and tear on the server.
- Edited by Mitch for Adult Content, If you wish to see the link (to help the poster out) please PM the poster for a request. Thanks!
|