Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


load a movieclip html5 canvas

Community Beginner ,
Dec 10, 2017 Dec 10, 2017

Copy link to clipboard

Copied

How to display a movieclip when button is clicked in animate cc (canvas html5).

I hope someone can help me. thanks.

Views

4.4K

Likes

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

Adobe Community Professional , Dec 11, 2017 Dec 11, 2017
Hi.Two ways of doing this is making the Movie Clip visible or adding from the library. It depends on what you want.Assuming that you have a Movie Clip on the stage called 'mc' that has its visible property unchecked in the Properties panel and it has a linkage name of "Rectangle" in the Library panel. And you also have two buttons called 'buttonVisble' and 'buttonAdd' on the stage, add this code to the main timeline:var that = this;this.buttonVisible.addEventListener("click", makeVisible);this.b...

Likes

Translate

Translate
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

Hi.

Two ways of doing this is making the Movie Clip visible or adding from the library. It depends on what you want.

Assuming that you have a Movie Clip on the stage called 'mc' that has its visible property unchecked in the Properties panel and it has a linkage name of "Rectangle" in the Library panel. And you also have two buttons called 'buttonVisble' and 'buttonAdd' on the stage, add this code to the main timeline:

var that = this;

this.buttonVisible.addEventListener("click", makeVisible);

this.buttonAdd.addEventListener("click", addFromLibrary);

function makeVisible(e)

{

    that.mc.visible = true;

}

function addFromLibrary(e)

{   

    that.addChild(new lib.Rectangle());

}

Working example: here.

Regards,

JC

Likes

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
New Here ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

LATEST

Hi,

Is there anyway to load dynamic symbol from library?

I created different linkage names for sybmols and would need to load one of them each time according to the button event I click. Then I need to scroll the dynamically loaded movieClip within certain area on the stage.

 

Thanks in advance

Likes

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
Community Beginner ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

ok! its work. thank you very much.

but, how to set an movieclip potition on stage if to fit as my wish?

thanks for your help.

how to set the movie clip layout in stage

Likes

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
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

This is great!

Like this:

var that = this;

this.buttonVisible.addEventListener("click", makeVisible);

this.buttonAdd.addEventListener("click", addFromLibrary);

function makeVisible(e)

{

    that.mc.x = 400;   

    that.mc.y = 100;   

    that.mc.visible = true;

}

function addFromLibrary(e)

{

    // store the object in a variable

    var rec = new lib.Rectangle();

    rec.x = 150;

    rec.y = 250;

    that.addChild(rec);

   

    // or add directly

    //that.addChild(new lib.Rectangle());

}

Please don't hesitate to ask if you have any further questions.

Regards,

JC

Likes

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
Community Beginner ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

one more problem, how to unload movie clip in different timeline?

sorry for my questions. I just learn to adobe animate (html5 canvas).

Thanks

god bless you

Likes

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
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

What do you mean in different timeline?

Likes

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
Community Beginner ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

how unload movie clip is not in current timeline?

Likes

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
Adobe Community Professional ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

Do you mean timelines of other symbols? Like a Movie Clip inside another Movie Clip, a button inside of another Movie Clip, and so on?

If it is, you can use dot notation and call the method removeChild.

Let's say in our example we add another Movie Clip inside 'mc' called 'childMc'. And we add a button called 'buttonRemoveChild' just to remove the 'childMc'. Our code will be:

var that = this;

this.buttonRemoveChild.addEventListener("click", removeChild);

function removeChild()

{

    that.mc.removeChild(that.mc.childMc);

}

Notice that the methods addChild and removeChild have to be called by the parent.

Likes

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
Community Beginner ,
Dec 11, 2017 Dec 11, 2017

Copy link to clipboard

Copied

can you give me a example project JoãoCésar​? thanks very much

Likes

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
Adobe Community Professional ,
Dec 12, 2017 Dec 12, 2017

Copy link to clipboard

Copied

Sure.

Here we go: show_add_movie_clips_html5.

Likes

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
Community Beginner ,
Dec 12, 2017 Dec 12, 2017

Copy link to clipboard

Copied

ok. thanks, but i cant open it. i use animate cc 2017. how can fix trouble?

Likes

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
Adobe Community Professional ,
Dec 12, 2017 Dec 12, 2017

Copy link to clipboard

Copied

Animate CC won't let me save an FLA to older versions.

What I can do is to save as a .xfl and you try to open and see if it works: show_add_movie_clips_html5_xfl.

Anyway, the best you can do is to open the Adobe Creative Cloud app and upgrade your Animate 2017 to the 2018 version and then your are going to be able to open the file, besides getting lot of bug fixes and some new cool features.

Regards,

JC

Likes

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
Community Beginner ,
Dec 12, 2017 Dec 12, 2017

Copy link to clipboard

Copied

hi, JoãoCésar​ now im use animate cc 2018. but your file  show_add_movie_clips_html5​ still can't open it. any solution for me?

thanks

Regards

Chanz

https://goo.gl/xbaU82

Likes

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
Adobe Community Professional ,
Dec 13, 2017 Dec 13, 2017

Copy link to clipboard

Copied

Hi again.

Are you trying to open the .zip file in Animate or the .fla inside the .zip file?

You have to first extract the .zip file and then run the .fla.

Likes

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
Community Beginner ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

Is there a way to load these movieclips on layers, i made different scripts on different layers but the last loaded movieclip is always in front of the other and i want to preserve the layers,

Likes

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