AS3 Embed Image Instead of drawing graphics

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-03-25T17:32:32Z Indexed on 2010/04/01 16:33 UTC
Read the original article Hit count: 560

Filed under:
|

I've got a custom AS3 scrollbar that I need to modify. The scroll thumb (the draggable part of a scrollbar) is currently just done by drawing a rectangle. But I need it to look more like a real scrollbar. Not sure how to modify the below code to import/use a scroll thumb image:

  scrollThumb = new Sprite();
  scrollThumb.graphics.lineStyle();
  scrollThumb.graphics.beginFill(0x0066ff); 
  scrollThumb.graphics.drawRect(0, 0, 1, 1);
  addChild(scrollThumb);

I know that I would embed an image by doing something like this:

[Embed(source="images/image1.png")] private static var Image1Class:Class;

But then how do I set the scrollThumb = to the image?

Thanks!

© Stack Overflow or respective owner

Related posts about as3

Related posts about skinning