PDA

View Full Version : I cantt make work, please help


Bernie
05-15-2007, 07:20 PM
Hi
This is my code and it is not working

Actionscript
var panorama:MovieClip;
var loader:Loader = new Loader();
loader.load(new URLRequest("files/pano.swf"));
addChild(loader);
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadComplete);
mc = new front2();
this.addChild(mc);
mc.y =185;
mc.x =-215;
function loadComplete(e:Event) {
panorama = loader.content;
panorama.setArea(0,0,500,400);
panorama.loadPanorama("pano.swf?xml_file=lobbie2.xml");
pano1_btn.addEventListener(MouseEvent.CLICK, doPano1);
pano2_btn.addEventListener(MouseEvent.CLICK, doPano2);
}
function doPano1(e:Event) {
if (panorama.pano.loadCompleted) {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?xml_file=lobbie2.xml");
}
}
function doPano2(e:Event) {
if (panorama.pano.loadCompleted) {
panorama.pano.remove();
panorama.loadPanorama("pano.swf?xml_file=aireluz.xml");
}
}

xml code

aireluzxml:
<?xml version = '1.0'?>
<panorama>
<parameters>keySensitivity = 50
sensitivity =50
zoomHome=1
panHome =-80
tiltHome =-40
zoomMin = 1
panoName = images/aireluz/aireluz
layer_2 = files/autorotator.swf
layer_3 = files/borders.swf
layer_5 = files/hotspots.swf
</parameters>
<borders>
tilt_min = -35
</borders>
<hotspots>
<global onLoad="alpha=0; alpha=1,1000" >
<spot id="aireluz" pan="-190,10000" tilt="60,5000" url="../images/add.png" linked="../images/aireluz/aireluz" onLoad="change:0,pan,-190,5000;change:0,tilt,60,5000;timer+=1,10000;chan ge:0,zoom,2,6000;"/>
</global>
</hotspots>
</panorama>

lobbie2.xml:
<?xml version = '1.0'?>
<panorama>
<parameters>
keySensitivity = 50
sensitivity =50
loaderBackColor=#edd5be
zoomHome=1
panHome =300
tiltHome =-10
zoomMin = 0
panoName = images/lobbie/lobbie
layer_3 = files/borders.swf
layer_5 = files/hotspots.swf
</parameters>
<borders>
tilt_min = -35
</borders>
<hotspots>
<global onLoad="alpha=0; alpha=1,1000" >
</global>
</hotspots>
</panorama>

Output window
Load 0: images/lobbie/lobbie_f.jpg
Load 1: images/lobbie/lobbie_r.jpg
Load 2: images/lobbie/lobbie_b.jpg
Load 3: images/lobbie/lobbie_l.jpg
Load 4: images/lobbie/lobbie_u.jpg
Load 5: images/lobbie/lobbie_d.jpg
Load layer 5: files/hotspots.swf
Load layer 3: files/borders.swf
Load 0: images/aireluz/aireluz_f.jpg
Load 1: images/aireluz/aireluz_r.jpg
Load 2: images/aireluz/aireluz_b.jpg
Load 3: images/aireluz/aireluz_l.jpg
Load 4: images/aireluz/aireluz_u.jpg
Load 5: images/aireluz/aireluz_d.jpg
Load layer 2: files/autorotator.swf
Layer 3 is busy
Layer 5 is busy
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/swapChildren()
at Hotspots/panoCreated()
at Timeline0_831a786023308c4ea146908d4b868e76/newPano()
at PanoController/PanoController::initPanorama()
at PanoController/PanoController::completeDatafile()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

I really new to actionscript 3. Thanks for the help

Denis
05-20-2007, 08:57 PM
Yes. Hotspots plugin can not be unload dynamically. You need to collect all hotspots inside the single XML. Another way is to remove panorama object completely and recreate it again.

bradleyjond
06-01-2007, 04:55 AM
I recently purchased the flash panorama player. Could you offer a little more help with the above question. I am trying to do this same thing. I am having trouble with dynamically unloading hotspots and borders.

Denis
06-01-2007, 11:03 AM
I can describe in three points:

1. You can't unload Hotspots plugin or change it's XML wholly (it's a problem so Hotspots plugin controls everything except simple mouse rotation, it's like OS for pano.swf :) ), but you can load/unload Hotspots' objects automatically using linked/unlinked parameters or with script using hotspot_name.url and hotspot_name.id (described in tutorials/hotspots.html).

2. You do not need to load/unload Borders or Autorotation. They take new parameters when you are loading a new XML (in contrast to Hotspots).

3. Now there is only one plugin you can load/unload completely any amount times: editor.swf. There are two special undocumented functions for Hotspots script (beta status): loadPlugin(url:String, depth:Number); and unloadPlugin(depth:Number); (you can call them in Actionscript in Hotspots script or in Javascript). I used this feature to load Editor at runtime using Javascript in browser's adress line.

fritsjan
02-08-2008, 06:47 AM
Dennis,

I was searching for this function (load/unload) the editor.swf in the panorama.
Can you post an example how to make this work (xml and javascript code).
Is there also a way (xml code) to tell the editor to startup minimalised or startup at the right top side?

I am looking forward to this answer, could not find it anywere else in the documentation/forum.

Thanks in advance,

Frits Jan