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

how to extend class from animate (canvas)

Explorer ,
Jan 28, 2017 Jan 28, 2017

Copy link to clipboard

Copied

I have a FLA file that export to canvas, I add a linkage movieClip that call OpenScreen_mc.

i try to extend the OpenScreen_mc

i try this code:

(function (window) {

  function OpenScreen() {

     // this.Container_constructor();

  }

  var p = createjs.extend(OpenScreen, lib.OpenScreen_mc);

  window.OpenScreen = createjs.promote(OpenScreen, "lib.OpenScreen_mc");

}(window));

and call to the "class" like this:

var  openScreen_mc = new OpenScreen()

stage.addChild(openScreen_mc);

but i don't see the OpenScreen on the stage.

i try to call the this.Container_constructor(); but i get overFlow.

How can i extend it?

Views

362

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

correct answers 1 Correct answer

Community Expert , Jan 29, 2017 Jan 29, 2017

i don't know if this is what you want, but it works to do:

function OpenScreen() {

    var mc =  new lib.OpenScreen_mc();

    mc.newProperty = whatever;

    mc.newMethod = function(){

        do whatever

    }

    return mc;

}

var os = new OpenScreen();

Votes

Translate

Translate
Community Expert ,
Jan 29, 2017 Jan 29, 2017

Copy link to clipboard

Copied

LATEST

i don't know if this is what you want, but it works to do:

function OpenScreen() {

    var mc =  new lib.OpenScreen_mc();

    mc.newProperty = whatever;

    mc.newMethod = function(){

        do whatever

    }

    return mc;

}

var os = new OpenScreen();

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