Skip to main content
Participating Frequently
April 8, 2010
Question

TypeError: Error #1034: Type Coercion failed

  • April 8, 2010
  • 1 reply
  • 723 views

Hi,

I have a project where a 3D VR swf created and compiled in Flash Builder that is being loaded into a Gaia site. The Gaia site is being coded in Flash Builder but compiled in the Flash CS4 IDE. In order to use strong typing I have set up a Flash Builder Library project that holds a few interfaces and VOs to be passed between the Gaia site and the 3D VR Component. That library's swc is referenced in all the projects (Flash CS4 IDE and FB).

If I try to pass a typed object from the site to the 3D VR, I get a coercion failed error. The error only happens when the 3D component compiled in FB expects that custom VO object. If I set the function to expect a generic Object type, it works. I can access the values of my custom VO object manually.

The full error is

"TypeError: Error #1034: Type Coercion failed: cannot convert components.vr.vo::VRRoomDataVO@4640fec1 to components.vr.vo.VRRoomDataVO."

Is there a trick to share custom VOs between Flash IDE projects and Flash Builder projects?

Cheers,

Jerome.

This topic has been closed for replies.

1 reply

jerome2Author
Participating Frequently
April 21, 2010

Hi,

I had all but given up, when I came across an unrelated post on ApplicationDomain. It turned out to be the answer I was looking for! In Gaia the site node allows you to set the domain to "current". Now all loaders will load swfs using a single domain and typed object should resolve correctly accross multiple swf files! I had a VREvent that would through an error previously and now works like a charm! My custom VOs also pass from one swf to another correctly.

This setup should also reduce memory usage as only one class definition is used.

hth.

Jerome.