Archive for the ‘Actionscript’ Category
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();
How to disable browser cache for flash
As you know when you upload new swf file to server, browser doesn’t show it until you delete browser cache. Also it’s important to delete swf cache for websites which includes dynamic data and dynamic sub swf files. Here’s the method that we pass this problem for flash.
How to delete xml cache with actionscript?
İt’s important to delete xml cache in flash if your content is renewing it self often. Here’s the sample code for deleting xml cache with actionscript;
Just change your xml loading code with this:



