Jump to content


Photo

question


  • Please log in to reply
11 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 08:00 PM

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.???

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 14 August 2006 - 08:10 PM

what is the best way to get him to be able to do this


Pay him?
Legend has it that reading the manual never killed anyone.
My site

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 08:25 PM

Very funny:S
I 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.?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 08:30 PM

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?

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 08:34 PM

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

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 09:00 PM

You can parse variables to and from PHP with ajax...

#7 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 14 August 2006 - 09:10 PM

You can parse variables to and from PHP with ajax...

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/p...?var1=something and your "function" would return the results.

#8 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 14 August 2006 - 09:18 PM

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.

#9 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 09:37 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#10 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 14 August 2006 - 11:28 PM

Using flash as apposed to html is not really that different. At its most basic....

function welcome() {
  echo "message=hello%20world&name=foo";
}
if (isset($_GET['action'])) {
  if ($_GET['action'] == 'welcome') {
    welcome();
  }
}

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 message and name to flash.

Of course for more data your probably best looking into passing xml around, but the basic concept is much the same.

#11 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 15 August 2006 - 01:00 AM

This might help with the process of understanding -> http://www.kirupa.co...h_php_mysql.htm

Before 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.
Legend has it that reading the manual never killed anyone.
My site

#12 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 15 August 2006 - 03:35 AM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users