..
and when possible with set and get
Tuur
..
and when possible with set and get
Tuur
Hi,
changing the content of the textfield by setting a the "html" attribute should be already possible,
best regards,
Klaus
but no chance with set get? just for the text.. so i can use the same set as i do for the desktop xml?
Tuur
Hi,
sorry, I'm not sure what you mean now,
setting and getting the html attribute is possible of course,
but using "get()" inside the html text is not possible, not in Flash and also not in JS,
best regards,
Klaus
when i do for i phone:
html="get($krp_1);" or so it doesn't work but i do the same thing for desktop
like
<krpano version="1.0.8" logkey="false" onstart="credit_var();text_credit();style_var();title_text();text_var();text_text();" >
<style name="credittextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="1"
html="data:html_credit_text"
css=""
align="lefttop" x="60" y="1"
background="false"
backgroundcolor=""
width="100%"
height="22"
zorder="100"
onloaded="text_var_credit();credit_var();style_var();
delayedcall(10, tween(alpha,0,0.5,,WAIT);title(););"
/>
<action name="text_credit">
set($ph_1, Photography by Arthur van den Enk);
</action>
<data name="html_credit_text"></data>
<plugin name="credit_text" style="credittextstyle"/>
<action name="credit_var">
txtadd(data[code=css].content,"body { color:",get(taal_color),"; font-weight:",get(taal_weight),"; font-family:",get(taal_family),";}");
set(plugin[credit_text].css,data:css);
</action>
<action name="text_var_credit">
txtadd(data[html_credit_text].content,"<p>",get($ph_1),"</p>");
</action>
Alles anzeigen
that works perfect spread over different xml's... but i like to do the 'same' on idevices..
Tuur
Hi,
okay, I have never tested that yet,
but using a '$' in a variable name can be problematic,
please try it without '$',
best regards,
Klaus
oke i will later tonight.. and post results.
Thanx
Tuur
mmm
i do
:
<style name="credittextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="1"
html="[div style='color:#333366;width:100%;height:100%;
font:bold 12px Verdana;text-align:left;']data:html_credit_text[/div]"
css=""
align="lefttop" x="60" y="-1"
background="false"
backgroundcolor=""
width="100%"
height="38"
zorder="100"
onloaded="text_var_credit();credit_var();style_var();
delayedcall(10, tween(alpha,0,0.5,,WAIT);set(html, [div style='color:#333366;width:100%;height:100%;
font:bold 12px Verdana;text-align:left;']data:html_title_text[/div]); tween(alpha,1,0.5););"
/>
Alles anzeigen
but it shows the text : data:html_credit_text
and later: data:html_title_text
how can i get that it prints the text that is in the variable ..
the whole code:
onstart="title_var();credit_var();text_title();text_credit();style_var();startup();"
....
<scene name="scene_anp_tuschinski_1" title="anp_tuschinski_1" onstart="" thumburl="anp_tuschinski_1.tiles/thumb.jpg">
<view hlookat="0" vlookat="0" limitview="on" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" vlookatmin="-90"
vlookatmax="+90"/>
<preview url="anp_tuschinski_1.tiles/preview.jpg" />
<image>
<mobile>
<left url="../tuschinski_1/1.tiles/mobile_l.jpg" />
<front url="../tuschinski_1/1.tiles/mobile_f.jpg" />
<right url="../tuschinski_1/1.tiles/mobile_r.jpg" />
<back url="../tuschinski_1/1.tiles/mobile_b.jpg" />
<up url="../tuschinski_1/1.tiles/mobile_u.jpg" />
<down url="../tuschinski_1/1.tiles/mobile_d.jpg" />
</mobile>
</image>
<data name="html_credit_text"> </data>
<plugin name="credit_text" style="credittextstyle"/>
<action name="text_var_credit">
txtadd(data[html_credit_text].content,"<p>",get(ph_1),"</p>");
</action>
<data name="html_title_text"> </data>
<plugin name="title_text" style="titletextstyle"/>
<action name="text_var_title">
txtadd(data[html_title_text].content,"<p>",get(tit_1),"</p>");
</action>
</scene>
<action name="style_var">
set(taal_color,"#333366");
set(taal_weight,"");
set(taal_family,"Verdana,Arial,Helvetica");
</action>
<action name="text_credit">
set(ph_1, Photography by Arthur van den Enk);
</action>
<action name="text_title">
set(tit_1, De foyer van theater Tuschinski.);
</action>
<action name="credit_var">
txtadd(data[code=css].content,"body { color:",get(taal_color),"; font-weight:",get(taal_weight),"; font-family:",get(taal_family),";}");
set(plugin[credit_text].css,data:css);
</action>
<action name="title_var">
txtadd(data[code=css].content,"body { color:",get(taal_color),"; font-weight:",get(taal_weight),"; font-family:",get(taal_family),";}");
set(plugin[title_text].css,data:css);
</action>
<style name="credittextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="1"
html="[div style='color:#333366;width:100%;height:100%;
font:bold 12px Verdana;text-align:left;']data:html_credit_text[/div]"
css=""
align="lefttop" x="60" y="-1"
background="false"
backgroundcolor=""
width="100%"
height="38"
zorder="100"
onloaded="text_var_credit();credit_var();style_var();
delayedcall(10, tween(alpha,0,0.5,,WAIT);set(html, [div style='color:#333366;width:100%;height:100%;
font:bold 12px Verdana;text-align:left;']data:html_title_text[/div]); tween(alpha,1,0.5););"
/>
<style name="titletextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="0"
html=""
css=""
align="lefttop" x="60" y="-1"
background="false"
backgroundcolor=""
width="100%"
height="38"
zorder="100"
onloaded="text_var_title();title_var();style_var();"
/>
Alles anzeigen
probably i don't need the style var on the mobile because it's in the div style...
but how to get the variable in place??
Tuur
cleaned up the code to make it more clear..
<scene name="scene_anp_tuschinski_1" title="tuschinski_1" onstart="" thumburl="tuschinski_1.tiles/thumb.jpg">
<view hlookat="0" vlookat="0" limitview="on" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" vlookatmin="-90" vlookatmax="+90"/>
<preview url="anp_tuschinski_1.tiles/preview.jpg" />
<image>
<mobile>
<left url="../tuschinski_1/1.tiles/mobile_l.jpg" />
<front url="../tuschinski_1/1.tiles/mobile_f.jpg" />
<right url="../tuschinski_1/1.tiles/mobile_r.jpg" />
<back url="../tuschinski_1/1.tiles/mobile_b.jpg" />
<up url="../tuschinski_1/1.tiles/mobile_u.jpg" />
<down url="../tuschinski_1/1.tiles/mobile_d.jpg" />
</mobile>
</image>
<data name="html_credit_text"> </data>
<plugin name="credit_text" style="credittextstyle"/>
<action name="text_var_credit">
txtadd(data[html_credit_text].content,"<p>",get(ph_1),"</p>");
</action>
<data name="html_title_text"> </data>
<plugin name="title_text" style="titletextstyle"/>
<action name="text_var_title">
txtadd(data[html_title_text].content,"<p>",get(tit_1),"</p>");
</action>
</scene>
<action name="text_credit">
set(ph_1, Photography by Arthur van den Enk);
</action>
<action name="text_title">
set(tit_1, De foyer van theater Tuschinski.);
</action>
<style name="credittextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="1"
html="[div style='color:#333366;width:100%;height:100%;
font:bold 12px Verdana;text-align:left;']data:html_credit_text[/div]"
css=""
align="lefttop" x="60" y="-1"
background="false"
backgroundcolor=""
width="100%"
height="38"
zorder="100"
onloaded="text_var_credit();delayedcall(10, tween(alpha,0,0.5,,WAIT);set(html, [div style='color:#333366;width:100%;height:100%;font:bold 12px Verdana;text-align:left;']data:html_title_text[/div]); tween(alpha,1,0.5););"
/>
<style name="titletextstyle"
url="../plugins/textfield.swf"
keep="false"
visible="true"
selectable="false"
alpha="0"
html=""
css=""
align="lefttop" x="60" y="-1"
background="false"
backgroundcolor=""
width="100%"
height="38"
zorder="100"
onloaded="text_var_title();"
/>
Alles anzeigen
So ..
How to make that it's n ot printing the text : data:html_credit_text
but that it gets that variable from : text_var_credit();
i have sort of the same 'system' working on desktop and that works perfect and is also very clear..
Tuur
Right, you must use textadd here to add your strings together.
so?
can i make it work?
Tuur
That's all kind of a complete confusing mess with everything linking for no good reason, and bad use of txtadd setting the html.
Try looking through the examples of the textfield and txt add.. and going slow and using trace, to check for success on utilizing variables.
You could be making a single function to set a string to any textfield plugin. Also research arguments.
Also try this.
<action name="text_var_credit">
txtadd(plugin[credit_text].html,'[p]',get(ph_1),'[/p]');
</action
this is skipping the use of your data field completely.
yes i know..
i copied from an other tour because it works as i like but with arguments etc it would be much better only...
i still don't get it really...
There is still some stuff there that i don't need in the scene... so fist i'll clean up more..
i also don't see how to make it that every scene get's his own two texts then..
Well.. i give a try to learn...
I probably need some help here..
maybe a nice start up?
Thanx
Tuur
Thats EASY!
Put <data name="htmldata1"><p>text</p></data>
INSIDE THE SCENE TAG
AND
<scene onstart="set(plugin[text_title].html,data:htmldata1)"
And then you don't need any of that weird mess of stuff.
Alles anzeigenyes i know..
i also don't see how to make it that every scene get's his own two texts then..
Well.. i give a try to learn...I probably need some help here..
maybe a nice start up?
Thanx
Tuur
That is / does not what i mean..
i prepare an example
http://www.virtualtuur.com/krpano/test_text_var/
look in iphone mode (safari or so)
the first scene i did what u say the second shows what i like to do.. after 5 secs the text also changes..
i lik to get the text from a list of variables as in the taal.xml..
in the big tour i go over 50 pano's..
It's nice when you can use the same taal.xml with all text variables for all devices and desktop..
Tuur
You sure you're not using a very old textfield.swf?
or iphonejs?
maybe remove the style for the url for textfield..
I think it's pointing wrong anyway.
My textfield change on scene works fine with the code I posted to you.
well i was sure..
- took gyro out
- checked textfield plug
now i am sure
DON'T FORGET TO LOOK IN IPHONE MODE
actualy it works only it put's not the text var ... how to do that??
Still the same.
Tuur
Looks the same to me, you still have a bunch of actions not working properly and the plugin trying to use it's data.
There is no difference on flash in how it's supposed to work.
Start with flash and start with a clean xml without a million things like broken styles and broken functions.
show me one thing that does not work or is wrong..
the only thing that does not work is that i can't get the set var in the txtadd..
i think you don't understand what i want at all..
broken textstyle? show me
edit: cleaned up a bit more.. same result
maybe, as u know so well, u can show me how i can get the text that is set as ph_1 in the textfiels.. same for the title.. tit_1
by using the taal.xml
in flash it works perfect i use for a year now.
Tuur
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!