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()
at caurina.transitions::Tweener$/updateTweenByIndex()
at caurina.transitions::Tweener$/updateTweens()
at caurina.transitions::Tweener$/onEnterFrame()
and here is why::proud:
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+40Math.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()(rotationRange2))-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: