chrisrauh
01-31-2008, 09:40 PM
I sent this email to Denis but it just ocurred to me that people on the forum might know the answer. Here it is:
I still have some issues:
1 - communication between hotspots
How can I communicate between the hotspots?
Is there a preferred way of doing that? Is there some way to share data through the pano object?
The way I was doing that was using a singleton in as2 on the hotspot movies. However, because I switched to as3 to do the xml parameter solution this does not work anymore because of the diff way the classloader works (each loaded hotspot has an instance of the singleton class). I need to access some shared variable on the loading class, the pano being the only one I know about.
Something like this:
hotspots = Object(loaderInfo,loader).hotspots;
sharedObject = hotspots,getPano().getSharedObject();
2 - how to access the instance loaded into a hotspot (and thus its members and fields)?
When I use this code to retrieve a hotspot:
hotspots = Object(loaderInfo,loader).hotspots;
hotspot = getSpot("someName");
I get a wrapper object (hotspotParams or something like that). That I can call its methods to retrieve values about the hotspots, as in:
radiance = hotspot.getParam("radiance");
Now, the clip that was loaded into a hotspot implements a certain class, let's say:
class Dog extends MovieClip {
public function bark():void { trace("bark"); };
}
How can I call the Dog.bark().method from another hotspot. Something like:
hotspots = Object(loaderInfo,loader).hotspots;
dogHotspot = getSpot("dog1");
var someDog : Dog = Dog(dogHotspot.getLoadedAsset());
someDog.bark();
Could you please shed some light on the above?
I still have some issues:
1 - communication between hotspots
How can I communicate between the hotspots?
Is there a preferred way of doing that? Is there some way to share data through the pano object?
The way I was doing that was using a singleton in as2 on the hotspot movies. However, because I switched to as3 to do the xml parameter solution this does not work anymore because of the diff way the classloader works (each loaded hotspot has an instance of the singleton class). I need to access some shared variable on the loading class, the pano being the only one I know about.
Something like this:
hotspots = Object(loaderInfo,loader).hotspots;
sharedObject = hotspots,getPano().getSharedObject();
2 - how to access the instance loaded into a hotspot (and thus its members and fields)?
When I use this code to retrieve a hotspot:
hotspots = Object(loaderInfo,loader).hotspots;
hotspot = getSpot("someName");
I get a wrapper object (hotspotParams or something like that). That I can call its methods to retrieve values about the hotspots, as in:
radiance = hotspot.getParam("radiance");
Now, the clip that was loaded into a hotspot implements a certain class, let's say:
class Dog extends MovieClip {
public function bark():void { trace("bark"); };
}
How can I call the Dog.bark().method from another hotspot. Something like:
hotspots = Object(loaderInfo,loader).hotspots;
dogHotspot = getSpot("dog1");
var someDog : Dog = Dog(dogHotspot.getLoadedAsset());
someDog.bark();
Could you please shed some light on the above?