PDA

View Full Version : beginBitmapFill question


Suffrage
08-25-2009, 03:56 PM
Hey all,

I am very new to AS2 and everything had been making perfect sense until I hit this snag. Basically I want to use beginBitmapFill to target an existing button rather than having to create an empty movie clip as all the examples I have seen do. I used

on (press) {
var colorful = new Color("_root.main_btn");
colorful.setRGB(0xD2B48C);
}

to fill the button "main_btn" with a solid color when clicking on another button, but I need to be able to fill it with a pattern too. I think I just need to properly understand the parameters involved in beginBitmapFill (I guess I'm assuming this is the function I need to do). So, I called the bitmap image "digital_tile" and tried

mainSub_mc.digital_btn.onRelease = function () {
main_btn.beginBitmapFill(digital_tile,null,true,tr ue);
main_btn.endFill();
}

But I don't know what I need just before the endFill to actually target main_btn. Anyway, thanks in advance for any insight you could send my way.

Noct
08-26-2009, 04:12 AM
beginBitmapFill is a method of the Graphics class (Drawing API). As far as I know, you cannot apply it to a movieClip...

You could use the drawing api to create a dynamic vector shape inside your clip and then pass a bitmapFill through that graphic object...