0

Sorry about the title gore. I'm currently getting back into Animate after leaving it when we could no longer use flash at work. So now I'm trying to figure out how to do things I would have done in AS, one instance of that is creating object scripts and then instantiating them with:

var myObjectInst:myObject = new myObject(params);

and then listening for events on that object. The object would be self contained and might be a preloader or a plane you could fly around etc.

All the examples I find with Animator and createJS have all the code in a frame and that just seems unwieldy.

So how do you guys create and use objects like this in createJS?

James Hill
  • 19
  • 4
  • This is more a JavaScript question than one for CreateJS. However all the classes in EaselJS work this way, so have a look at the source (like Graphics: https://createjs.com/docs/easeljs/files/easeljs_display_Graphics.js.html#l41). One recommendation is don't try to extend a Container in JavaScript like you would a MovieClip in ActionScript. – Lanny Nov 14 '19 at 01:54
  • Are you asking how to create and instantiate [Classes in JavaScript](https://www.google.com/search?q=javascript+class)? – VC.One Nov 15 '19 at 22:08

0 Answers0