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

Jsfl: element.width and element.left have junk values

Explorer ,
Dec 14, 2016 Dec 14, 2016

After upgrading to Animate CC from Flash 2.0 and trying to run our re-exporter I noticed that a lot of the time the element.width and element.left sometimes have some bad values in them. Strangely element.height and element.top do not seem to contain such bad values.

Is there a work around for this or a patch?

I noticed there was thread from 2014 but it was marked answered but without a satisfactory outcome.

Thanks!

- alia

1.3K
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

Explorer , Dec 16, 2016 Dec 16, 2016

I have a work around! I noticed that if you click on a frame that section gets valid values. Such an odd way to do things!

So the workaround is to force the current frame / selection elements before you access their data!

            // Need to make sure we set the frame or the data is corrupt

            fl.getDocumentDOM().getTimeline().currentFrame = frame_idx;

            var frame = layer.frames[frame_idx]

            if (frame)

            {

                var elements = frame.elements

          

...
Translate
Community Expert ,
Dec 14, 2016 Dec 14, 2016

are those symbols or shapes?

with shapes, you'll get one element returned by the jsfl.

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
Explorer ,
Dec 15, 2016 Dec 15, 2016

Symbols

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 ,
Dec 15, 2016 Dec 15, 2016

i don't see a problem.

what are the minimum steps needed to display the problem?

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
Explorer ,
Dec 15, 2016 Dec 15, 2016

As in you can get element.width and element.left to not sometimes be broken? or you don't see that I could have a problem?

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
Explorer ,
Dec 15, 2016 Dec 15, 2016

I wish I could just upload the old and new flash files to show the difference

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 ,
Dec 15, 2016 Dec 15, 2016

i don't a problem:  width,height,left.top all work as expected for me except for shapes where i see as more than one individual shape, jsfl only sees one shape.  it reports accurate data about that one shape but it's unexpected (by me) that it would fail to see several shapes/elements.

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
Explorer ,
Dec 15, 2016 Dec 15, 2016

My problem has not been resolved. Why is this marked correct?

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 ,
Dec 15, 2016 Dec 15, 2016

it's not marked correct.

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
Explorer ,
Dec 15, 2016 Dec 15, 2016

It was, i figured out how to unmark it. Strange procedure that.

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 ,
Dec 15, 2016 Dec 15, 2016

again, what are the minimum steps needed to display the problem?

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
Explorer ,
Dec 16, 2016 Dec 16, 2016

So far this is the path (ill get the artists to make a brand new file in animate cc that isnt imported)

  1. build flash anim in old version of flash
  2. import into the latest version
  3. try to export (loop through timeline.layers and grab the frames and then each frame element)
  4. the element.left or element.width will often times have bad data (widths like 100000 or more)
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
Adobe Employee ,
Dec 16, 2016 Dec 16, 2016

Is your issue similar to the one reported here? Re: element bounds in JSFL script

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 ,
Dec 16, 2016 Dec 16, 2016

that's an issue?  the guy's trying to measure a tween that contains a bitmap?

i sure hope no one's working on that.

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
Adobe Employee ,
Dec 16, 2016 Dec 16, 2016

Hi kglad,

Am not an expert. From what I know, the team is investigating the issue. I will share your feedback with the team.

Thanks,

Preran

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
Explorer ,
Dec 16, 2016 Dec 16, 2016

kglad wrote:

that's an issue? the guy's trying to measure a tween that contains a bitmap?

i sure hope no one's working on that.

Why do you hope that?

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 ,
Dec 16, 2016 Dec 16, 2016

1. it makes no sense to check top or left of anything that's not on-stage.

2. it makes no sense to check anything like top,left,width or height of a tween.

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
Explorer ,
Dec 16, 2016 Dec 16, 2016

Strange, we use the element.left element.width for calculating the bounding box and until the upgrade it worked fine. So maybe in their case it doesn't make sense. I'm assuming that's what you are talking about since i cant see which message you are replying to, it does beg the question though, if the element is there why isn't it data filled in.

I'd propose that it makes sense when it previously worked however.

I can't seem to find any updated JSFL API documentation for Animate CC, any place I should be looking? Its probable that the API has changed significantly in the meantime too.

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 ,
Dec 16, 2016 Dec 16, 2016

most of the recent responses have been to preran.  i don't know if you see this, but if you do you can determine who's responding to whom:

Screenshot - 12_16_2016 , 12_10_58 PM.png

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
Explorer ,
Dec 16, 2016 Dec 16, 2016

Preran​ yup seems like same outcome

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
Adobe Employee ,
Dec 20, 2016 Dec 20, 2016
LATEST

Hi all,

I checked with the team. They tell me that this is a bug they are investigating for a fix in a future update. Stay tuned.

Sorry it took me so long.

Thanks,

Preran

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
Explorer ,
Dec 16, 2016 Dec 16, 2016

I have a work around! I noticed that if you click on a frame that section gets valid values. Such an odd way to do things!

So the workaround is to force the current frame / selection elements before you access their data!

            // Need to make sure we set the frame or the data is corrupt

            fl.getDocumentDOM().getTimeline().currentFrame = frame_idx;

            var frame = layer.frames[frame_idx]

            if (frame)

            {

                var elements = frame.elements

                var num_elem = frame.elements.length

               

                // Need to make sure we set the selection or the data is corrupt

                fl.getDocumentDOM().selection = elements;

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