Ok, I found a solution. Note that this is being implemented for video. Anyway, here is the solution:
I have a variable called "connectStatus" (initialized with the value 1, allowing to try it for the first time) and this var is used to control the situation:
videoObject.onStatus = function(o:Object)
{
if ( o.level )
{
// Do absolutely nothing
}
else
{
_root.connectStatus = -1;
}
}
if(_root.connectStatus==1){
videoObject.play(desiredVideo);
}
This solution allows the application to access streaming videos but retain the request if the connection is refused.