HomeForumsPanoPress SupportKRPano Javascript & PanoPress

Tagged: ,

This topic contains 6 replies, has 3 voices, and was last updated by  ryan_jackson 3 years, 7 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1942

    jcohlmeyer
    Participant

    How to I talk to krpano with the .call() feature (from JavaScript) after using panopress to embed krpano?

    #1943

    jcohlmeyer
    Participant

    … to clarify I meen how do you use the JavaScript interface of krpano with panopress –

    http://krpano.com/docu/js/#top

     

    #1945

    Sam Rohn
    Keymaster

    i have not tried this myself, but you can get an embedded pano #ID by reviewing a page w an embedded pano’s source, panopress gives each embed a unique ID like “pp_7540” which you would call w the js interface as desired

    sam

    note – i edited the topic title for clarity

    Sam Rohn :: New York City
    360° Panoramic Photography :: www.samrohn.com
    Location Scout :: www.nylocations.com

    #2233

    ryan_jackson
    Participant

    Hi Sam,
    I’m trying to do this as well without success.

    I’m using the latest version of PanoPress 1.1 and when I embed a panorama in a page and then view the source for the page I can’t see what the unique pano ID# is.

    Here is part of the code I get when I view source on the WordPress page with the embed. (Note I replaced my IP with X’s)

    <!– PanoPress [1.1] –>
    <div class=”pp-embed” style=”position:relative;width:100%;height:100%;”>
    <div id=”pp_0″ style=”width:100%; height:100%”><p></p></div>
    <script type=”text/javascript”>panopress.embed({“id”:”pp_0″,”type”:”flash”,”version”:”9.0.28″,”viewer”:”krpano”,”width”:”100%”,”height”:”100%”,”title”:null,”alt”:null,”button”:false,”panobox”:false,”preview”:””,”file”:”http:\/\/X.X.X.X\/oilsands\/wp-content\/krpano\/krpano.swf”,”params”:{“flashvars”:{“xml”:”http:\/\/X.X.X.X\/oilsands\/wp-content\/krpano\/chapters\/fortmcmurray\/fortmcmurray.xml”},”wmode”:”auto”}})</script>
    <noscript><div class=”pp-error”>Error<br/>Javascript not activated</div></noscript>
    </div>
    <!– /PanoPress –>

    I tried using “pp_0” as my unique pano ID# but I get the same number for every panorama that I embed so I don’t think pp_0 is the unique ID.

    How do I find the unique ID so that I can use the JavaScript interface for KrPano?
    http://www.krpano.com/docu/js/#top ?

    Here is a very simple example of what I’m trying to do:

    A button up in the header:
    ———————————————-

    Move pano to the right

    ———————————————-
    A script in the footer:
    ———————————————-
    <script>

    function krpano()
    {
    return document.getElementById(“pp_0”);
    }

    function movepano()
    {
    krpano().call(“moveto(100.0,5,linear(10));”);

    }

    </script>
    ————————————————–

    As you can see I’ve entered “pp_0” as the panorama ID but this returns a null value.

    So how do I get the real unique panorama ID?
    Thank you!

    #2234

    Sam Rohn
    Keymaster

    hey ryan –

    best for @omer to answer this one, my above solution is actually not accurate…

    sam

    Sam Rohn :: New York City
    360° Panoramic Photography :: www.samrohn.com
    Location Scout :: www.nylocations.com

    #2235

    ryan_jackson
    Participant

    Thanks Sam!
    From what I figure from the code it seems like panopress generates a random ID# every time a page is requested. It is some random number between pp_1000 and pp_9999.

    I’m hoping I can somehow get what this id# is and then be able to call it.
    My goal is to be able to have buttons like (Menu, Fullscreen, Sound Volume, Map) in the header and footer of my WordPress theme and then have them talk to krpano.

    Also, Omar. Does this post help you? http://zehfernando.com/2011/getting-the-swfs-html-objectembed-id-from-within-the-flash-movie-itself/#comments

    Here is a VERY simple example of what I want to do:

    Put a Javascript function like this in the footer of my WordPress theme:

    <script>
    function krpano()
    {
    return document.getElementById("krpanoSWFObject");
    //"krpanoSWFObject" is the default. Panopress names this "pp_????"
    }

    function soundOff()
    {
    krpano().call("stopallsounds(true);");

    }
    </script>

    And then here is a simple HTML button that you could put in the header of the WordPress theme to call the function in the footer.


    Sound Off

    When I click on the button in the header it calls the function in the footer which calls krpano to turn off the sound.

    This all works when I put it in an HTML file and embed the HTML file with panopress but I want these buttons to be global for the whole wordpress site.

    Thank you!

    #2236

    ryan_jackson
    Participant

    Woops the code didn’t show right in the last post because of the “<a href”


    a href="#" align="right" onclick="soundOff();" style="border:2px solid white; text-decoration:none; padding:5px;margin:5px;">Sound Off

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.