Posts mit dem Label CustomPreloader werden angezeigt. Alle Posts anzeigen
Posts mit dem Label CustomPreloader werden angezeigt. Alle Posts anzeigen

Donnerstag, 10. Januar 2008

Custom preloader final version

Code updated!




I finally find 10 minutes to try to put a progress information in the progress bar control.
The solution was to use a TextField objet write some stuff in it, use a BitmapObject to copy the TextField object into it and then draw the new created BitmapData object on the big one.
Here is the code to only draw the progress text:

var textField: TextField = new TextField();
textField.htmlText = m_Progress.toFixed(0) + "%";
var textBitmapData: BitmapData = new BitmapData(textField.textWidth + 5, textField.textHeight);
textBitmapData.floodFill(0, 0, ProgressBarBackground);
textBitmapData.draw(textField);
var textBitmapMatrix: Matrix = new Matrix();
textBitmapMatrix.translate(px + (containerWidth) / 2, py + (ProgressHeight - textBitmapData.height) / 2);



The full source code can be found here . (Right click somwhere and select "View code..." to see the source code)

As usual, if someone improve the code please post a comment.

UPDATE:

Thanks for the info there is something wrong with the "view source..." function.
I added an archive file with the source code. this can be found here
Sorry for this.

Mittwoch, 31. Oktober 2007

Preloader in Flex 3 beta 2

Since the new beta release of the flex framework, the preloader wasn't working anymore. It looks like the problem has been solved in one of the nightly build pre-release of the sdk.
For more information please follow the links

Nightly build web site download build number 184063.

Where the bug was reported and the adobe solution here

Full sample code here

Samstag, 6. Oktober 2007

Custom preloader

Like a lot of people I wanted to add my own preloader in my application. In my google searches I found a very helpfull post from Ted Patrick here. In some ways it was a very good explanation about how the whole thing works but something was missing... the progress bar!

Here is my custom preloader example. Hope this while help.







Some stuff need to be added. for example the percent progress label. If someone is quicker than I to implement it please post a link in the comments.

PS: Right click and select "View Source..." to see how the things are working together.


New Sample with progress percent here