martinchristov Posted October 14, 2009 Share Posted October 14, 2009 Hey guys. Nice to join you php freaks I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat non-traditional php functionality. here's the thing: I want to have a function which returns an image... let's say: $img = GetImage(); The function GetImage... I need somehow to execute a flash application in background, which generates an image, then exports pixel data to php. Php creates the image and returns it to $img. I'm not really imagining how should this get done. Mainly I've got no idea how to run the flash app in background. I do mostly flash stuff and php is my secondary prior. Hope some of you guys can help. Cheers from Bulgaria, Martin Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 14, 2009 Share Posted October 14, 2009 this is a class that renders a flash swf image to a jpg, take a look, may be of some help. Quote Link to comment Share on other sites More sharing options...
martinchristov Posted October 14, 2009 Author Share Posted October 14, 2009 this is a class that renders a flash swf image to a jpg, take a look, may be of some help. Hey. I think you forgot to send me what you meant. Although I don't think you understood what I need. I know how to export an image from flash to php. I need to do that whole process in background. Without any flash showing to the user at all. Only the final image. And this has to be done without any JS. Just php. Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 14, 2009 Share Posted October 14, 2009 http://www.phpclasses.org/browse/package/4312.html dammit, this was the link I meant. PHP doesn't have any threading capabilities fora start really, secondly, PHP is server side and flash is client side, just like javascript. The two have no way of communicating really. So what you are looking to do is impossible in the way you're thinking of doing it. However, I would propose you load the flash into a hidden iFrame or something similar and do it that way maybe? Quote Link to comment Share on other sites More sharing options...
martinchristov Posted October 14, 2009 Author Share Posted October 14, 2009 Yes... I know it's kind of "impossible"... but not really. I am sure there is an alternative solution. Maybe as the one you suggested. Php and flash can communicate. Why not?! It is actually pretty simple Quote Link to comment Share on other sites More sharing options...
GKWelding Posted October 14, 2009 Share Posted October 14, 2009 PHP has no way of directly loading aflash app, the only way to do this would be via javascript, this is the case because PHP is server side scripting. Flash may well have a way of communicating with PHP but that has to be initialised by flash, php can't initialise such a communication, this would have to be done via javascript or some other language and then the results from that sent to a php script. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.