Can i use "screentosphere(mouse.x,mouse.y,toh,tov)" inside as3?

  • i have this code:


    var spotname:String = "spot1";
    _krPano.call("addhotspot(" + spotname + ")");
    var spot:Object = _krPano.get("hotspot["+ spotname + "]");
    spot.url = _urlImage;
    /*_krPano.call("screentosphere(mouse.x,mouse.y,toh,tov);");*/
    //spot.ath = spot.h;
    //spot.atv = spot.v;
    spot.ath = 0;
    spot.atv = 32.2540;
    spot.zoom = true;

    how can i save the position of the hotspot with mouseX and mouseY position when i click please?

  • Just remember that with the screentosphere and spheretoscreen functions you cannot use values. It has to be variables.

    Ie:

    Code
    screentosphere(100,200,ms_ath,ms_atv);


    will default to

    Code
    screentosphere(0,0,ms_ath,ms_atv);


    but

    Code
    set(mouse_x, 100);
    set(mouse_y, 200);
    screentosphere(mouse_x,mouse_y,ms_ath,ms_atv);


    will return the correct ms_atv and ms_ath values

Participate now!

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