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

Reacting to Animate events inside an extension

Community Beginner ,
Mar 08, 2021 Mar 08, 2021

Hi everyone,

 

I'm trying to find a way to react to events happening into Animate. My focus right now is being able, using an extension, to detecte when I enter in a symbol:

  • Using ctrl + E,
  • or by double-clicking it.

 

I'm using the JavaScript API. I have a minimal example script running, but I cant find anything related to Animate events listeners. Are events happening in Animate avaliable in some way to extensions developers, and is there a way to subscrive to them?

 

Please keep in mind that I am new to developing this kind of extension, so I might be missing something obvious.

 

Many thanks.

329
Translate
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 , Mar 09, 2021 Mar 09, 2021

Hi.

 

When you enter a symbol, the current timeline changes. So you can listen for the timelineChanged event. Like this:

var myFunction = function ()
{
    fl.trace("timeline changed");
}

var eventID = fl.addEventListener("timelineChanged", myFunction);

 

https://www.adobe.io/apis/creativecloud/animate/docs.html#!AdobeDocs/developers-animatesdk-docs/master/flash_object_(fl)/fl1.md

 

I hope this helps.

 

Regards,

JC

Translate
Community Expert ,
Mar 08, 2021 Mar 08, 2021

there are some event listeners but i'm not aware of one that would detect when you enter edit mode.

Translate
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 ,
Mar 09, 2021 Mar 09, 2021

Hi,

 

Ok. I will look at the event system in further details.

 

Could you point me to those something linked to the event listeners, like a specific part of the documentation or a code snippet? The JSAPI doc is not really user friendly for newcomers.

Translate
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 Expert ,
Mar 09, 2021 Mar 09, 2021

Hi.

 

When you enter a symbol, the current timeline changes. So you can listen for the timelineChanged event. Like this:

var myFunction = function ()
{
    fl.trace("timeline changed");
}

var eventID = fl.addEventListener("timelineChanged", myFunction);

 

https://www.adobe.io/apis/creativecloud/animate/docs.html#!AdobeDocs/developers-animatesdk-docs/mast...

 

I hope this helps.

 

Regards,

JC

Translate
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 Expert ,
Mar 09, 2021 Mar 09, 2021

Also, this documentation is older...

 

https://help.adobe.com/archive/pt_BR/flash/cs5/flash_cs5_extending.pdf

 

... but often times I find it more efficient to search for the APIs.

Translate
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 ,
Mar 09, 2021 Mar 09, 2021
LATEST

Hi JoãoCésar, this is very helpfull, I'm having a look at it. Thank you.

Translate
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