change text field data source

  • the below strategy does not work. I cannot find a way to change the text inside the textfield with an onclick event. No matter what I try it only shows whatever the actual plugin loads with. i want to be able to change the text inside the textfield to what data2 has. any ideas?

    <data name="data1"> text data 1 </data>
    <data name="data2"> text data 2 </data>

    <plugin name="text" url="plugins/textfield.swf"
    parent="textbox"
    zorder="36"
    align="lefttop" x="10" y="10"
    background="false" borderwidth="0"
    html="data:polarbear"
    css="p{color:#000000; font-family:Arial; font-size:20;}"
    autosize="center"
    mask="textmask"
    keep="true"
    onclick=""
    onhover="showtext(Scroll up/down with arrows)"
    />

    <action name="changedata">
    set(plugin[text].html,data:data2 );
    </action>

    <plugin name="newdata" alpha="1" zorder="20" keep="true" scale="1" onclick="action(changedata)" />

  • Hi VN2009,

    After some tries, the 2 method are correct....

    Code
    set(plugin[text].html,data:data2 );
    set(plugin[text].html, get(data[data2].content) );

    I have tried your code and for me it seems correct...
    So, I have a suggestion:
    It seems your code is based on the masked-radar-textfield-hotspot example from Klaus (examples that comes with the Krpano download)... In this example the text has a mask and it can be scrollable... Perhaps, when you make the call to action(changedata) , you have already scrolled the text and then the new text data is hidden by the mask?
    Also, I have noticed that, when the html of the textfield pluging is set internally instead of referring to an external data content, then the action(changedata) has no effect *huh* ... Perhaps Klaus would explain more here. *whistling*

    Following, a code to demonstrate the exposed above:


    The first plugin[text1] changes his content correctly (and the 2 methods to change the content are working too)
    The second plugin[text2] does not change.

    Salut.

Participate now!

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