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

Error in color code .. HTML5 Canvas

Explorer ,
Apr 21, 2019 Apr 21, 2019

2.jpg

1.jpg

this.stop();
function color1() {
var myColor: ColorTransform = new ColorTransform;
this.brush.mainbrush.transform.colorTransform = myColor;
this.myColor.color = "#000000";
}
this.brush.addEventListener("click", brushmc.bind(this));
function brushmc() {
this.brush.startDrag(true, new Rectangle(W: 550, H: 400));
}
this.Green.addEventListener("click", Greencolor.bind(this));
function Greencolor() {

this.brush.main.transform.colorTransform = myColor;
this.myColor.color = "#006600";
}
this.Yellow.addEventListener("click", Yellowcolor.bind(this));
function Yellowcolor() {

this.brush.main.transform.colorTransform = myColor;
this.myColor.color = "#FFFF00";
}
this.box.addEventListener("click", boxcolor.bind(this));
function boxcolor() {
if ((this.brush.main.transform.colorTransform = "#FFFF00")) {
  this.good.visible = true;
  this.good.play();
  this.box.transform.colorTransform = "#FFFF00";
} else {
  this.good.visible = false;
  this.wrong.alpha = 1;
  this.box.transform.colorTransform = "#FFFFFF";
}

https://drive.google.com/file/d/1jH-YszEE2yHEG7pAvJY6ZkZH4iImW9sA/view?usp=sharing

541
Translate
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 Expert ,
Apr 22, 2019 Apr 22, 2019
LATEST

Hi.

You are mixing AS3 and JavaScript.

Use color filters to change colors or access the shapes inside of your Movie Clips instances if you're not exporting your document as texture.

Color Filter reference:

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

Hypothetical way of changing a fill color of a shape inside of a Movie Clip if the document or the object is not being exported as a texture:

var root = this;

root.start = function(e)

{

    root.yourMovieClipName.children[0].graphics._fill.style = "#FF0000";

};

stage.on("drawstart", root.start, null, true);

Regards,

JC

Translate
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