AS3: Create sprites from loaded image
I don't know if the title is misleading as the image I'm loading is actually a sprite image consisting of a multi-state button. I want to load this image and split it into several display objects (sprites?) in AS3, to create a SimpleButton
with an over and down state.
Right now I'm just loading the image with Loader
and URLRequest
, and then creating a sprite from the loaded content.
Is this possible or is there any other way of doin开发者_如何学Gog this, without having to load two separate images?
Thanks in advance,
PierreThere is. You can use the mask function of the Sprite class. First you set the mask to normalstate button part of the image,, and on mouseover you set the mask to the other state and on mouse down you set the mask to the clickstate button part of the image
Please mark as answer if this helped.
精彩评论