PDA

View Full Version : embedPano.fla Implicit coercion


chiste
10-31-2007, 07:09 PM
Hi,

I'm trying to load my pano into another movie, and I'm using embedPano.fla as a reference, but I'm getting this error

[I]
1118: Implicit coercion of a value with static type flash.display:DisplayObject to a possibly unrelated type flash.display:MovieClip.

zaroundus
11-13-2007, 04:59 PM
I was having the same problem you were recently and was able to resolve it with the following code.

var panorama:MovieClip;
var loader:Loader = new Loader();
loader.load(new URLRequest("pano.swf"));
addChild(loader);

loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);

function loadComplete (e:Event) {
swapChildren(loader, pano1);
panorama = loader.content as MovieClip;
panorama.setArea(175,50,782,470);
panorama.loadPanorama("?panoName=panos/sbay_01_1&xml_file=pano.xml");

}

The "as MovieClip" addition on the line in red above solved this issue for me.

Good Luck!

nexus
11-15-2007, 03:09 PM
you are putting here:

swapChildren(loader, pano1);

and here is my output:

1120: Access of undefined property pano1.