Speed test application using actionscript 2 ( code & files )
Update:
I’ve been getting may requests to post the speed test tool code on my blog & I have finally found the fla which includes Download & Upload + some fancy animations
—-
—
Few problems:
- I wrote the code back in 2008 for wi-tribe while i was in Jordan, it took me a week to figure it out, during the project i was asked to drop it ( dont ask why ) so i consider this as a partially completed project.
- functions names & comments might not mean anything to you ( hehe ) my bad i always comment for me.
- few files were required which i cant remember, I have a bunch of files setting around together so i have selected what i remember, compressed them & uploaded em to the server, you can find a live example here on my experiments page along with the files in the directory ( let me know if you require any of what might look like a missing file )
What do you require :
- I have used zeh’s MC Tween for the animation part ( not included )
- PHP PEAR packages for Ping & Latency ( not included )
- Other ( PHP files, images, character generation code etc ) included in the compressed file
Programming logic in steps:
- Flash sends a ping request to randomizer.php which will get latency & IP address then it sends it back to flash ( requires pear package )
- Flash sends a “make new file” request to randomizer.php which will copy an image that exists on the server ( adds new name to prevent caching ) & it returns image name back to flash
- Flash then starts downloading the image ( extra formula involved in rotation and converting elapsed time & bytes loaded etc etc etc… see code below )
- Upon downloading i push speeds in an array to sort them later on and select a middle range as download speed
- Flash Sends a delete image request and Starts the upload testing process
- Upload speed is usually slow, an initial test is made to determine initial upload speed
- Once done a character generator function requests to build up a set of characters to be uploaded to the server ( randomizer.php )
thats pretty much it.
Like i said, im only posting this for you to learn and grab functions from … dont forget to say thank you







What PEAR packages should be installed to work?
I am trying in this direction and do not get it to work …
http://www.adsltodo.com/velocidad/gauge.php
Im not sure what kind of error you are getting, you should try to test it from your flash IDE to see what kind of error you are getting.
I think it was ping pear package http://pear.php.net/package/Net_Ping/redirected
ok .. thanks, I’ll try it
Another query,,, really, I have the code of another speed test a while ago I performed a freelance designer, but is now outdated and does not work,,, you do me the favor of looking at the code and update it, then you pra stay your web code and put it in your tutorials,,, the advantage is you do not need external libraries or PEAR to work …
thanks
AT THIS ADDRESS
http://www.adsltodo.com/herramientas/speedtest_/
flash error with respect to gauge, this is the error I get:
100
undefined
_xscale
_yscale
_xscale
_yscale
_alpha
IMAGENAME = undefined
Error al abrir la URL ‘http://www.adsltodo.com/velocidad/prueba/temp/undefined’
error triggered & error = _level0.holder
14
14
14
14
14
14
failed
14
14
14
14
14
14
14
14
Now i wish i have the time to do coding like i used to matey.
Looking at the error it seems that its not find the image to download from server, it seems that flash is not getting the image name back from the PHP script.
you need to look into the variables passed from flash to php ( back & forth ).
let me know how you progress .
I’ll try to convert all to AS3 code + classes and post it down here, but that wont be anytime soon.
Moe
ok. thanks ….
I’ve gotten it to work more or less, but the needles go haywire, and returns the local ip and not the public wan
http://www.adsltodo.com/speedtest/speedtest.html
two thumbs up Antonio, I’am impressed.
Now im not sure why its returning the local IP, i have a very old tutorial on my blog on getting the wan IP @ http://www.zainals.com/blog/bahrain/flash-php-get-ip/
try it up this is the final preview http://www.zainals.com/xperments/ipfla/ip.swf
let me know how you progress Antonio.
I appreciate if you could share the final product you are working on once you are done
Moe
that part of the code should be modified to count the speed test instead of,,, 540kb, 1.2 mb 1.8 mb 2.5 mb and 3.1 mb
of this otherwise
1024kb, 10mb, 20mb 30mb, 50mb, 100mb
OOH i remember that…I remember when you were working on it…was really a good work by you… cheers mate….
Thats the same one Saad
the old good days!
i m getting this kind of error. Plz help me..
Error opening include file mc_tween2.as: File not found.
Thanks
and bye
hi,
how can i download sample files.
Hi,
I am unable to download the source file. Can you please re-up or email them to me.
Thanks
I have found the file and re uploaded it @ http://www.zainals.com/wp-content/uploads/2010/12/Speed-Test.zip