[solved] bug? js() - function ... not found

  • Hi,

    <events name="test"
    onxmlcomplete="js(krpanojsf.init())"
    />

    I get the message that the function is not found.

    when I put an alert/console/trace in the javascript function, it shows the message. Still the logs say it cant find the function. It seems to be cosmetic only since the function gets executed. I dont get this problem with for example js(alert('hi')); So I thought, perhaps because of the object function, so I created it directly in the global. Alsoo tried other names. ( init(), init, window.init(), window.init etc). My scripts are loaded in the head, whild swfkrpano is loaded in the body. So it isnt an not-loaded issue (alsoo I added a onclick event in krpano, and that didnt get triggered either).

    Update: Correction! Its not cosmetic. Ipad wont run any custom javascript function, safari in dev mode runs it though.

    Alsoo, another question. In a flash tour, I doubleclick to place a hotspot, at the spot where the user dclicked. In IOS there is obviously no mouse.x and mouse.y. I was wondering if there is a tap.x tap.y or something like that. Else I just have to put it on the current lookat. Any other ideas are welcome.

    Edited 3 times, last by Zephyr (December 23, 2011 at 9:43 AM).

  • Hi,

    okay, the - "function ... not found" message is not fully correct - this message will be shown too, when there is an error in the js-function - fix this error and the krpano error message will away too,

    about "mouse.x" and "mouse.y" - they are supported on iOS too!

    best regards,
    Klaus

  • Hi,

    Sorry you are right, it was late :P It was the same problem I ran in before but I forgot:

    Underscore uses _ in the global, so does krpano. I thought I had fixed that with doing window._krpano = window._ after tour.js in the head and passing _ as an parameter in an anomynous self executign function, but I alsoo forgot to remove the tour.jsfrom the body. I think the objects got mixed up on runtime. For some reason it never got picked up by 3 different javascript bugtrackers. When I removed the tour.js from the body I got an error from the tour.js in the head. Probally assigning _ to _krpano, gives troubles. So I removed that, renamed underscores _ to _u, pass that to my anomynous function and now things start to work again.

    About the mouse.x and mouse.y I have to check, I think It doesnt work because I still have some issues here and there.

    Anyways thanks!

    Btw what I ment with js() - function ... not found, is that i got it from every custom function I ran. I however did not get a specified errormessage, other then it wasn't found. Perhaps this is alsoo because I didnt get errors in my console log of my browser. Perhaps I should write fictures/tests with jasmin :P

  • Hi,

    Perhaps this is alsoo because I didnt get errors in my console log of my browser.

    there is a 'try-catch' around the js calling to avoid breaking the krpano scripts by a faulty or not available js code,
    and this catches also the js errors, so you don't see them in the browser log,

    I will change that in the next versions and show the right error message in this case,

    best regards,
    Klaus

  • Ok thanks :)

    Btw I tested the mouse.x and mouse.y. It works. But I have trouble with the screentosphere function within IOS. Is this action supported?

    Code
    var mousex = krpano.get("mouse.x");
            var mousey = krpano.get("mouse.y");	
    		
            var spherical_coordinates = krpano.get("screentosphere("+mousex+","+mousey+")"); //convert x/y in ath/atv
            var coordinates_array = spherical_coordinates.split(",");

    var mousex and mousey give correct numbers. But the spherical_coordinates has nothing in it :(

    Alsoo another tiny thing. I have a html element above krpano. In the flash version wmode="opaque" was enough to show this element. But it wont show on IOS. I tried giving the element a higher z-index. But still no show:

    I tried absolute and 9999 as z-index. Still nothing :( Alsoo tried the new wmode for ios.

Participate now!

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