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
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); } }
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
Dear Kglad, I tried cutting and pasting into the first page, but unfortunately it didn't work - any tips
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");
Don't see what you're looking for? Try a search.
|