Web design and coding samples, free tools, tips and more..
Untitled Document

Posts Tagged ‘as2.0’

PostHeaderIcon Flash Actionscript Preloader

Here is a good & working  AS2.0 preloader sample.

Insert the code above  into frame 1, add new dynamic text on scene and name its var as “showpercent”, that’s all..

onEnterFrame=function(){

            var total:Number=_root.getBytesTotal();

            var loaded:Number=_root.getBytesLoaded();

            if(loaded==total){

                        delete  onEnterFrame

                        play();

            }else{

                        var percent:Number=Math.floor((loaded/total)*100);

                       showpercent.text=percent

            }

}

stop();

  • Share/Bookmark
Categories
open all | close all