js Simple Method to Determine if flash Load Completed

  • 2021-06-29 09:51:09
  • OfStack

An example of how js can simply tell if flash is loaded.Share it for your reference, as follows:


<script type="text/javascript">
  // Determine if the load was successful 
  function checkLoaded(flash){
    try{
      return Math.floor(flash.PercentLoaded()) == 100
    }catch(e){
      return false;
    }
  }
  var flash = 'flash object ';
  var intervalID = setInterval(function(){
    if(checkLoaded(flash)){
      clearInterval(intervalID);
      intervalID = null;
    }
  },60)
</script>

PS: PercentLoaded is not supported, but I tried to find that, chrome, IE, firefox can be used normally.A progress bar for flash loading can also be made based on the PercentLoaded method

More readers interested in JavaScript-related content can view this site's topics: JavaScript+flash Skills and Effects Complete, JavaScript Switching Special Effects and Skills Summary, JavaScript Find Algorithmic Skills Summary, JavaScript Animation Special Effects and Skills Summary, JavaScript Errors and Debugging Skills Summary, JavaScript Data Structure and Algorithmic Skills Summary,Summary of JavaScript Traversal Algorithms and Techniques and Summary of JavaScript Mathematical Operation Usage

I hope that the description in this paper will be helpful to everyone's JavaScript program design.


Related articles: