Skip to main content
Participant
Jul 4, 2022 10:11 AM UTC
Question

Writing and working with javascript class that extends MovieClip

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 is closed to new replies. Start a new post to keep the conversation going.

10 replies

Community Expert
Jul 7, 2022 2:04 AM UTC

Also, you can use your code snippets. 

 

Translate
kglad
Community Expert
Community Expert
Jul 7, 2022 3:45 AM UTC

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

Translate
Community Expert
Jul 7, 2022 12:35 PM UTC

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. 

Translate
kglad
Community Expert
Community Expert
Jul 4, 2022 6:20 PM UTC

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.

Translate
Participant
Jul 5, 2022 6:17 AM UTC

Thanks a lot, will try it out

Translate
kglad
Community Expert
Community Expert
Jul 5, 2022 3:44 PM UTC

you're welcome.

Translate