Sie sind nicht angemeldet.

1

Dienstag, 17. Dezember 2013, 02:00

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

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

2

Dienstag, 17. Dezember 2013, 08:38

Hi! Use txtadd to compose html data here. Something like this:

Quellcode

1
txtadd(text_data, 'data:','get(textnumber)');set(layer[your_text_layer].html, get(text_data));
Regards,

Alexey

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

3

Dienstag, 17. Dezember 2013, 09:36

Or shorter:

Quellcode

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

4

Dienstag, 17. Dezember 2013, 12:19

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>

5

Dienstag, 17. Dezember 2013, 12:54

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 :-(

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

6

Dienstag, 17. Dezember 2013, 16:55

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:

Quellcode

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


should work. Instead of this I usually use:

Quellcode

1
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:

Quellcode

1
set(layer[your_text_layer].html, get(data[textnumber5].content));

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »panomaster« (17. Dezember 2013, 17:39)


7

Dienstag, 17. Dezember 2013, 17:55

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 .... :-(

[url]http://www.virtualczech.cz/pamatnikvitkov/
[/url]

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

8

Dienstag, 17. Dezember 2013, 20:27

Try:

Quellcode

1
set(layer[text].html, get(data[textnumber4].content));


instead of:

Quellcode

1
txtadd(layer[text].html,'data:textnumber4');


etc. It should work.

9

Dienstag, 17. Dezember 2013, 20:51

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

panomaster

Fortgeschrittener

Beiträge: 297

Wohnort: Kobyłka, Poland

Beruf: Virtual Tours - Spherical Panoramas - Krpano developer

  • Nachricht senden

10

Dienstag, 17. Dezember 2013, 21:13

If you want to get a variable (in 'normal' situation), you have to use get() (it seems to be general rule), but you don't have to do it while:

- using if statement
- using math operations (add, sub, div etc)
- using copying variables (copy(...))
- and some other situations

11

Dienstag, 17. Dezember 2013, 23:39

Thanks Lešek,
I will study hard. *thumbup*
marty