A Flash Developer Resource Site

Page 3 of 3 FirstFirst 123
Results 41 to 46 of 46

Thread: 'Tutorial on How to use PHP/mySQL interactions

  1. #41
    Gerard_pp
    Join Date
    Aug 2007
    Posts
    69
    wow, thanks for this weasome post!!!

    ok, here's my question: knowing that i can send and retrive information (variables) from flash to php and vic. how can i stablish a dinamic comunication between flash and php where i can see an element movement that everyone logged in can see it too?

    this is the way i think i can do it (in fact it works, but very very slow):

    Code:
    onClipEvent(load){
    function positioning(){
    element._x= recivedata.newposx;
    element._y= recivedata.newposy;
    }
    }
    
    onClipEvent(enterframe){
    senddata.positionx = element._x;
    senddata.positiony = element._y;
    
    senddata.loadAndSend("myphp.php", recivedata, "POST");
    recivedata.onLoad = positioning();
    }
    please help...
    Figure out a way to solve it... i'm not gonna be here forever...

  2. #42
    Member
    Join Date
    Jun 2007
    Posts
    89
    Yes, that would work slowly, because you are attempting to use LoadVars() as a socket connection, (which it is not). LoadVars connections close once theire tasks are complete. Each use of LoadVars opens a new connection. The lack of a constant connection is what is causing the lack of speed. However, as of now, I'm not certain how to use sockets in 3DFA.

  3. #43
    Gerard_pp
    Join Date
    Aug 2007
    Posts
    69
    im triying to make an rpg multiplayer game on flash, and i want to know. is there a way to make this, conecting to a data base using only php/mysql and loadVars()?

    i was reading on a site (cant remember where) that i can make it work if i reduce at minimum the amount of information requests to the server.

    in theory, it sounds it sounds very logical, but when apliying to practice i ended up with tons of commands...

    so, recalling... is there a way to make it work with this method?
    Figure out a way to solve it... i'm not gonna be here forever...

  4. #44
    Member
    Join Date
    Jun 2007
    Posts
    89
    Flash ActionScript offers other types of connections. Such as "local connection", "net connection", etc... I have only been using flash for a few months, and never have I used it for an online game. Therefore, I have little experience with connections and Flash. Nonetheless, I have programed sockets before, and so I'm confident your problem is with loadvars. It just isn't intended for a constant connection.

    What you are attempting to do is equivalent to trying to create a cartoon with each frame in a different html file. Each frame would have to be loaded. Which would obviously be slow. If no one on this forum has more info for you, try googleing "flash sockets",r "flash connections" , "actionscript connections", etc... I know they exist.
    Last edited by man_id_unknown; 08-12-2007 at 04:35 PM.

  5. #45
    Gerard_pp
    Join Date
    Aug 2007
    Posts
    69
    thanks bro!!!!
    Figure out a way to solve it... i'm not gonna be here forever...

  6. #46
    A Senior Newbie - How Odd ForumNewbie's Avatar
    Join Date
    Mar 2003
    Posts
    590
    Hi,

    Glad to see this thread's still being useful, even though my server's still waiting for me to find time to rebuild the tutorial !

    The solution to multiplayer games in 3DFA is definitely to use a socket server.

    There is another thread on this Forum where I was able to use 3DFA to build a movie where I could move the mouse on one Flash movie on one client, causing a pointer to move on a Flash movie running on another client. The performance was actually really impressive. Unfortunately, until my server is reconfigured, it won't work, but you should be able to find the thread and download the source and make it work on your own machine. If you find the thread and the link is to my server at morgan-multinational.com, just change the address to morganmultinational.com. (My hosting company went bust, and the site got hijacked by some site-sitters from Jamaica so I'm having to move everything). The content has moved from a Windows box to a Linux box, so the SQL data and XML socket server might not be present/installed yet.

    Hope this helps a little,

    Morgan.
    Please note that my domain has changed to http://www.morganmultinational.com

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