11First create a composition (barInsideComp) with dimensions 50px * 50px, create 2 solids in this layer with your desired colors for the bar. Make a diagonal mask on the top solid. it'll should look like this:
Next, create another composition for the outline of the loading bar.. let's say 500px * 50px.. (loadingBarComp)
Put the barInsideComp into the loadingBarComp and add the following effects on barInsideComp layer
Add CC Repetile effect. Set Expand Left & Expand Right values 225 for and choose Repeat from the Tiling drop down.
Add Motion Tile effect.
Animate Tile Center's first value (x) with the desired speed. You can put 2 key frames to this value and use loopOut("continue") or loopOut("cycle") expressions for continuous movement..
Now you got the moving parts of the loading bar, just put the comp into a more stylish comp and you're done..