lookto() callback an AS3 function?

  • Hi,

    Is it possible to have a lookto() callback fire an AS3 function with a loaded pano? How could achieve this?

    Looking for something like this:

    Code
    public function lookTo(ath:Number, atv:Number, callback:Function):void {
       _krpano.call("lookto("+ath+", "+atv+", 70, tween('easeOutQuad', 3), true, true, "+callback+")");
    }

    The above obviously won't work. Is there any way or will I have to go for a 3 secs interval in this case? (not preferred... inaccurate).
    Thanks a lot for feedback!

  • Hi,

    you can first assign your as3 function to a krpano variable and then call this variable when done:

    Code
    public function lookTo(ath:Number, atv:Number, callback:Function):void
    {
       _krpano.set("mylooktocallback", callback);
       _krpano.call("lookto("+ath+", "+atv+", 70, tween('easeOutQuad', 3), true, true, mylooktocallback() )");
    }

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!