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?

  • Hi,

    Zitat

    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:
    https://krpano.com/forum/wbb/inde…read&postID=524
    and also here:
    https://krpano.com/forum/wbb/inde…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.

    Code
    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

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!