• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change color of a Movie Clip in an Animate Canvas document

New Here ,
Apr 08, 2020 Apr 08, 2020

Copy link to clipboard

Copied

Hello, I have situation - presently rebuilding the project from AS3 to HTML5 Canvas. I need some advise how can I change color of Movie Clip with code ?

Code in AS3:
komodamenu1_mc.spalv81_btn.addEventListener(MouseEvent.CLICK,komoda81);
function komoda81(event:MouseEvent):void {
var myColorTransform:ColorTransform = new ColorTransform()
myColorTransform.color = (0xdab396);//RAL 1001
komoda1_mc.transform.colorTransform=myColorTransform
}

The Live flash version: https://bilijardai.lt/sites/default/files/SWF%20failai/Pronto%20Ultra/Bill%20ULTRA%20konstr%202017_1...

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 08, 2020 Apr 08, 2020

Copy link to clipboard

Copied

https://www.createjs.com/docs/easeljs/classes/ColorFilter.html

 

Note that the HTML5 canvas element doesn't natively support filter effects, so they must be implemented pixel-by-pixel in JavaScript. This can be rather slow depending on the size of the image.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 08, 2020 Apr 08, 2020

Copy link to clipboard

Copied

if it's a shape you can easily change the shape color inside a movie clip using the code below

mc.shape.graphics._fill.style "#3399CC"  // with no stroke
mc.shape_1.graphics._fill.style "#3399CC" //with stroke
 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

LATEST

Hello, thank you for reply. I made the sample with shape and put your suggested code - it doesn't work.
Can you send me any working sample on An with code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 08, 2020 Apr 08, 2020

Copy link to clipboard

Copied

Filters just kill the performance in my CC Animate (HTML Canvas) project. I learend to stay away from them. If  I need a cool (static) filter effect, I just import an image with the content and the filter. (HTML Canvas) works well with bitmaps,but not programmatically adding filters

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines