A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Loader Class | Smoothing Content

  1. #1
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187

    Angry Loader Class | Smoothing Content

    I have a loader class that loads a png. When that png is finished loading I start scaling the graphic back and forth. It will works fine except the graphic when scaling DOES NOT look smooth. I know how to make Bitmap objects smooth. But the Loader class instance's content property is not a bitmap. so I can't set it to smoothing = true. I need to get it smooth. Any help would be appreciated.

    Code:
    var loaderSamosa = new Loader();
    loaderSamosa.load( new URLRequest( "__assets/pulsing_samosa.png" ) );
    			
    loaderSamosa.contentLoaderInfo.addEventListener( Event.COMPLETE, showSamosa );
    addChild( loaderSamosa );
    
    private function showSamosa( e:Event ):void {
    	loaderSamosa.cacheAsBitmap = true;
    	loaderSamosa.content.cacheAsBitmap = true;
    	//THIS MAKE THE SAMOSA GRAPHIC GET SMALLER AND LARGER
    	SpecialAnimations.pulsate( loaderSamosa, .75, true );
    }
    JScarlip,
    That Was Nice!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    When you load a bitmap the content is a bitmap.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    strandedgenius.com
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    187

    resolved

    Hey thanks cancerinform I got this going

    Code:
    bitMapSamosa = Bitmap(__loaderSamosa.content);
    bitMapSamosa.smoothing = true;		
    addChild( bitMapSamosa );
    I also took away this line

    Code:
    addChild( loaderSamosa );
    And it works now. Cheers!
    JScarlip,
    That Was Nice!

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