A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ProgressEvent.PROGRESS issue... it only shows when it is 100%...

  1. #1
    Senior Member
    Join Date
    Sep 2006
    Posts
    248

    ProgressEvent.PROGRESS issue... it only shows when it is 100%...

    Hello everyone,
    I am having issues with ProgressEvent.PROGRESS...

    I read somewhere that it might be some kind of problem with windows 7, but not sure...
    http://www.uploadify.com/forum/#/dis...n-windows-7/p1

    So i came here for further help...
    It just doesnt work, there is not "progress" it only works when it is 100% done.

    Here is the code:
    Code:
    var assetLoader:URLLoader = new URLLoader();
                assetLoader.load (new URLRequest("http://www.whatever/file.txt"));
                assetLoader.addEventListener (ProgressEvent.PROGRESS, progressHandler);
    
    function progressHandler (event:Event):void
                {
                    var percentLoaded:Number = event.currentTarget.bytesLoaded/event.currentTarget.bytesTotal;
                    percentLoaded = Math.round(percentLoaded * 100);
                    trace("Loading: "+percentLoaded+"%");
                    txt.text = percentLoaded+" %";
                }
    The funny thing is that it actually shows on the trace, but when i put it on the web, no progress showing the percentage loaded.

    Kind regards,
    Cheers,
    Leo.

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    Try a bigger file. It's possible there is no "progress" to speak of.
    Also, you should be getting an error since your progressHandler is expecting an Event and assetLoader is broadcasting a ProgressEvent.

  3. #3
    Senior Member
    Join Date
    Sep 2006
    Posts
    248
    Yeap, makes sense since i am using a 156kb file.
    Thanks for the tip.
    Regards,
    Leo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center