variable in textfield

  • Hi, i try to do this but can't find the right way now... i'm probably stupid...


    Code
    <action name="taal_add">
    	
    	
    		set($pano3_add1, I LOVVVE KRPANO !!!);
    		
        </action>



    So i now put the get($ variable text ) in the textfield ..

    Any idea? where to put get($pano3_add1); to see the right text in the textfield?

    Thanx

    Tuur *thumbsup*

  • Hi Tuur,

    Code
    <data name="html_add"> 
    get($pano3_add1);
    </data>


    This should not work *wink* ... To change the values inside data node you have to access to the content...
    set(data[html_add].content,get($pano3_add1));

    Following your example, you could do:

    Code
    <action name="taal_add">
    set($pano3_add1, I LOVVVE KRPANO !!!);
    set(data[html_add].content,get($pano3_add1));
    set(hotspot[ab_1].html,data:html_add);
    </action>


    Doing this, you update your data content with the given value and you refresh your textfield, setting his html with the content of your data...

    SAlut.

  • mmm..

    i have :


    no succes...
    ...yes i also call the action(taal_add) in the onstart..


    ....help *confused* *cry*

    Tuur
    *thumbsup*

  • Forgive me if I lead you astray with this answer, I'm on my phone so I can't test this theory, but perhaps the onstart action is being called before the data element is loaded. Try putting the action call in the onloaded attribute of the plugin:

    Code
    <plugin name="ab_1">
    ...
    onloaded="taal_add();"
    ...
    </plugin>

    I'll try to look at this further when I get home in the unlikely event Michel doesn't beat me to it *wink*

    steve

  • Hi Pinsane,

    well that plugin is an hotspot... and i put it there, in the onloaded .. but that makes no difference..

    again the code as it is now.. later to cleanup..


    ..

    when i put this in the <data name ... html_add then i seee it..

    <p align="lefttop"><font face="Verdana" color="#FFFFFF" size="12" ><textformat leftmargin="" rightmargin="">
    <b>I love krpano</b>
    </textformat></font></p>


    .. *confused*

  • Yeah, sorry. It's hard to debug over the phone. Another possibility is that the empty data field is disappearing because it is empty. I've noticed this happening with actions, so maybe that applies to data elements also. Try putting some junk text in there. (If the junk text shows up in the texfield, perhaps you have a problem with the action.)

    Also, try putting

    Code
    set(update,view);

    as the last line of the taal_add action.
    Steve

    Edited once, last by pinsane (June 28, 2010 at 10:09 PM).

  • Hi Tuur,

    As Steve already said *thumbup* , try calling the action from the onloaded event:

    To make sure that the textfield.swf plugin is already loaded and ready *wink* ...
    SAlut.

  • ihave that and also did this

    <data name="html_add">

    testtesttettetetterdetet..

    </data>

    no succes but i see.. testtesttettetetterdetet..
    so you should think it doesn't find that action taal_add


    ...

    Cheers..

    Tuur *thumbsup*

  • Yessss got it... *g*


    i cleaned up the total xml ...found an lost />

    and did as Steve said again.. perfect.

    i also did...

    <data name="html_add">

    <p></p>

    </data>


    and i did also..

    <hotspot name="ab_1"

    ....

    html=""

    ....
    />


    Thanks A lot to you all!!!

    Tuur *thumbsup*

  • so now i try to make also the css work like this but ....no...


    set(hotspot[ab_1].css,data:css2);

    in the taal_add action, before the update view...

    ..

  • OK. I'm at a computer now. And I'm embarrassed to say that you can disregard everything I've said in this thread.

    Your example code from this post works when taal_add() is called from the onstart event without modification.

    So if you look at my phone-based guesses:

    1. you need to call from the onloaded event rather than the onstart event WRONG!!!
    2. an empty data field might be disappearing WRONG!!!
    3. you need to update the view WRONG!!!

    It was solely Michel's modification that made this work!

    steve

  • But when i take them out all it doesn't work..

    i try to do the same for the css..:

    and have


    *confused*

    still see small black text... and i changed all text colors in the whole tour to white.. *cry*

  • The css you've got in your example will change the colors of the anchors only.

    Here's a stand-alone example that shows it is working (without nay of my phone-bound suggested changes). I've added some tags to the html and added a body color change to the css:

  • mmm...

    this doesn't work:


    ... *confused*

    when i take you 'phone things out the text is gone..

    i need them to see the text.... the onloaded seems to be the one..

  • Hi Tuur,

    As Steve said, at least in local, calling the acion inside the onstart seems to be enough... But in local all is loaded quickly... perhaps on server the things could change...
    So, can you add the editor plugin to test?

  • Well when i see the two , i think , best coders on the forum take so much time...
    there must be something stupid or buggy..

    I'm shure we'll meet in the bar.. *g*

  • Hi Tuur,

    Just tried to call the action inside onstart event instead of from the hotspot onloaded event and it works...
    I suppose that some where in your code the onstart that call the action it is erased with another one....

    SAlut.

Participate now!

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