Sie sind nicht angemeldet.

1

Mittwoch, 8. Juni 2011, 11:04

scene <-> textfield

Hello,

I have 4 panoramas.
When a scene is loaded its name should be visible automatically.
Can someone give me a simple code how to create this.

I searched a while in this forum but couldn't find a simple code, only huge complicated ones..

Thanks in advance.

=servaas=

2

Mittwoch, 8. Juni 2011, 14:15

Hello!
you can add an action in onstart event
scene onstart="showname();"

plugin name="scenename" url="textfield.swf" ...

action name="showname"

textadd(plugin[scenename].html,[p],get(xml.scene),[p]);

/action

xml.scene - is the current scene name
but, if you want to use custom attribute (title for example) then code will

textadd(plugin[scenename].html,[p],get(scene[get(xml.scene)].title),[p]);

and don't forget to add title to each scene

Hope this help
Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

3

Mittwoch, 8. Juni 2011, 15:59

Thanks man.
I'll have a look at this !

4

Montag, 4. Juli 2011, 11:09

Hi Andrey,

I finally had the time to look at your codes ..
But I don't get it 100%.

Why do I get a XML parser error when I insert the code this way ?


Thanks a ton for your help.
=servaas=

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<krpano version="1.0.8" onstart="startup();">

        <scene onstart="showname();"

	<action name="startup">
		loadscene(get(scene[0].name), null, MERGE);
		buildthumbs(); 
	</action>
	

	<action name="showname">
	textadd(plugin[scenename].html,[p],get(xml.scene),[p]);
	</action>
	
	<plugin name="scenename" url="textfield.swf">

Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »servaas« (4. Juli 2011, 11:27)


5

Montag, 4. Juli 2011, 13:03

Hi,
Why do I get a XML parser error when I insert the code this way ?
see this line:

Quellcode

1
 <scene onstart="showname();" 

there the closing '>' is missing,

best regards,
Klaus

6

Montag, 4. Juli 2011, 13:27

Thanks a lot for your reaction !
But I still got the error.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<krpano version="1.0.8" onstart="startup();">

       <scene onstart="showname();">

	<action name="startup">
		loadscene(get(scene[0].name), null, MERGE);
		buildthumbs(); 
	</action>
	

	<action name="showname">
	textadd(plugin[scenename].html,[p],get(xml.scene),[p]);
	</action>
	
	<plugin name="scenename" url="textfield.swf">


I've put he textfield.swf file in the same folder as the xml.

Should I change something as well to the settings of the scenes ?

Quellcode

1
<scene name="kamer 01 - chambre 01" title="kmr1" onstart="" thumburl="kmr1.tiles/thumb.jpg">


Thanks in advance.
=servaas=

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

7

Montag, 4. Juli 2011, 14:40

its txtadd not textadd

8

Montag, 4. Juli 2011, 14:51

Hi and thanks for your reaction but I still have the error .. :-(

<krpano version="1.0.8" onstart="startup();">

<scene onstart="showname();">

<action name="startup">
loadscene(get(scene[0].name), null, MERGE);
buildthumbs();
</action>


<action name="showname">
txtadd(plugin[scenename].html,[p],get(xml.scene),[p]);
</action>

<plugin name="scenename" url="textfield.swf">

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »servaas« (4. Juli 2011, 15:01)


9

Montag, 4. Juli 2011, 15:43

Hi,

can you show the full code or better a link to the pano?

best regards,
Klaus

10

Montag, 4. Juli 2011, 17:52

Hi Klaus,

Thanks for your reply.

You can find my testcase on this link.
But as you see it doesn't work.

Here you can find the XML

Looking forward :-)

(this original testcase without text does work)

=servaas=

11

Dienstag, 5. Juli 2011, 10:14

You have to "close" the plugin tag.

Quellcode

1
<plugin name="scenename" url="textfield.swf" />


For future reference, try opening the xml file in your browser, and it will tell you if - and on what line - it has trouble parsing your xml file.

12

Dienstag, 5. Juli 2011, 12:15

hi ahoeben,

Thanks for your reaction !
But... no succes.

When I check the xml in my browser it tells me :
"error on line 301 at column 10: Opening and ending tag mismatch: scene line 0 and krpano"

But I don't see any problem there actually..

And when I delete the text codes it all works fine..

Lost in space ... *confused* *cry*

=servaas=

13

Dienstag, 5. Juli 2011, 14:50

textadd(plugin[scenename].html,[p],get(xml.scene),[p]);


i dont think that is right. the , inside the [p] are it i think. use single quotes instead like 'get(xml.scene)' .... maybe?

14

Dienstag, 5. Juli 2011, 17:54

In your code, I still see

Quellcode

1
<plugin name="scenename" url="textfield.swf">

It should be

Quellcode

1
<plugin name="scenename" url="textfield.swf" />

15

Mittwoch, 6. Juli 2011, 10:11

I hadn't upload the file, i just did the test on my computer.

I've uploaded it now, but as you see no succes .. :-(

=servaas=

16

Mittwoch, 6. Juli 2011, 11:08

You are opening a <scene> node that you are not closing. Also <scene> nodes don't work the way you may think they do. Instead of

Quellcode

1
<scene onstart="showname();">
you probably want to do something like

Quellcode

1
<event onxmlcomplete="showname();" />


You also need to add keep="true" to the textfield plugin, and some styling.

17

Mittwoch, 6. Juli 2011, 16:06

thanks for your reply but I'm even more lost in space now..

This rather simple issue seems to driving me crazy..

Can someone show me a simple complete xml example to see it actually work.. and to so better understand ? *huh*

Thanks
=servaas=

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

18

Mittwoch, 6. Juli 2011, 17:45

You are opening a <scene> node that you are not closing. Also <scene> nodes don't work the way you may think they do. Instead of

Quellcode

1
<scene onstart="showname();">
you probably want to do something like

Quellcode

1
<event onxmlcomplete="showname();" />


You also need to add keep="true" to the textfield plugin, and some styling.


Whatcha talkin bout Willis? Thats how I update my textfield html
onstart="set(plugin[text_title].html,data:htmldata1);set(plugin[text_desc].html,data:htmldata2);...
and my data tags reside in the scenes as well. Works fine for me.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

19

Mittwoch, 6. Juli 2011, 20:47

Look at hos xml code. He was trying to put a single, empty scene node with a onstart attribute on top of his xml, thinking that the onstart would work for all his scenes.

willis

Beiträge: 1 857

Beruf: Virtual Tours - Photography - Krpano developer

  • Nachricht senden

20

Donnerstag, 7. Juli 2011, 15:49

Right, its very confusing. The whole tag should be deleted and onstart moved to his first scene.
Its also causing the parsing error, because it didn't have a closing </scene> tag if it did make any sense.
Though I guess you could use events inside scenes, instead of using onstart in the scene tag.
An interesting question, is what would fire first?
scene onstart
event onxmlcomplete
event onloadcomplete
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour