# Pie preloader

**URL:** <https://forum.kirupa.com/t/pie-preloader/176173>\
**Category:** Uncategorized\
**Created:** [January 21, 2006, 12:44am UTC](https://forum.kirupa.com/t/pie-preloader/176173 "2006-01-21T00:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirksmith](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dirksmith](https://forum.kirupa.com/u/dirksmith)\
**Post date:** [January 21, 2006, 12:44am UTC](https://forum.kirupa.com/t/pie-preloader/176173/1 "2006-01-21T00:44:14Z")

</div>

hi

I’m trying to implement a pie preloader using the actionscript below.

But although the preloader functionality is working - the script isn’t moving teh timeline to the 2nd frame and the content. I can’t see anywhere any the script that control this.

Grateful for any ideas

Thanx

Dirk

onClipEvent(load)  
{  
\_root.stop();  
dO = 3.6;  
r = 10;  
function addSlice(O)  
{  
x1 = r_Math.sin(O_Math.PI/180);  
x2 = r\*Math.sin((O+dO)_Math.PI/180);  
y1 = r_Math.cos((O)_Math.PI/180);  
y2 = r_Math.cos((O+dO)\*Math.PI/180);  
trace(x1 + “:” + y1);  
with(\_root.mask)  
{  
moveTo(0,0);  
beginFill(0x999999);  
lineTo(x1,y1);  
lineTo(x2,y2);  
endFill();  
}  
}  
\_root.createEmptyMovieClip(“mask”,0);  
this.setMask(\_root.mask);  
\_root.mask.\_yscale = -100;  
\_root.mask.\_x = this.\_x;  
\_root.mask.\_y = this.\_y;  
oldLoaded = 0;  
}  
onClipEvent(enterFrame)  
{  
loaded = Math.ceil(\_root.getBytesLoaded()/\_root.getBytesTotal()_100);  
for(i = oldLoaded; i \< loaded; i++)  
{  
addSlice(dO_i);  
}  
oldLoaded = loaded;  
}
