Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

tylerphotos

Anfänger

  • »tylerphotos« ist der Autor dieses Themas

Beiträge: 22

Wohnort: Ponca City, OK

Beruf: Photographer, Yoga Instructor

  • Nachricht senden

1

Samstag, 18. Juli 2009, 19:44

XML Limitations in Textfield - Quotation Marks?

Hello there,

How do you get quotes and such to work within the "html=" field of the textfield plugin? I know that "[" and "]" replace "<" and ">", but what replaces quotation marks?

I'm trying to implement some text at the top of my tour that changes depending on the panorama being viewed. For example, if I go to "City Hall" then the text changes from "Virtual Tour" to "City Hall." I've gotten the text to change just fine, but now I want to customize it - make the font white, larger, etc. Whenever I try to add a font color in the "html=" area of the plugin, I get an error "element is malformed". Note: I'm not using the data attribute because I have an action changing the html within the plugin (see below), so the XML limitations are going to apply one way or another.

Here's the relevant data (I spaced the brackets to make them show up):

<plugin name="title" url="%SWFPATH%/plugins/textfield.swf"
align="top center" edge="top" width="250" height="18" x="0" y="-1" children="false"
html="[ b ] Virtual Tour [ / b]"
background="false"
textglow="0"
textglowcolor="0xffffff"
textshadow="0"
autosize="center"
onclick=""
/>

<action name="loadcityhall">
action(s_cityhall);
set(plugin[title].html,[ b ] City Hall [ / b ]);
loadpano(cityhall.xml,null,KEEPALL,BLEND(2));set(krpano.view.fovmin,30);
wait(blend);oninterrupt(action(lookinterrupt));lookto(280,-5,120,smooth(50,25,100));
</action>

2

Sonntag, 19. Juli 2009, 02:45

set(plugin[title].html,([ b ] City Hall [ / b ])); try that it might not work though.

tylerphotos

Anfänger

  • »tylerphotos« ist der Autor dieses Themas

Beiträge: 22

Wohnort: Ponca City, OK

Beruf: Photographer, Yoga Instructor

  • Nachricht senden

3

Sonntag, 19. Juli 2009, 04:35

I tried, but enclosing the html in parentheses in the "html=" field didn't help my problem. Thanks for the suggestion, though.

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

4

Sonntag, 19. Juli 2009, 05:37

reference information here... http://livedocs.adobe.com/flex/201/langr…d.html#htmlText

just below the htmlText section is info on HTML Entities:
&lt; < (less than)
&gt; > (greater than)
&amp; & (ampersand)
&quot; " (double quotes)
&apos; ' (apostrophe, single quote)

I did a quick test on this page... http://www.krpano.com/examples/textfield/

and it looks to work fine.

edit: oops, sorry - read the title and just barely skimmed the actual message... the above doesn't answer all your questions. I'll have to go back and read again *unsure*

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

5

Sonntag, 19. Juli 2009, 06:28

I played around within the sample linked before and this works...

html="[p][font size=&quot;100&quot;]some text here[/font][/p]"

... when called directly as the html within the plugin.

haven't tested with assigning from an action... but maybe some variant will work.

Also, I'm not sure what you mean by the xml limitations and not using the data node. In you action, you can reset the textfiled plugin's html attribute to a new data source that has the correct title.

Also, when loading a new xml... the data information can be redefined under the same name...

Zitat

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 with the new ones.
so each xml could have something like the following:

Quellcode

1
2
3
<data name="title_data">
    <title_p>this is my title</title_p>
</data>


and with every new xml, the title_data would be replaced...

and by using a custom mark like "title_p" you could define the CSS style you want for all of your titles a single time.

Quellcode

