Why is my button not showing?

  • Dumb question; but I'm stuck.
    I'm trying to add a simple "home" button to a vtour generated by krpano 1.17. In tour.xml I have put

    <layer name="HomeButn" url="skin/HomeButn.png" keep="true"
    scale="0.5" align="center" x="0" y="0" visible="true"
    onclick="skin_hidetooltips(); loadscene(get(scene[0].name)),null,MERGE,BLEND(1)); skin_updatescroll();"
    />
    But nothing is visible at screen center,and there is no error message. The .png is good, I can use it as a hotspot.
    Am I overlooking something needed to show the button? I can't identify anything like that by looking at vtour_skin.xml.

  • Hi! I've made a quick test and it seems that in 1.17pre it's impossible to have the same "name" attribute and file name in the "url".

    E.g. if layer is called "HomeButn" so the url can't be "HomeButn.png". Just rename "HomeButn.png" to something else.

    I tested your case in 1.19 and it works fine, so the problem relates to 1.17pre only.

    Regards,

    Alexey

  • Hi,

    can you show the full example?
    Based on the available information here it is not possible to say why it will not shown.

    I've made a quick test and it seems that in 1.17pre it's impossible to have the same "name" attribute and file name in the "url".

    Sorry, but that's impossible - there is absolutely no relation between the element name and the content in the url path!

    Best regards,
    Klaus

  • Good thinking, Alexey. And the answer is, no, changing the layer name back did not make the button disappear. So you are correct, Klaus, it must have been a browser problem (but one not fixable by clearing cache, because I tried that).

    BTW you can see the final tour [here]. The house-looking thing at upper left is my home button.

  • What disturbs me most here is that I remember clearly that when I made a test the button won't appear when its name was "HomeButn" and its url was "HomeButn.png". That's why I answered to you, Tksharpless))) Then it went Okay. There's no cache because I used standalone Flashplayer.... *blink* *confused* *confused*

    Okay, I suppose it was just 31st December and some kind of a New Year mystery out here *wink* *tongue*

    Regards,

    Alexey

  • haha)) I've kept playing a bit trying to reproduce this mysterious thing and made the dumbest little test of all the time:

    Code
    <layer name="HomeButn.png" url="skin/HomeButn.png" keep="true"
    	scale="0.5" align="center" x="0" y="0" visible="true"
    	onclick="skin_hidetooltips(); loadscene(get(scene[0].name)),null,MERGE,BLEND(1)); skin_updatescroll();"
    	/>

    I know, I know, nobody will name a layer like this, but it DISAPPEARS! *tongue* So the name is somehow in touch with the url? *confused* or.....

    Regards,

    Alexey

  • Hi,

    the problem is the dot '.' in the name.
    Any name with a dot inside will fail, the url value doesn't matter.

    A dot is used in the krpano syntax as 'separation' between the name of the object and the name of an attribute of it.

    E.g. take the variable name 'plugin.count':

    • 'plugin' is the name of the object (of the plugin array in this case)
    • 'count' is the name of an attribute/member of that object (the number of elements in this array)


    That means in your case with 'HomeButn.png':

    • The viewer will first look for an object named 'HomeButn' and than for an attribute 'png'
    • both objects will be not found and therefore this fails


    I will check if that behavior can be avoided inside the viewer and it not to add at least an error for this case and extend also the documentation that dots are not allowed to be used in names.

    Best regards,
    Klaus

Participate now!

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