# TypeError: Error #1034: Type Coercion failed: cannot convert \[\]@15238eb1 to flash.dis

**URL:** <https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185>\
**Category:** flash\
**Created:** [July 5, 2008, 3:26pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185 "2008-07-05T15:26:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonicsight](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sonicsight](https://forum.kirupa.com/u/sonicsight)\
**Post date:** [July 5, 2008, 3:26pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/1 "2008-07-05T15:26:23Z")

</div>

Ok so iv been trying to make a bar that holds links using XML. my code reads in the XML and then adds a movie clip to the stage that has the title of the link and goes to the link on clicked but whenever i export it i get this error: TypeError: Error #1034: Type Coercion failed: cannot convert []@15238eb1 to flash.display.DisplayObject. here is my code:

```auto
var loaderLink:URLLoader = new URLLoader();
loaderLink.addEventListener(Event.COMPLETE, xmlLinkLoaded);
loaderLink.load(new URLRequest("link.xml"));

var xmlLink:XML;
var linkArrayTitle:Array = new Array();
var linkArrayUrl:Array = new Array();
var holderArray:Array = new Array();

function xmlLinkLoaded(e:Event):void
{
    var linkSpacer:Number = 0;
    xmlLink = XML(e.target.data);
    for(var i:uint=0; i<xmlLink.links.length(); i++)
    {
        var linkHolds:linkHolder = new linkHolder;
        linkArrayTitle.push(xmlLink.links*.titles);
        linkArrayUrl.push(xmlLink.links*.urls);
        linkBar.linkHide.addChild(holderArray);
        holderArray*.addChild(linkHolds);
        holderArray*.addEventListener(MouseEvent.MOUSE_UP, gotoUrl)
        holderArray*.name = linkArrayUrl*;
        linkHolds.linkText.text = linkArrayTitle*;
        linkHolds.x = 0;
        linkHolds.y = linkSpacer;
        linkSpacer += 28;
    }
}

function gotoUrl (e:MouseEvent):void
{
    var url:String = e.currentTarget.name;
    var requester:URLRequest = new URLRequest(url);
    navigateToURL(requester, '_self')
}

```

now after playing around with commenting and uncomment iv narrowed the error down to these 3 lines of code:

```auto
linkBar.linkHide.addChild(holderArray);
holderArray*.addChild(linkHolds);
holderArray*.addEventListener(MouseEvent.MOUSE_UP, gotoUrl)
holderArray*.name = linkArrayUrl*;

```

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [July 5, 2008, 3:37pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/2 "2008-07-05T15:37:15Z")

</div>

linkBar.linkHide.addChild(holderArray);

You’re trying to add an array to the display list.

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [July 5, 2008, 3:38pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/3 "2008-07-05T15:38:06Z")

</div>

addChild() uses as parameter only DisplayObjects; You are adding a WHOLE holderArray:Array

---

<div class="post-metadata">

**Author:** ![sonicsight](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sonicsight](https://forum.kirupa.com/u/sonicsight)\
**Post date:** [July 5, 2008, 4:12pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/4 "2008-07-05T16:12:59Z")

</div>

so what would be the best way to fix this by adding it to a sprite and then adding the sprite to the bar?

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [July 5, 2008, 5:39pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/5 "2008-07-05T17:39:06Z")

</div>

what is the purpose of thet array, and whay are you adding it?  
I am not sure what effect u want to acheive

---

<div class="post-metadata">

**Author:** ![sonicsight](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@sonicsight](https://forum.kirupa.com/u/sonicsight)\
**Post date:** [July 5, 2008, 7:17pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/6 "2008-07-05T19:17:16Z")

</div>

the purpose of the array is so that i can add a different click event for each movie clip (i want each movie clip to link to a different webpage that is specified dynamically.

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [July 5, 2008, 7:43pm UTC](https://forum.kirupa.com/t/typeerror-error-1034-type-coercion-failed-cannot-convert-15238eb1-to-flash-dis/265185/7 "2008-07-05T19:43:30Z")

</div>

```auto
linkBar.linkHide.addChild(holderArray*);

```