1
2
3
<data name="title_css">
  title_p{color:#FF0000; font-family:Arial; font-size:14;}
</data>

tylerphotos

Anfänger

  • »tylerphotos« ist der Autor dieses Themas

Beiträge: 22

Wohnort: Ponca City, OK

Beruf: Photographer, Yoga Instructor

  • Nachricht senden

6

Sonntag, 19. Juli 2009, 18:37

Thank you, Graydon! I hadn't considered using the other .xml files for the code.

Unfortunately, I couldn't get the plugin data from the cityhall.xml file to overwrite the one in the main .xml file. Does anything look wrong with the code? *blink*

Relevant data:

Quellcode

1
2
3
4
5
6
7
<plugin name="title" url="%SWFPATH%/plugins/textfield.swf" 
	    	align="top center" edge="top" width="250" height="18" x="0" y="-1" children="false"
	    	html="[p align=&quot;center&quot;][font size=&quot;12&quot; face=&quot;Verdana&quot; color=&quot;#FFFFFF&quot;]Virtual Tour[/font][/p]"
	    	background="false"
	    	autosize="center"
	    	onclick=""
	    	/>


And within the cityhall.xml file:

Quellcode

1
2
3
4
5
6
7
	<plugin name="title" url="%SWFPATH%/plugins/textfield.swf" 
	    	align="top center" edge="top" width="250" height="18" x="0" y="-1" children="false"
	    	html="[p align=&quot;center&quot;][font size=&quot;12&quot; face=&quot;Verdana&quot; color=&quot;#FFFFFF&quot;]City Hall[/font][/p]"
	    	background="false"
	    	autosize="center"
	    	onclick=""
	    	/>

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »tylerphotos« (20. Juli 2009, 04:31)


Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

7

Mittwoch, 22. Juli 2009, 04:32

when using the keepall flag in your loadpano action it will not load another plugin with the same name.

reference: http://www.krpano.com/docu/actions/#loadpano

Sorry that I wasn't clear... I was suggesting that you define a new data node and use the action to load the new data into the existing textfield plugin.


Like this....

first.xml

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<plugin name="title" url="%SWFPATH%/plugins/textfield.swf" 
    align="top center" edge="top" width="250" height="18" x="0" y="-1" children="false"
    html="data:virtual_tour"
css="title_p{color:#FF0000; font-family:Arial; font-size:14;}"
    background="false"
    autosize="center"
    onclick=""
    />

<data name="virtual_tour">
<title_p>Virtual Tour</title_p>
</data>

<action name="loadcityhall">
 action(s_cityhall);
set(plugin[title].html,data:city_hall);
 loadpano(cityhall.xml,null,KEEPALL,BLEND(2));set(krpano.view.fovmin,30);
 wait(blend);oninterrupt(action(lookinterrupt));lookto(280,-5,120,smooth(50,25,100));
 </action>


and then...

cityhall.xml

Quellcode

1
2
3
<data name="city_hall">
<title_p>City Hall</title_p>
</data>



When I first got an email about this post being updated... I thought it said you had gotten something like that to work... but the css kept reverting back to standard... I was thinking that by embedding the css into the plugin instead of as another data node that it might work.... but then when I came here to reply that's not what you said... so I'm a bit confused as to what you might have tried and didn't work... so hopefully this isn't redundant to something you tried already *confused*

Let me know how it turns out... If you keep getting stumped I'll work through a demo to see what I can get to work and post a definitive answer.

tylerphotos

Anfänger

  • »tylerphotos« ist der Autor dieses Themas

Beiträge: 22

Wohnort: Ponca City, OK

Beruf: Photographer, Yoga Instructor

  • Nachricht senden

8

Samstag, 25. Juli 2009, 19:35

Graydon, you have been a wonderful mentor! Thank you for your help with the code.

You were right - I edited my post in between your viewings — I was following your suggestion but had left some old code in there that skewed my results. So what I had originally posted was incorrect because I didn't try your approach. I fixed it.

Anyway, your suggestion was 90% right on! When I placed

Quellcode

1
set(plugin[title].html,data:city_hall);
where you suggested, it would try to load the new data attribute before it loaded the .xml it was contained in, and gave me an error. To avoid the error, I placed the command in the "onstart" area of the loadpano command.

first.xml

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<data name="titletext">
		<p align="center">
				<title_p><b>Ponca City Virtual Tour</b></title_p>
		</p>
	</data>
	
	<data name="title_css">
  title_p{color:#FFFFFF; font-family:Verdana; font-size:12;}
</data>
	
	<plugin name="title" url="%SWFPATH%/plugins/textfield.swf" 
	    	align="top center" edge="top" width="250" height="18" x="0" y="-2" children="false"
	    	html="data:titletext"
		css="data:title_css"
	    	background="false"
	    	autosize="center"
	    	onclick=""
	    	/>

 <action name="loadcityhall">
		action(s_cityhall);action(mapsclosebig);
		loadpano(cityhall.xml,null,KEEPALL,BLEND(2),set(plugin[title].html,data:cityhall););set(krpano.view.fovmin,30);
	wait(blend);oninterrupt(action(lookinterrupt));lookto(280,-5,120,smooth(50,25,100));
	</action>


cityhall.xml

Quellcode

1
2
3
4
5
	<data name="cityhall">
		<p align="center">
				<title_p><b>City Hall</b></title_p>
		</p>
	</data>


Again, thank you so much!!! My tour is vastly better thanks to your willingness to share your knowledge.