# Preloader of my own animation

**URL:** <https://forum.kirupa.com/t/preloader-of-my-own-animation/29640>\
**Category:** flash\
**Created:** [August 28, 2003, 11:37pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640 "2003-08-28T23:37:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amp1](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amp1](https://forum.kirupa.com/u/amp1)\
**Post date:** [August 28, 2003, 11:37pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/1 "2003-08-28T23:37:08Z")

</div>

How do I create a preloader with my own animation?

I’ve already created the animation, so can I get it to play in rythm with % loaded?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 10:16am UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/2 "2003-08-29T10:16:40Z")

</div>

PercentageLoaded=(getBytesLoaded_100)/getBytesTotal;  
frameToGo=Math.round((numberOfFrames_PercentageLoaded)/100);  
myAnimation.gotoAndStop(frameToGo);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 3:39pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/3 "2003-08-29T15:39:11Z")

</div>

And I customize FrameToGo and myAnimation?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 3:47pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/4 "2003-08-29T15:47:28Z")

</div>

What eki is saying is:

Your animation is say, 50 frames long.

To make it advance with the % loaded, divide bytes loaded by bytes total (as in any preloader), multiply that by the number of frames in your animation (in our case, 50), and round that number, since you can’t go to partial frames.

Then tell your animation to go to this frame number with ‘animation.gotoAndPlay(thatNumber)’.

Right eki? Don’t wanna step on anyones toes here.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 3:57pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/5 "2003-08-29T15:57:56Z")

</div>

Maybe this helps  
[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=32382](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=32382)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 4:02pm UTC](https://forum.kirupa.com/t/preloader-of-my-own-animation/29640/6 "2003-08-29T16:02:59Z")

</div>

I’m so stupid… tell me what I’m doing wrong? 🅰
