You don't need code, trust me - it'll be better if you figure it out with a little help.
The idea is, every time you load an object, you add 1 to a variable. The variable starts at 0.
Then you draw a box on the screen - the box command takes four numbers - a top, left, bottom and right. You only want your box to grow to the right, so that's the only number you'll have to change.
Pseudocode-
Loading bar variable starts at 0
Draw a box - right= left+loading bar variable.
Load an object
Add one to the loading bar variable.
Draw the box again - it will be 1 pixel bigger!
Repeat that for all your items that you're loading (and maybe changing the number you add, depending how many objects you have) and you'll have a loading bar in no time.
Remember to sync after every time you draw the box - or it won't get shown!
Good luck.