You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, August 7th 2009, 5:10am

Calling function for multiple instances of a hotspot.

Hello,

I am building a .SWF for use as hotspot. I want these hotspots to be able to be reached by a plugin. Is there a way to register a function of the same name one multiple hotspots with different names?

I tried using this method:

(in .FLA file)

krpano.call("hotspot[name].function()));

However, it always executes the last hotspot that was registered (last in the file). Is there another way to do this, if the hotspots are generated by the same .SWF file?

2

Monday, August 10th 2009, 2:00pm

Hi,

Quoted

I am building a .SWF for use as hotspot. I want these hotspots to be
able to be reached by a plugin. Is there a way to register a function
of the same name one multiple hotspots with different names?
yes, the function can be registered/added on the hotspot/plugin context,

the plugin/hotspot swf needs to listen for the REGISTER event,
see here:
http://krpano.com/forum/wbb/index.php?page=Thread&postID=524
and also here:
http://krpano.com/forum/wbb/index.php?pa…ostID=75#post75

then it can "set/register" the "function" to the current hotspot/plugin,


to call all of this hotspots now in your "main" swf, you need to loop over all hotspots and
call each separately,
e.g.

Source code

1
2
3
4
5
6
7
var i:int;
var cnt:int = krpano.get("hotspot.count");
for (i=0; i<cnt; i++)
{
 var hotspot:Object = krpano.get("hotspot[" + i + "]");
 hotspot.function();
}


best regards,
Klaus

Similar threads