A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: phpobject or similar working with flash7

  1. #1
    Junior Member
    Join Date
    Jul 2002
    Location
    berlin
    Posts
    23

    phpobject or similar working with flash7

    hi

    my problem is quite simple, but i can imagine that there might be no solution to it.

    i hope somebody here can prove me wrong.

    i am using phpobject and am quite satisfied with it up to this point:

    it doesn't work with flash 7 (took me ages to figure that out):

    if i export as flash6 (i'm using flash mx pro 2004 - 7.1) everything works fine,
    but i'd like to use the css-support new in flash7,
    and when i'm exporting my swf as flash7 it says "please provide a valid key".


    so if anyone could tell me whether i can/should

    make phpobject fit to flash7 or
    use css support in flash 6 or
    use any alternative to phpobject (musicman? amfphp?)


    thanks in advance

    d

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    as far as I have seen macromedia is still working on some remoting / amf components.
    The following is just calling the native functions, without any wrapper code, and should work

    nc = new NetConnection();
    nc.connect('http://yoursite.com/gateway.php');

    reply = {};
    rely.onResult = function(result)
    { // result will be an object
    };
    nc.call('func.code',reply,data);

    Musicman

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Location
    berlin
    Posts
    23
    hey musicman,
    thank you very much for your answer.

    just... could you explain a bit more bottom up what this code does?

    it's not completely new to me but i made phpobject work using the instructions and with plenty of trial&error-method, so maybe this gives you a bit of a picture of my knowledge.

    specific questions would be:

    rely.onResult = function(result) -> i assume this means reply.onResult?
    { // result will be an object
    }; ->how do I init my object from the point where the result is given back?
    myObject = result?

    nc.call('func.code',reply,data); ->what exactly does the func.code mean?
    do i have to fill in the php-syntax that starts the php-side object?


    oh, and could it be i don't need phpobject for this approach anymore, so that i use the nc.connect thing to just link directly to (in my case) the sql-class i build in php, or is the gateway file the one that does the transfer between flash&php?


    maybe this sounds very newbie, anyways...
    thank you

    d
    Last edited by trixie stalker; 05-10-2004 at 07:51 PM.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    this is intended to go with the amfphp gateway.
    If you look at version 6 remoting docs, and at the amf examples, they all use a slightly different code, utilizing a netservices.as file
    So this code just avoids the netservices.as

    The remoting model (as implemented by mcreomedia's own server) assumes a single url to handle all requests and therefore passes a two-level function code to the server.
    The data passed to the server could be anything - e.g. an object followed by two strings
    The return value is one single php variable, usually an array or object.

    Musicman

  5. #5
    Junior Member
    Join Date
    Jul 2002
    Location
    berlin
    Posts
    23
    thanks again,

    i had quite a hard time the last couple of hours trying to make this work, and unfortunately i failed

    so i feel a bit sorry to bother you again,
    but if i provide you with some basic information could you explain it to me again the babysteps way?

    so i have this class called sql which includes a twodimensional array of objects for each type of data i want to get from my sql-database (like city_obj, user_obj etc,
    and a function callerd start which inits the array:

    class sql

    //...

    function sql()
    $this->start();

    //...

    function start()
    $this->data["city"] = array();
    $this->data["user"] = array();
    //etc.

    $this->data["city"][0] = new city_obj();
    //etc.

    (don't care about syntax, this is just to show the structure of my class)

    i tried both using your suggestion as well as using the getService method (the standard way).

    thanks for caring

    d

  6. #6
    Junior Member
    Join Date
    Jul 2002
    Location
    berlin
    Posts
    23
    ah forget it,

    i'm stuck on this for 14 hours now and i think it would be easier to just get along with flash 6 and no css support.

    musicman, thanks again for your support

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center