Ninjakreborn Posted August 14, 2006 Share Posted August 14, 2006 I found out what I needed to find out, I have a quick question. I am doing something called "flash remoting" in php, but a little different.What is the best method(he knows actionscript, I don't I only know php). Here is the thing, I am creating the functions in php. I create them using php, he is wanting to be able to call those functions from directly inside actionscript. Like if I set up a function to add new users into a database, in the middle of his actionscript programming logic he wants to be able to call the funciton out of nowhere, and for it to work, and do what it's suppose to do, w hat is the best way to get him to be able to do this.??? Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/ Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 [quote]what is the best way to get him to be able to do this[/quote]Pay him? Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74727 Share on other sites More sharing options...
Ninjakreborn Posted August 14, 2006 Author Share Posted August 14, 2006 Very funny:SI meant he is hiring me to do the php functions. I need to make it to where he can call the php functions in flash. And them do what they need to do.? Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74738 Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 Err, i dont know much about actionscript, but is it possible to set up all of your php "functions" as individual files? And then simply link to them or something? Perhaps passing any information the functions require using GET? Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74741 Share on other sites More sharing options...
Ninjakreborn Posted August 14, 2006 Author Share Posted August 14, 2006 The way they use to do it, is create the functions in php, save all the results as xml. Pass it to flash's built in xml processor, parse it, cut the information up, use it, package it back as xml, and send it back to php, where you have another xml parser to parse it and do what's necessary. Called "remote flashing" or "flashing remote" one or the other don't remember which. In flash there is a function called GetAndLoad() that does all the internal stuff for you, but it doesn't seem to do what he wants. I need to figure out, does php have something, like passing variables from php, to javascript and back, the same with flash Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74746 Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 You can parse variables to and from PHP with ajax... Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74754 Share on other sites More sharing options...
hitman6003 Posted August 14, 2006 Share Posted August 14, 2006 [quote author=GingerRobot link=topic=104248.msg415759#msg415759 date=1155589249]You can parse variables to and from PHP with ajax...[/quote]You can send information from the browser to the server via ajax, not necessarily "parsing variables", and it doesn't have to be php on the server. In fact, it can be plain HTML/text if the programmer wanted.I don't think that ajax is an option here. I'm not familiar with actionscript, but my understanding is that the way for the two to communicate is via text files. They can be either xml, or just a formatted text file that both programmers can then extract the data from. If the two are running on the same server, then there should be a way for actionscript to execute a php file, even if from the command line. If they are not on the same server, or even if they are, then he should be able to call the page/function via a url and pass most parameters via the url. So, if each php "function" was a seperate page, then he would only have to go to http://your.server/phpfunction1.php?var1=something and your "function" would return the results. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74759 Share on other sites More sharing options...
GingerRobot Posted August 14, 2006 Share Posted August 14, 2006 I dont really see there is much differance between passing information and passing variables. I mean, you are going to need to send the contents of the variable, so you can send it to the php script either by post or get, and can retrieve any contents by manipulating the ouput of the php script and then manipulate the response with javascript. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74761 Share on other sites More sharing options...
Ninjakreborn Posted August 14, 2006 Author Share Posted August 14, 2006 That's sort of what I mean, but it's in the same page, like if I create (for example) just a simple echo hello world function, he wanted to be able to call that functions without flash, even like 10 times, and those 10 places it outputs hello world, on a site that is done totally in flash, like have php functions usable in flash. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74772 Share on other sites More sharing options...
trq Posted August 14, 2006 Share Posted August 14, 2006 Using flash as apposed to html is not really that different. At its most basic....[code=php:0]function welcome() { echo "message=hello%20world&name=foo";}if (isset($_GET['action'])) { if ($_GET['action'] == 'welcome') { welcome(); }}[/code]As you may see... flash expects to be returned a string much like url perameters. The above example (when requested from flash using scriptname.php?action=welcome) would make available the variables [i]message[/i] and [i]name[/i] to flash.Of course for more data your probably best looking into passing xml around, but the basic concept is much the same. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74812 Share on other sites More sharing options...
AndyB Posted August 15, 2006 Share Posted August 15, 2006 This might help with the process of understanding -> http://www.kirupa.com/developer/actionscript/flash_php_mysql.htmBefore coding anything, I'd make sure you have written down and agreed just what data is going to be sent to each function and in what form, and just what data is to be sent back and in what form. And any 'special' cases that vary from those requirements. Agreeing before starting may save you both time and money. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74862 Share on other sites More sharing options...
Ninjakreborn Posted August 15, 2006 Author Share Posted August 15, 2006 I might have to extend the time or turn him down, he's wanting it done by like monday it'll take longer than that for all these functions, some of the php functions themselves, are huge, and pretty deep logic driven. Quote Link to comment https://forums.phpfreaks.com/topic/17546-question/#findComment-74897 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.