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

Is this the correct way to determine if using 'an' or 'fl' when developing tools in jsfl?

Explorer ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

I would like to support both 'an' and 'fl' (yes i know it's trivial, but if adobe decides to get rid of 'fl' then im set). Is this the correct code to use?

var ANIMATE_VERSION = ( fl.version.split(" ")[1].split(",")[0] >= 13 ) ? "CC" : "CS" ;
var AN = ( ANIMATE_VERSION == "CC" ) ? an : fl ;



TOPICS
ActionScript , Code , Exchange extensions

Views

826

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

LEGEND , Dec 04, 2019 Dec 04, 2019

Okay, first, this is pointless. The probability that Adobe will ever drop "fl" is basically zero. It costs nothing to keep around, and would break countless scripts if removed. There is literally no reason to drop it, and a massive reason to keep it.

 

That being said, IF there was any need for this (which there isn't), version checking is the wrong approach (your code wouldn't even work if fl didn't exist because it uses fl to access the version number). Always go with feature detection if you

...

Votes

Translate

Translate
Engaged ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

Hi,

Currently, we use "fl" everywhere in our code, but I was concerned about this issue in the future, too. I am curious - how you plan to switch between "fl" and "an" dynamically?

On your question - yes, I think so. In my opinion, "an" was introduced in AA2014, so the version number you shoud check about is 13.

 

Best regards!

 

 

- Vlad: UX and graphic design, Flash user since 1998
Member of Flanimate Power Tools team - extensions for character animation

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
Explorer ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

If you look at the code above, I use AN instead of fl or an

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
LEGEND ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

Okay, first, this is pointless. The probability that Adobe will ever drop "fl" is basically zero. It costs nothing to keep around, and would break countless scripts if removed. There is literally no reason to drop it, and a massive reason to keep it.

 

That being said, IF there was any need for this (which there isn't), version checking is the wrong approach (your code wouldn't even work if fl didn't exist because it uses fl to access the version number). Always go with feature detection if you can.

 

fl = typeof fl === "object" ? fl : an;

 

But seriously, don't actually use this.

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
Explorer ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

While you're probably right, I've seen companies make drastic changes like this. I would even argue that it's equally pointless to introduce 'an' in Animate, but there it is.

Thanks for your solution btw!

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
LEGEND ,
Dec 04, 2019 Dec 04, 2019

Copy link to clipboard

Copied

LATEST

They probably only added "an" because doing so was trivial. Just a "an = fl" somewhere in the code.

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