chrisrauh
01-29-2008, 07:15 AM
After posting the previous question, I realized that another thing I would like to do is access the attributes of a hotspot in the hotspot itself.
On the simple compass tutorial (http://flashpanoramas.com/forum/showthread.php?t=390&highlight=compass), jaaaab uses this call to get an specifically named hotspot:
// get link to deltarotation hotspot
deltaRotation = hotspots.getSpot('deltarotation');
and then this code to change the rotation of another specific and previously named hotspot:
// setting fov new rotation:
hotspots.execute("fov.rotation="+fovRotation);
The problem with this is that the names "deltarotation" and "fov" are statically declared on the config.xml and the loaded swfs need to know these names. This creates an unnecessary dependency.
This is particularly unnecessary since the "fov" swf is actually the one that contains the clip that is calling this code.
I would prefer that each swf had a way to access the hotspot that it's associated with, such as:
this.asHotspot().rotation = fovRotation;
Is this possible? What is the best practice to do something like this?
I've noticed that the PanoramaPlayer is targetted to end users and instead of implementing and exposing an API, it hides the functionality on the config xml file - which is not well documented btw. I would urge the developers to please expose the API so that developers can use the player like any other library.
Yours,
Christian
On the simple compass tutorial (http://flashpanoramas.com/forum/showthread.php?t=390&highlight=compass), jaaaab uses this call to get an specifically named hotspot:
// get link to deltarotation hotspot
deltaRotation = hotspots.getSpot('deltarotation');
and then this code to change the rotation of another specific and previously named hotspot:
// setting fov new rotation:
hotspots.execute("fov.rotation="+fovRotation);
The problem with this is that the names "deltarotation" and "fov" are statically declared on the config.xml and the loaded swfs need to know these names. This creates an unnecessary dependency.
This is particularly unnecessary since the "fov" swf is actually the one that contains the clip that is calling this code.
I would prefer that each swf had a way to access the hotspot that it's associated with, such as:
this.asHotspot().rotation = fovRotation;
Is this possible? What is the best practice to do something like this?
I've noticed that the PanoramaPlayer is targetted to end users and instead of implementing and exposing an API, it hides the functionality on the config xml file - which is not well documented btw. I would urge the developers to please expose the API so that developers can use the player like any other library.
Yours,
Christian