You can disable native bandwidth detection in the server and use bandwidth detection in a server-side script, such as a main.asc file, especially if you want to reuse existing code.
If you use edge servers, server-side native bandwidth detection is performed at the outermost edge server to reduce the load on the origin servers. However, if you have a network of edge and origin servers, server-side bandwidth detection determines the bandwidth from the origin server to the client, not from the edge server to the client. If latency exists between the origin server and the edge server, it might affect the bandwidth calculation.
To use server-side bandwidth detection, use the specialized main.asc file Adobe provides for bandwidth detection. You can find the main.asc file in the \ComponentsAS2\FLVPlayback folder in the Samples.zip file provided with Flash CS3, which you can download at www.adobe.com/go/learn_fl_samples. You might also need to make some changes in your ActionScript 3.0 client (see the BandwidthServer.as (ActionScript 3.0) sample).
Disable native bandwidth detection in the Application.xml file for your application:
<BandwidthDetection enabled="false">
Bandwidth detection is enabled by default.
Write the client event handler class
class Client {
public function onBWCheck(... rest):Number {
return 0;
}
public function onBWDone(... rest):void {
var p_bw:Number;
if (rest.length > 0)
p_bw = rest[0];
trace("bandwidth = " + p_bw);
}
}
Make sure onBWCheck() returns a value, and onBWDone() contains your application logic.