# Simple preloader. Starting at 100% and hence causing problems. Flash8 Pro & AS2

**URL:** <https://forum.kirupa.com/t/simple-preloader-starting-at-100-and-hence-causing-problems-flash8-pro-as2/331477>\
**Category:** Uncategorized\
**Created:** [August 9, 2013, 5:34am UTC](https://forum.kirupa.com/t/simple-preloader-starting-at-100-and-hence-causing-problems-flash8-pro-as2/331477 "2013-08-09T05:34:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![plainman007](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@plainman007](https://forum.kirupa.com/u/plainman007)\
**Post date:** [August 9, 2013, 5:34am UTC](https://forum.kirupa.com/t/simple-preloader-starting-at-100-and-hence-causing-problems-flash8-pro-as2/331477/1 "2013-08-09T05:34:40Z")

</div>

[COLOR=#000000][COLOR=#0000bb][FONT=Courier New][FONT=arial]

I created this simple preloader that loads an swf called  
Imagery.swf into a clip on the stage called HolderMc.  
But im unable to delete the on enterframe in the end and make the preloader  
invisible. Everything works. And i also found out the root cause. (For the first onEnterFrame loops its returning 100% as loaded and this is the main problem).  
But am dumbstruct as to why and how its happening.  
Can anyone help ?  
Thanks

[/FONT]AS2 code used :

stop[/FONT][/COLOR][FONT=Courier New]COLOR=#007700;  
[/COLOR][COLOR=#0000bb]trace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"------------------------"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);  
[/COLOR][COLOR=#0000bb]HolderMc[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_visible[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];  
[/FONT][/COLOR][FONT=Courier New][COLOR=#ff8000]//////////

//Preloader Block.  
[/COLOR][COLOR=#0000bb]HolderMc[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]loadMovie[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]“Imagery.swf”[/COLOR][COLOR=#007700],[/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);

[/COLOR][COLOR=#0000bb]this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]onEnterFrame[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]=function(){  
[/COLOR][COLOR=#0000bb]MyLoaded[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]HolderMc[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]getBytesLoaded[/COLOR][/FONT][FONT=Courier New]COLOR=#007700);  
[/COLOR][COLOR=#0000bb]MyTotal[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]HolderMc[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]getBytesTotal[/COLOR][/FONT][FONT=Courier New]COLOR=#007700);  
[/COLOR][COLOR=#0000bb]MyPercent[/COLOR][COLOR=#007700]=([/COLOR][COLOR=#0000bb]MyLoaded[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000bb]MyTotal[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);  
[/COLOR][COLOR=#0000bb]VL[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]Math[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]round[/COLOR]COLOR=#007700+[/COLOR][COLOR=#dd0000]"%"[/COLOR][COLOR=#007700]; [/COLOR][COLOR=#0000bb]trace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]VL[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);  
if ([/COLOR][COLOR=#0000bb]VL[/COLOR][COLOR=#007700]==[/COLOR][COLOR=#0000bb]99[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]){  
[/COLOR][COLOR=#0000bb]delete this[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]onEnterFrame[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];  
[/COLOR][COLOR=#0000bb]trace[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]“OEF DELETED”[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]);  
[/COLOR][COLOR=#0000bb]\_root[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]TextBoxMc[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]\_visible[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]0[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];  
};  
}; [/FONT]  
[/COLOR][/COLOR]
