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

Type Coercion failures with MovieClips in ASC 2.0

Explorer ,
May 21, 2013 May 21, 2013

Copy link to clipboard

Copied

Hi all, i am seeing this Type Coercion problem with SWCs containing MovieClip assets in 3.7 and 3.8 versions of ASC 2.0

here is the bug i filed: https://bugbase.adobe.com/index.cfm?event=bug&id=3562040

Adobe: would love to see a fix in the next beta update if possible so i dont have to go back to the flex compiler. I posted this accidentally in the Flex group, so sorry about hte cross post, want to be sure adobe sees it, my bug, and can issue a fix.

Basically, when i compile using ASC 2.0 and am calling assets from a SWC generated in Flash CS6, i get an intermittent type coercion error. What seems to trigger this is adding a child of a MovieClip in the SWC to the stage of a Sprite not in the SWC (generated programatically).

Exception fault: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@d7dd431 to assets.ui.GoButtonAsset.

          at flash.display::Sprite/constructChildren()

          at flash.display::Sprite()

          at flash.display::MovieClip()

TOPICS
Performance issues

Views

9.7K

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 ,
Feb 03, 2016 Feb 03, 2016

Copy link to clipboard

Copied

Streiffus wrote:

For those still suffering from this issue - our build engineer fixed the issue by switching to using 64 bit Java to compile AIR.

Previously, we were using 32 bit Java and were seeing more than half of our builds fail. Since the switch, we have not encountered a single 1034 error.

Streiffus Can you be more specific on how to switch to 64 bit java for compilation?

I've also found Adobe Flex 4.6 SDK Configuration page (scroll down to JVM configuration) on which it says:

These compilers are 32-bit executables and cannot launch 64-bit processes. As a result, they require a 32-bit version of Java to run.

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
Community Beginner ,
Feb 04, 2016 Feb 04, 2016

Copy link to clipboard

Copied

I'd have to ask our build engineer, since he was the one who set it up. I'll see if I can get him to post when he's not too busy.

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 ,
Feb 04, 2016 Feb 04, 2016

Copy link to clipboard

Copied

That'd be great, thanks! We've been having this issue for almost 2 years now and it's really hard to move all projects to use the technique described in #44.

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
Community Beginner ,
Dec 14, 2016 Dec 14, 2016

Copy link to clipboard

Copied

ArslanovArtem​ I use wrappers. I parse the library items by names, making them inherits movieclip directly, and I instantiate different wrapper depending on what I want to do.

Yeah. It's a pain.

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
Engaged ,
Nov 12, 2017 Nov 12, 2017

Copy link to clipboard

Copied

This still happens on iOS, when strict typing an instance defined on stage/timeline in an external swf.

Everything works perfectly on android and desktop though...

any new workaround?

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
Advocate ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

For us this was solved by switching from .swc assets to .swf assets on iOS. Maybe it helps.

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
Engaged ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

LATEST

thanks,

me too I use external SWF (even though swcs offer more advantages).

The issue I face is as follows (only on iOS):

- Same application domain

- Some classes are defined in both main swf and loaded swf

- In abstract code everything works fine

- When a class is linked to a DisplayObject in library, and that DisplayObject is instantiated visually inside the display list of a DisplayObjectContainer, I get an error.

ie.:

Inside MovieClip A, created visually in Animate, there is an instance of MovieClip B.

If in A Class, I reference b typing a variable:

var _myB:B = this["instanceOfB"];

I get the error: Cannot convert B@23232 to B.

The error also shows when typing vectors.

A bit tricky to describe, but this shouldn't happen as all lives in the same application context.

The only workaround is to use core classes, ie.:

var _myB:MovieClip = this["instanceOfB"];

Not too bad, but you lose IDE code completion and some OOP advantages.

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