all groups > flash actionscript > july 2006 >
You're in the

flash actionscript

group:

Broadband Actionsript


Broadband Actionsript immi immi
7/30/2006 10:15:45 PM
flash actionscript:
Hi there,

I'm a flash novice and not good at coding. I was wondering if someone could
give me some code that would allow me to send the site visitor to another page
if they didn't have a broadband connection of 256K or above.

Thanks
Re: Broadband Actionsript kglad
7/31/2006 4:32:04 AM
try:



tl=this;
function checkConnectionF(kbytes,alternateURL){
clearInterval(connectionI);
connectionI=setInterval(connectionF,100,kbytes,alternateURL);
}
function connectionF(kb,url){
lb=tl.getBytesLoaded();
if(tl.getBytesLoaded()>0){
clearInterval(connectionI);
if(!startTime){
startTime=getTimer();
startBytes=lb;
connectionI=setInterval(connectionF,2000,kbytes,alternateURL); // checks dl
over approx 2 second interval
} else {
clearInterval(connectionI);
dlSpeed=(bl-startBytes)/(getTimer()-startTime);
if(dlSpeed*1000/1024<256){
getURL(url);
}
}
Re: Broadband Actionsript immi immi
8/1/2006 6:31:23 PM
hi kglad,

thanks for that, will give it a try and let you know.

1. Is it a case of simply cutting and pasting it into the first frame of the
timeline ?

2. Do I need to attach a jpeg

Thanks once again




Re: Broadband Actionsript immi immi
8/2/2006 1:27:04 AM
Dear Kglad,

I tried cutting and pasting into the first page, but unfortunately it didn't work - any tips

Re: Broadband Actionsript kglad
8/2/2006 1:37:46 AM
did you call the checkConnectionF() function and pass the appropriate
parameters?



tl=this;
function checkConnectionF(kbytes,alternateURL){
clearInterval(connectionI);
connectionI=setInterval(connectionF,100,kbytes,alternateURL);
}
function connectionF(kb,url){
lb=tl.getBytesLoaded();
if(lb>0){
clearInterval(connectionI);
if(!startTime){
startTime=getTimer();
startBytes=lb;
connectionI=setInterval(connectionF,2000,kbytes,alternateURL); // checks dl
over approx 2 second interval
} else {
clearInterval(connectionI);
dlSpeed=(bl-startBytes)/(getTimer()-startTime);
if(dlSpeed*1000/1024<kb){
getURL(url);
}
}

checkConnectionF(256,"http://www.macromedia.com");
AddThis Social Bookmark Button