# Cannot convert flash.display::Loader@2035d101 to flash.display.MovieClip

**URL:** https://forum.kirupa.com/t/cannot-convert-flash-display-loader-2035d101-to-flash-display-movieclip/284585
**Category:** Uncategorized
**Created:** [March 20, 2009, 2:40pm UTC](https://forum.kirupa.com/t/cannot-convert-flash-display-loader-2035d101-to-flash-display-movieclip/284585 "2009-03-20T14:40:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)
#### Post date: [March 20, 2009, 2:40pm UTC](https://forum.kirupa.com/t/cannot-convert-flash-display-loader-2035d101-to-flash-display-movieclip/284585/1 "2009-03-20T14:40:17Z")

</div>

i have a Tweener question…

here is the lib…

so here is the error i get:

* * *

_**## [Tweener] Error: [object Loader] raised an error while executing the 'onComplete’handler.  
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@2035d1c1 to flash.display.MovieClip.  
at Function/[http://adobe.com/AS3/2006/builtin::apply()](http://adobe.com/AS3/2006/builtin::apply())  
at caurina.transitions::Tweener$/updateTweenByIndex()  
at caurina.transitions::Tweener$/updateTweens()  
at caurina.transitions::Tweener$/onEnterFrame()**_

* * *

and here is why::proud:

* * *

```auto

 
 
import caurina.transitions.*;
//////////////////////////////////////////////////////////////////////////
var photoOriginX:Number = 60;
var photoOriginY:Number = 50;
var photoDestX:Number = photoOriginX + 250;
var speed:Number = .4;
var rotationRange:Number = 15;
var photoCount:Number;
var easeType:String = "easeoutquad";
var aMC:Array = new Array();
var aLDR:Array= new Array();
var POScounter:uint=1;
var TMPLink:String;
//////////////////////////////////////////////////////////////////////////
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest("StackGalleryXML.xml"));
///
///
function loadXML(e:Event):void {
 var xml=new XML(e.target.data);
 var xmlData:XMLDocument = new XMLDocument();
 xmlData.ignoreWhite=true;
 xmlData.parseXML(xml.toXMLString());
 photoCount=xmlData.firstChild.childNodes[0].firstChild;
 //trace(photoCount);
 
 for(var i=1; i<=photoCount; i++)
{
 aMC*=addChild(new photoframe() );
 aMC*.x=photoOriginX+40*Math.random();
 aMC*.y=photoOriginY+40*Math.random();
 
 aLDR* = new Loader();
 aLDR*.load(new URLRequest(xmlData.firstChild.childNodes*.childNodes[0].firstChild));
 aMC*.addChild(aLDR*);
 //trace(xmlData.firstChild.childNodes*.childNodes[0].firstChild);
 aMC*.addEventListener(MouseEvent.MOUSE_DOWN, photoSlideOut); 
 aMC*.rotation = Math.floor(Math.random()*(rotationRange*2))-rotationRange;
}
 
 
}
//////////////////////////////////////////////////////////////////////////
 

//////////////////////////////////////////////////////////////////////////
function photoSlideOut(e:Event):void
{
 if (POScounter<photoCount){POScounter++;}else{POScounter=1;};
 //trace(POScounter);
 e.target.parent.setChildIndex(e.target, e.target.parent.numChildren - 1);
 Tweener.addTween(e.target, {x: photoDestX, time: speed, transition: easeType, onComplete:photoSlideIn, onCompleteParams:[e.target]});
 Tweener.addTween(e.target, {rotation: Math.floor(Math.random()*(rotationRange*2))-rotationRange, time: speed*2, transition: easeType}); 
}
     
  
  
  
function photoSlideIn(p:MovieClip)
{
 p.parent.setChildIndex(p, 1);
 Tweener.addTween(p, {x: photoOriginX, time: speed, transition: easeType}); 
}
//////////////////////////////////////////////////////////////////////////

```

it worksfine when i use an MC with a picture in it from the actual Flash LIBRARY.

but when i insert a loader in the mc it gives me this error…

//////////////////////////////////////////////////

aMC\*=addChild(new photoframe() );  
aMC\*.x=photoOriginX+40_Math.random();  
aMC_.y=photoOriginY+40\*Math.random();

_aLDR = new Loader();_\*  
\*\*  
aLDR\*.load(new URLRequest(xmlData.firstChild.childNodes\*.childNodes[0].firstChild));  
\*\*  
_aMC.addChild(aLDR_);\*\*  
//trace(xmlData.firstChild.childNodes\*.childNodes[0].firstChild);  
aMC\*.addEventListener(MouseEvent.MOUSE\_DOWN, photoSlideOut);  
aMC\*.rotation = Math.floor(Math.random()_(rotationRange_2))-rotationRange;

/////////////////////////////////////////////////

i tryed to use just the loaders…not working…its just for mcs i think…

im kinda new to AS3…so im not fully understanding this…

so what im doing wrong? im sure its something with loaders… or the way i attach loaders to MCs…

im stuck.:hat:
