if (a == b) {
 nextScene ();
}
on the main timeline in the frame with all the variables. This just completes the preloader and sends you to the main movie when bytesloaded equals bytestotal. You can also add another dynamic textbox like I have to display the totalbytes value. Just put
_root.z
in the variable field.
I hope this tutorial has been helpful, not only on how to create a preloader but on how to use sin/cos functions and maths in Flash. Feel free to email me for help or comments or check out ALHan on his website.