Highlighted

Error in color code .. HTML5 Canvas

Explorer ,
Apr 21, 2019

Copy link to clipboard

Copied

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

TOPICS
Discussions

Views

302

Likes

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

Error in color code .. HTML5 Canvas

Explorer ,
Apr 21, 2019

Copy link to clipboard

Copied

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

TOPICS
Discussions

Views

303

Likes

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
Apr 21, 2019 0
Adobe Community Professional ,
Apr 22, 2019

Copy link to clipboard

Copied

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Apr 22, 2019 0