Skip to main content
Participant
July 4, 2022
Question

Writing and working with javascript class that extends MovieClip

  • July 4, 2022
  • 2 replies
  • 333 views

Hi,

 

In the past, I wrote scripts in actionscript and created classes that extended MovieClip.
I want to do the same now with javascript, and publish html5 canvas project as POC.

 

Can anyone explain how to do so, or refer me to the right tutorial/guide?

 

Thanks, Shefyg

This topic has been closed for replies.

2 replies

Community Expert
July 7, 2022

Also, you can use your code snippets. 

 

kglad
Community Expert
Community Expert
July 7, 2022

@Nick Gioia , what are you doing?  this is your 2nd  response in the past few days that's off-topic.

Community Expert
July 7, 2022

I am making sure they know about code snippets. If they don’t know Javascript, code snippets will help. It's not off topic. It's helpful for those that don’t know javascript. Also they asked for a guide or tutorial. Code scippets is a guide. You should know this. Please don’t call me out again. Thank you. 

kglad
Community Expert
Community Expert
July 4, 2022

if you have a library mc with linkage id = OpenScreen_mc, you can use:

 

var os = new OpenScreen();
this.addChild(os);

 

 

function OpenScreen() {

var mc = new lib.OpenScreen_mc();

mc.newProperty = whatever;

mc.newMethod = function(){

do whatever

}

return mc;

}

 

i would recommend using separate js files that are "included" in your global script panel to keep things tidy.

Participant
July 5, 2022

Thanks a lot, will try it out

kglad
Community Expert
Community Expert
July 5, 2022

you're welcome.