is my philosophy correct - GET VARIABLE?

  • I m going to use scrollingtext window for each scene in mny tour with different text. With info for each scene.

    I prepared the scrolingtext.xml - according to Krpano example.

    I prepared text_content.xml with diferent Data names of html texts with names like textnumber4 , textnumber5, textnumber6 ... etc.

    In onstart of a scene I want to set variable "textnumber" with the DATA name - means textnumber = 'textnumber4' or 'textnumber5' etc
    ¨'
    Then I want to use this variable for scrollingtext.xml element: html="data:get(textnumber);" I expect, that in each scene is variable set to the name of Data name from XML file with all the texts.

    If Am I right, this should work but probably I have problem with html="data:get(textnumber);"

    Please help me with the syntax

    Thank you in advance

  • layer in one xml looks that:
    <layer name="text" url="%SWFPATH%/plugins/textfield.swf" handcursor="false" children="false" align="lefttop" x="10" y="10" onstart="trace('ukaz cislo text',textnumber);" width="660" autoheight="true" background="false" border="false" html="data:get(textnumber);" css="color:#000000; font-family:Arial; font-size:14;" />

    and the text is in another xml like that:
    <?xml version="1.0" encoding="utf-8"?>
    <krpano>
    <!-- html kod pro plugin-->
    <data name="textnumber4">
    <b>this is 4</b>
    <p>
    Ústřední síň představuje jeden z pietních prostorů určených původně k pohřbívání významných představitelů československých legií. Legionáři zde však nikdy
    pohřbeni nebyli. V období 30. let 20. století stálo uprostřed Ústřední síně deset sarkofágů z leštěného sliveneckého mramoru a šestnáct náhrobních desek z
    tmavého mramoru.

    </data>
    <data name="textnumber5">
    <p>
    <b>this is 5</b>

    <p>
    Tato dispozice byla změněna v 60. letech 20. století. Po zpopelnění ostatků Klementa Gottwalda byl jeden z červených sarkofágů přesunut do centrální
    pozice. Do dalších dvou sarkofágů byly posléze uloženy urny s ostatky československých prezidentů Antonína Zápotockého a Ludvíka Svobody. V současné době
    se v tomto prostoru nachází stálá expozice Křižovatky české a československé státnosti. V Ústřední síni se nacházejí čtyři reliéfy, které jsou vytesány do
    bloků mramoru zabudovaných do konstrukce budovy. Jejich autorem je Karel Pokorný. Reliéfy znázorňují témata Útok (útočícího francouzského legionáře,
    severovýchodní roh), Obrana (bránícího se ruského legionáře, jihovýchodní roh), Umírání (raněného italského legionáře, jihozápadní roh) a Smrt (mrtvého
    srbského legionáře, severozápadní roh).
    </p>
    </data>
    <data name="textnumber6">
    <p>
    <b>this is 6</b>
    </p>

  • txtadd(layer[your_text_layer].html, 'data:', get(textnumber));

    I suppose , this is action to the onstart of the layer which i changed that way:

    <layer name="text" url="%SWFPATH%/plugins/textfield.swf" handcursor="false" children="false" align="lefttop" x="10" y="10" onstart="txtadd(layer[text].html, 'data:', get(textnumber));" width="660" autoheight="true" background="false" border="false" css="color:#000000; font-family:Arial; font-size:14;" />


    But no luck. I see only the textfield but without a text *sad*

  • I didn't even read your problem, I just shortened Alexy's syntax. But ok:

    1. First of all, you haven't written what is variable textnumber in get(textnumber): is it a number (4,5,6) or is it string (textnumber4, textnumber5, textnumber6...)

    2. I"m not sure if syntax:

    Code
    txtadd(layer[your_text_layer].html, 'data:', get(textnumber));

    should work. Instead of this I usually use:

    Code
    set(layer[your_text_layer].html, get(data[get(textnumber)].content));

    (if textnumber is a string eg. textnumber5) and you have to use variable. Or you can write just:

    Code
    set(layer[your_text_layer].html, get(data[textnumber5].content));
  • Hi Lešek,

    A have three xmls - tour.xml, srollingtext.xml and infotext_content.xml
    In tour.xml in each scene I set this - txtadd(layer[text].html,'data:textnumber4');
    In scrollingtext.xml is action wich draws the textfield window <layer name="text"> and html shoud be set in tour.xml before .
    In infotext_content.xml are separate data names( text blocks) like <data name="textnumber4">xxxx</data> <data name="textnumber5">dddddd</data>

    Now I finaly see the text but only once, if I change the scene, no text any more.
    In this example only the 4st, 5th and 6th scene.
    But if I refresh the whole tour, I can see another info but still not any other more. It really hurts .... *sad*

    http://www.virtualczech.cz/pamatnikvitkov/</a>

  • Hey, you are real panomaster.

    It works.

    Now I understand ( I hope so ) that I always must refresh the variable with get . This is "probably" writen in Klaus's documentation like.
    The problem was that I did NOT understand this facts in documentation.

    Note - when loading a other xml file, all data tags remain unchanged unless they are defined again in the other xml,
    then they will be overwritten by the new ones.

    and
    The texts that will be connected together. When using only one txt parameter
    then this text will be added to the content of current destination variable.

    Note - when the content of a variable should be used - then the get()
    action must be used to resolve the variable!


    Thanks a lot !! I owe you.
    marty

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!