The cotton candy effect of loading with ActionScript

loading-48x48 A very cool effect on movies,films and application caused by the aging of the actual reels.Copy below codes to the first frame,the dynamic progress status of loading will be displayed,when loading completly the application will be run automatically.

  1. stop ();
  2. _root . createTextField ( "myload_txt" , 1 , 0 , 0 , 0 , 0 );
  3. with ( _root . myload_txt ) { //set text
  4. background = true ; // background
  5. backgroundColor = 0x336699 ;
  6. textColor = 0xFFFFFF ;
  7. type = "dynamic"
  8. selectable = false ;
  9. autoSize = "center" ;
  10. _x = Stage.width/2;
  11. _y = Stage.height/2;
  12. }
  13. onEnterFrame = function () {
  14. var Loaded = _root . getBytesLoaded ();
  15. var Total = _root . getBytesTotal ();
  16. _root . myload_txt . text = Math . floor (( Loaded / Total )* 100 )+ "%" ;
  17. if ( Loaded == Total ) {
  18. onEnterFrame = null ;
  19. removeMovieClip ( _root . myload_txt );
  20. play ();
  21. }
  22. };
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter
RSS Enjoy this Post? Subscribe to Ntt.cc

RSS Feed   RSS Feed     Email Feed  Email Feed Follow us Follow us
You can leave a response, or trackback from your own site.

3 Responses to “The cotton candy effect of loading with ActionScript”

  1. Joff says:

    Great tip – I think I know the effect you’re on about but have you got an example?

  2. Hi, was just looking through your website and wanted to load the RSS feed, but it isn’t working in my webbrowser (I’m running Opera) any possible way to get around that?

Leave a Reply