Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Check if object is painted

I'm trying to create a coloring game for kids using animate cc. I used the following code:

var drawingCanvas;
var oldPt;
var oldMidPt;
var color;
var stroke = 50;
var index;
var that = this;
this.colorArray = ["#FF0000", "#009900", "#FFFF00", "#0000FF", "#000000", "#FF00FF"];

function init() {
   index = 0;
   createjs.Touch.enable(stage);
   drawingCanvas = new createjs.Shape();
   stage.addEventListener("stagemousedown", handleMouseDown);
   stage.addEventListener("stagemouseup", handleMouseUp);
   that.obj1.addChild(drawingCanvas);
   //that.obj1.update();
}

function handleMouseDown(event) {
   color = that.colorArray[(index++) % that.colorArray.length];
   oldPt = that.obj1.globalToLocal(stage.mouseX, stage.mouseY);
   oldMidPt = oldPt.clone();
   stage.addEventListener("stagemousemove", handleMouseMove);
}

function handleMouseMove(event) {
   var midPt = that.obj1.globalToLocal(stage.mouseX, stage.mouseY);
   drawingCanvas.graphics.setStrokeStyle(stroke, 'round',  'round').beginStroke(color).moveTo(midPt.x, midPt.y).curveTo(oldPt.x, oldPt.y, oldMidPt.x, 
  oldMidPt.y);
   oldPt.x = midPt.x;
   oldPt.y = midPt.y;
   oldMidPt.x = midPt.x;
   oldMidPt.y = midPt.y;
   //stage.update();
}

function handleMouseUp(event) {
   stage.removeEventListener("stagemousemove", handleMouseMove);
}
init();

There is a movieclip where color will be applied and another movie clip above that which is just outline of the object. My question is, is it possible to check if the object is fully colored? Or is there any way to get the shape's color?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!