Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Supporting Technologies > Server-Side Scripting

Thread Tools Rate Thread Display Modes
Old 04-15-2009, 10:56 PM   #1
Registered User
Join Date: Apr 2009
Posts: 2
Question problem when reloading page multiple times with loadVariablesNum/PHP

Alright, I will try to be as detailed as possible..I am working on a multiplayer game ( www.battlebubes.com ).. the way the game works is that there a bunch of sections...every time the player goes to a section...the flash file(AS2-flash 8) sends info to 2 different php files, which in turn connect to the mysql database...then the php file sends the info back to flash...this all works fine...until you try to do things to quickly(the easiest example is if I try to reload a section a bunch of times--the first 5 or 6 times..everything works fine...but then it gets progressively slower)
At first I thought it was a problem with my php or mysql...but then I did a test where I set variables for all the times in the frames and in the php code.
It turned out that the php and mysql were fine, but as you can see below, the times inbetween frames where I send and recieve info from the php files are where all the time is taking(the following are the results after I reloaeded the section about 10 times...they get longer and longer if I keep reloading)
Frame 1 and 4 is where the loadVariablesNum is

frametime1 = 1239834050.984 -
frametime2 = 1239834055.843 -
frametime3 = 1239834055.921 -
frametime4 = 1239834056.015 -
frametime5 = 1239834061.671 -
frametime6 = 1239834061.765 -

what could be some possible reasons?
drummerjeff is offline   Reply With Quote
Old 04-16-2009, 01:24 AM   #2
Registered User
Join Date: Apr 2009
Posts: 2

alrighty, after some more research...I found that it has to do with the sending of variables...once the info gets to the php file, it gets recieved back fast. So now that I know the problem is how flash is sending the info...I am at a loss on why this is happening.
Since I am just reloading the same section over and over...nothing has changed-and it works fine for the first bunch of times. Does the flash read all the data in from the php file and somehow count it as new info and this creates more and more info to send as you go about the game?...I have been searching online all day and can't believe nobody else has run into this issue
drummerjeff is offline   Reply With Quote
Old 04-16-2009, 10:17 PM   #3
tadster's Avatar
Join Date: Feb 2009
Location: Texas
Posts: 2,111

The short answer is that it's a memory problem, your overclocking your server.
You can see this in action on your test setup.
I ran into this same thing not too long ago, i don't know what your test setup is, but on my test setup, (apache on xp), the overclock could be seen in the task manager (the computer would run above 90 to 99%) the same thing is most likely happening on your server, thereby slowing things down.
The solution is xml sockets, so that you can have a live connection to the server. Sockets are complex to handle but for a multiplayer game they are a must. It involves having a socket server between your flash and your main server.

This problem is something inherent to flash. It's something they've delt with in AS3.
Another solution is to make sure that calls from the flash to the server don't happen too soon together, to prevent the overclock they need to be at least one second apart, but of course in the case of a multiplayer game, this is not wanted in most cases, so xml sockets are needed.

hope this helps
tadster is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem changing swfs in page (bug being caused by webservices) tom_S ActionScript 2.0 0 01-24-2008 03:29 PM
Pageflip - iparigrafika.hu - reloading problem gigabytes Other Flash General Questions 1 01-10-2007 03:48 AM
Enter key launching page multiple times Why? IrishGuyCE ActionScript 2.0 3 12-07-2006 07:11 PM
passing radio button variables/values acperez ActionScript 1.0 (and below) 10 03-17-2006 12:20 PM
Sending data without reloading the page bubba Server-Side Scripting 5 09-15-2004 07:43 PM

All times are GMT. The time now is 04:20 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.