Solved - Parent-Child attribute issues when the parent is textfield.swf

  • Hi all!

    Thank you very much in advance for the help!

    I've come across a bug (I think) when I set a textfield.swf as parent.

    Here is the example link.

    Click on any of the infospots, it will open a textfiled, with some text, a white background, blue border and rounded corners. That's all fine.

    I've added a plugin element (a red X) to close the infospot. That element has a parent attribute pointing to the textfield (which is a hotspot). As you can see the red X is distorted.
    This distortion doesn't happen when I use an image as a parent. It only happens when the the parent is textfield.swf

    Has anyone experienced something similar in the past?
    I've tried set scalechildren true and false but it doesn't have any effect and the distortion is still there.

    This is the xml file. To find the relevant part of the code search for
    Underneath you will see the hotspot 'infobox_text_%1' and the plugin 'close_btn'

    Cheers!

    UPDATE: I'm going to tag this post as solved because Klaus just released a new version (krpano 1.0.8.14) which allows to use textfields as parents *g*

  • ok, I'll not ask you why *smile*

    Thanks for the suggestion.
    Setting both 'close_btn' and 'infobox_text_%1' to a hotspot with a certain height solves the distortion problem.

    But the main reason of using the parent-child thing is to place the close btn at the top right of the textfield. In order to use what you suggested to solve my problem, I'd need to link 'close_btn' to a hotspot with the same height than the textfield, and this height changes...

    I can manage aligning the 'close_btn' horizontally, because the infobox always has the same width. But things go trickier when I try to align it vertically, as the textfileld height varies depending on its content.
    I tried

    Code
    get(hotspot[info_box_text_%1].height);

    but it returns nothing.

    I ran out of ideas... *huh*

  • That worked!
    You'are brilliant! See the result here

    This fix is also improved the virtual tour, because it makes the infobox opening on the left of the item, instead of on top of it. I didn't think about it.
    I had to do some extra work because I used the 'info_icon' as a parent, hence the textbox and the close_btn took all its attributes too (onhover showtext, onclick show_textbox...)
    It's not the first time I come across this issue, and it will not be the last one. I'd like this parent-children inherit thing would be optional. Maybe in the future, although I understand this is a problem with the Flash DisplayList and the HTML DOM.

    Never the less I get it working now. Thank you very much Sachagriffin!

    Cheers

Participate now!

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