Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 00:39
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  Macromedia's MyPhoto Application Ported to AMF-PHP
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Macromedia's MyPhoto Application Ported to AMF-PHP  (Read 6065 times)
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« on: 03/02/03, 20:14 »

There's a great article on Feasible Impossibilities showing how to use AMF-PHP with Macromedia's MyPhoto Application.

You can read about it here:

http://www.impossibilities.com/blog/entry_blog-93.html?1182059298

Thanks to Robert M. Hall for this one.
Logged

-Jeff.
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #1 on: 03/03/03, 05:24 »

I think we all are expecting some words from Macromedia saying something about this. Just a couple of words from Mike Chambers in the posts of Robert Hall's article

Quote

In the past we havent commented on such projects (re : jgenerator), but we also have not done anything to discourage them (and in many cases we have supported them).

mike chambers


Jorge
Logged

ev
Global Moderator
Systems Administrator
*****
Posts: 502



View Profile WWW
« Reply #2 on: 03/04/03, 15:28 »

it really disgusts me that macromedia wants us to pay for 3rd rate tutorials and apps.  the only thing worth buying are a couple of those components, and even then...
a lotta them are rehashed standard components, like the "input box" and crap like that.
Logged
cmyk
Jr. Programmer
**
Posts: 55



View Profile WWW Email
« Reply #3 on: 03/05/03, 16:01 »

http://www.impossibilities.com/myphotos/

the example won't work in safari (1.0v60). i wonder, why. also my application i just did using amfphp won't work.

furthermore macromedia's new demo site won't do it for safari either... Lips Sealed

cmyk
« Last Edit: 03/05/03, 16:02 by cmyk » Logged
ev
Global Moderator
Systems Administrator
*****
Posts: 502



View Profile WWW
« Reply #4 on: 03/05/03, 18:52 »

i read an article in the latest issue of business week or fortune, i forget, but anyway...
it talks about safari and it does mention that it has a lot of bugs to work out including problems with macromedia flash player.
Logged
cmyk
Jr. Programmer
**
Posts: 55



View Profile WWW Email
« Reply #5 on: 03/06/03, 05:19 »

true. it's still beta after all. but they greatly improved the speed of the flash plugin. it's now almost as fast as in IE. mozilla still sucks at flash, but luckyly it works with remoting. i sent apple a bug report on this. i'm sure they'll fix it pretty soon. they are a lot better at fixing bugs than macromedia. flash mx on OS X just sux.
« Last Edit: 03/06/03, 05:20 by cmyk » Logged
Micha
Server what's that
*
Posts: 2



View Profile Email
« Reply #6 on: 03/06/03, 05:43 »

hi,

thanks for posting that URI. Itīs a very nice example.
I had a look at the source class file which you can view here: http://www.impossibilities.com/blog/amf-php_tutorial.php
There I came across that 'methodTable' stuff. Please can someone explain me, what this is used for? Or maybe a link to an explaining site?

Thanks in advance.

@cmyk: None of the amfPhp stuff works in the 'Safari' browser. It took me a few days to figure out that it was not a fault in my code. But i learned my lesson: never develop on a beta software Wink

Micha
« Last Edit: 03/06/03, 05:44 by Micha » Logged
cmyk
Jr. Programmer
**
Posts: 55



View Profile WWW Email
« Reply #7 on: 03/06/03, 06:20 »

micha,

i will try to tell you as much as i know about it. i am very new to flash remoting and amfphp (couple of days). so if i make mistakes or the like, more knowledgable folk should correct me.

the method table is used to tell flash what functions (i.e. methods) are available from a service.
in the service browser you can add the discovery.php as a gateway. then add dbservice.php (put it in the services directory) as a service. now all the functions available from that service are listed.
note that the service php has to have the same name as the class name (dbservice.php <> class dbservice).
what i also found is that the number of arguments you send to a function should be reflected in the
"arguments" => array ("arg1","arg2")
statement. if you send to many args, an error will be raised.

i don't know much about the method table. it works for me, but i would also appreciate if someone could give us an in-depth explanation of it.

hope this helped.

cheers,
cmyk

discovery.php on root of flashservices:
Code:
<?
    include "app/gateway.php";

    $gateway = new Gateway();
    $gateway->setBaseClassPath("services/");
    $gateway->service();

?>

this is my dbservice.php (flashservices/services/dbservice.php)
Code:
<?

class dbservice{
     

   function dbservice(){

      $this->conn = mysql_pconnect("localhost","xxxxx","xxxxx");
      mysql_select_db("test_amf");
   
   
   // method table
       $this->methodTable = array(
      "getAll" => array(
      "description" => "Get all the entries from the addressbook",
      "access" => "remote",
      "roles" => "role, getAll",
      "returntype" => "mysql result",
      "arguments" => array ("arg1")
      ),
      "updateRecord" => array(
      "description" => "updates the selected Record",
      "access" => "remote",
      "roles" => "role, updateRecord",
      "returntype" => "array",
      "arguments" => array ("arg1")
      ),
      "createRecord" => array(
      "description" => "creates a new Record",
      "access" => "remote",
      "roles" => "role, createRecord",
      "returntype" => "string",
      "arguments" => array ("arg1")
      ),
      "deleteRecord" => array(
      "description" => "Deletes a Record",
      "access" => "remote",
      "roles" => "role, deleteRecord",
      "returntype" => "string",
      "arguments" => array ("arg1")
      )
     
      );
     
   }
// dbservice methods

   
   function getAll(){
      return mysql_query("SELECT * FROM addressbook");
   }
   
   function updateRecord($arg){
      $sql ="UPDATE addressbook SET ".
      "firstName = '".$arg[1]."', ".  
      "lastName = '".$arg[2]."', ".
      "street = '".$arg[3]."', ".
      "streetNumber = '".$arg[4]."', ".
      "town = '".$arg[5]."', ".
      "phoneNumber = '".$arg[6]."'".
      " WHERE ID = '".$arg[0]."'";
      $result=mysql_query($sql);
      if ($result) {
         return mysql_affected_rows()." records updated.!";
      } else {
         return "FAILURE! Could not update the table! " . "ERROR nr. ". mysql_errno().": ". mysql_error();
      }
   }
   
   function createRecord($arg){
     
      $sql ="INSERT INTO addressbook (firstName, lastName, street, streetNumber, town, phoneNumber)" .
      " values ('" . $arg[1] . "', '" . $arg[2] . "', '" . $arg[3] . "', '" . $arg[4] . "', '" . $arg[5] . "', '" . $arg[6] ."')";
      $result=mysql_query($sql);
      if ($result) {
         return mysql_affected_rows(). "new record(s) inserted!";
      } else {
         return "FAILURE! Could not update the table!";
      }
   }
   
   function deleteRecord($arg){
      $sql ="DELETE FROM addressbook WHERE ID = '".$arg."'";
      $result=mysql_query($sql);
      if ($result) {
         return mysql_affected_rows()." record(s) DELETED!";
      } else {
         return "FAILURE! Could not update the table!";
   }

}
?>

« Last Edit: 03/06/03, 06:26 by cmyk » Logged
vesa kortelainen
Administrator
Systems Administrator
*****
Posts: 3450


View Profile
« Reply #8 on: 03/10/03, 04:16 »

Guys,

If you are in AMF PHP Post list, you may notice this (I just got mail), however, you may check out JD's thread about AMF PHP legalities & Macromedia..

just a "note"..

Vesa
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!