문제

Can I tint an image from library included in an htmlText in AS3 (using flash cs5)?

On the stage I'd use:

var cTint:Color = new Color();
cTint.setTint(0xff00ff, .25);
image.transform.colorTransform = cTint;

The htmlText code (cobj.img is a string with the library AS linkage name):

op.htmlText = "<img src='"+cobj.img+"' width='40' height='40' vspace='0' />";

And if not, is there a way to use an image from stage instead? So I can create an image, put it to stage and then in the htmlText.

도움이 되었습니까?

해결책

Create an instance from the image, tint it and add that in you text! Suppose your image is a MovieClip in the library.

var libraryImage:MovieClip = new LibraryImage();
var cTint:Color = new Color();
cTint.setTint(0xff00ff, .25);
libraryImage.transform.colorTransform = cTint;

op.htmlText = "<p> </p><img src='libraryImage' width='40' height='40' vspace='0' />";
//add empty string at the start and you dont need to concatenate the string.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top