# Working with flash assets and Flex compiler

**URL:** https://forum.kirupa.com/t/working-with-flash-assets-and-flex-compiler/299347
**Category:** flash
**Created:** [November 3, 2009, 5:11pm UTC](https://forum.kirupa.com/t/working-with-flash-assets-and-flex-compiler/299347 "2009-11-03T17:11:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tezzutezzu](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@tezzutezzu](https://forum.kirupa.com/u/tezzutezzu)
#### Post date: [November 3, 2009, 5:11pm UTC](https://forum.kirupa.com/t/working-with-flash-assets-and-flex-compiler/299347/1 "2009-11-03T17:11:21Z")

</div>

Hello Kirupians,

I am currently working on a project that is compiled using fsch (Flex Compiler Shell) and making use of assets inside an swf library.

I’m having problems when I try to reference an object that has been put inside another object with the Flash IDE (CS3) and given an instance name.

I keep on having a 1034 telling me that:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@7efaec1 to MyOwnClass  
at flash.display::Sprite/constructChildren()  
at flash.display::Sprite()

MyOwnClass extends an AbstractClass. If I define in AbstractClass a public variable with the same name of the object instance on stage, the error won’t be thrown.  
Instead if I declare it in MyOwnClass it will throw the error above.

Both MyOwnClass and the referenced object are declared in this way:

```auto

[Embed(source="/assets/sharedassets.swf", symbol="MyOwnClass ")]    
public class MyOwnClass extends AbstractClass {
}

```

```auto

[Embed(source="/assets/sharedassets.swf", symbol="com.objects.MyObjectInsideMyOwnClass")]    
public class MyObjectInsideMyOwnClassextends AbstractClass {
}

```

The object is declared in MyOwnClass in this way

```auto

...
import com.objects.MyObjectInsideMyOwnClass;

[Embed(source="/assets/sharedassets.swf", symbol="MyOwnClass ")]    
public class MyOwnClass extends AbstractClass {

   public var myObj:MyObjectInsideMyOwnClass

   public function MyOwnClass ():void {
}
}
...

```

If I call myObj inside MyOwnClass it will throw the error above.

Any ideas? I am pulling all my remaining hair.
