KRPano object cannot find Javascript Interface function "set,get,call" ?

  • ็Hello there, I'm new here and to KRPano also. Have been researching it for a few weeks and there are a lot of things I have a problem with :(

    First of all, when I use the function "embedpano();" and set "html5" properties to "prefer". Everything works perfectly.


    But after I change "html5" properties from "prefer" to "auto", in order to make the Flash side works with changing cursors icon, KRPano object cannot find set(), get(), or call() as it was used to be? *confused*

    The problem is I want to change cursor icon into some images but when I set "html5" as "prefer" in embedpano(), it didn't work. But when I change from "prefer" to "auto", the cursor change into my image but they cannot call the following method anymore?


    Does anyone have a solution for this problem? Your help will be really appreciated here :(

  • No, that doesn't mean that!

    It means when running the Flashplayer with local content (file:// urls), the Flashplayer will restrict the usage of external interfaces (like the Javascript interface) for security reasons. When running the same content online (on http:// urls), there are no restrictions.

    A way to bypass this restrictions is to change either the Flashplayer security settings or to use a localhost server for local testing. Please see the links from the previous post for details.

    Best regards,
    Klaus

  • OK, I think, after review what you provided me, I understand what you said. However, I already try both method. But looks like it still cannot find Javascript Interface...

    Let me explain, at first before posting in this forum, I develop this application via Visual Studio 2010, so I assume that when it was run via localhost:xxxx, it just like open in URL server, but the problem occured.


    Next I follow the method how to set "Global Security Settings" for flash as in your first link, but still not working....


    Then, I try to use KRPano testing server as you provide how to. I think it is just the same as when I run it via Visual Studio. But it still doesn't work either. It still cannot find Javascript Interface....


    What I only do is put <cursors> in xml file to change the cursors icon, try calling KRPano.set( ); via javascript, and when using "embedPano();" to start KRPano viewer, I just set "html5" as "auto" because "prefer" cannot use the flash-only thing like "<cursor>" , What else do I miss or am incorrect here? *confused*


    Edit : To understand more easily what I'm facing here, I already prepared a sample to test. In embedPano() please change the properties of "html5" between "auto" and "prefer" to see the different

    https://www.mediafire.com/?6hx4umsck06nad5

    Einmal editiert, zuletzt von Woramin (24. April 2014 um 09:23)

  • But then, the problem in this sample is....

    - If I set "html5" in embedPano( ) to "prefer", the Javascript Interface will work fine, but the custom cursors of Flash doesn't work.
    - If I set "html5" in embedPano( ) to "auto" , the Javascript Interface won't work here, but the custom cursors of Flash works fine instead.


    Is there anyway that I can use Javascript Interface in the same time that I want to use some of the Flash-only compatibility like Custom Cursor?

  • Sorry for bothering you. Looks like it is my fault here, but I can make it works now *smile*

    I just tried using "onready" event as you suggested and Javascript interface is now functional. Now everything I want can be done.


    Thanks you for you great help here.

    By the way, this might be another question after I use onready event.


    I don't know why when I used get( ) function to get the data from tag <data> I included in the xml, it returned obj differently

    In embedPano( ), if I set HTML5 as "auto", I get something like this

    But if I set HTML5 as "prefer", it returned something like this instead??

    I, however, still can retrieve the data tag from this one, but I need to write additional lines of code to check how it returned object. Is there any reason behind this??

  • Hi,

    what you see there are some internal properties of these objects, these should not be used or changed in any way. They don't need to be the same in Flash and HTML5 and can also vary or change between different krpano versions.

    In the case of Flash, you don't get the real object from Flash - you get only a 'serialized' copy/rebuild of it.

    Just use only the properties/attributes from the xml reference:
    https://krpano.com/docu/xml/#top
    https://krpano.com/docu/xml/#data

    E.g. instead of getting the whole internal data object via - get("data[name]") - get only the data content via - get("data[name].content").

    Best regards,
    Klaus

  • Sorry for the late response because of my consecutive holidays

    For your suggestion to use "get("data[name]") " is really worked. Now I don't have to check whether how the object will have inside.


    Actually, I have a few more questions to ask you about KRPano but because of I have been moved to work in other projects now, so I will leave those questions to ask later.


    By the way, thank you very much for your help until this time *smile*

Jetzt mitmachen!

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