Graphics Flex


    
        
            
    
                private var m:Matrix;
    
                private function loadImage():void {
                    var m:Matrix = new Matrix();
                    m.createGradientBox(450, 40);
                    img.addEventListener(ProgressEvent.PROGRESS, progress);
                    img.load("http://server.com/logo.jpg");
                }
    
                private function progress(event:Event):void{
                    grid.graphics.clear();
                    grid.graphics.beginGradientFill("linear", [0x0000ff, 0xffffff], [1, 1], [0x00, 0xff], m);
                    grid.graphics.drawRect(0, 0, (img.bytesLoaded / img.bytesTotal) * 300, 40);
                    grid.graphics.endFill();
                }