Sie sind nicht angemeldet.

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

1

Donnerstag, 12. Mai 2011, 19:45

detect iphone & ipad version

Hi, is there a way to detect in the iphone is a version 3, 3gs or 4 and a ipad 1 or 2 ?
I ask this because I would like to include a button to enable/disable gyro for iphone 4 and ipad 2 and a button to enable/disable autorotation for iphone 3 & 3gs & ipad 1...

Thanx !

2

Donnerstag, 12. Mai 2011, 21:54

Hi,

no, currently there is no way for that,
but the gyroscope plugin has a available attribute which could be checked,

e.g. here an example usage:

Quellcode

1
<plugin name="gyro" alturl="gyro.js" ... onloaded="delayedcall(1,if(available, trace(gryo available), trace(gryo not avaiable)));" />

best regards,
Klaus

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

3

Freitag, 13. Mai 2011, 10:45

Cool, thant Klaus !!!

Just to understand your example (gyro available) & (gyro no available) are actions I can build ?
Hi,

no, currently there is no way for that,
but the gyroscope plugin has a available attribute which could be checked,

e.g. here an example usage:

Quellcode

1
<plugin name="gyro" alturl="gyro.js" ... onloaded="delayedcall(1,if(available, trace(gryo available), trace(gryo not avaiable)));" />

best regards,
Klaus

opticalfx

Schüler

Beiträge: 62

Wohnort: Peterborough, UK

Beruf: Virtual Tour Photographer

  • Nachricht senden

4

Freitag, 17. Februar 2012, 10:43

I'm not great at coding but I've come across this and wonder if I can modify it to only make my 'gyro on/off' button available if it's a gyro enabled device?

My current gyro code:

Quellcode

1
<plugin name="gyro" url="gyro.js" enabled="true" camroll="true" friction="0.5" velastic="0.2" devices="html5" keep="true" />


The button I am using that appears on all iphones/ipads but I want to ONLY appear on gyro enabled:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
	<plugin name="gyro-button" style="gyrobutton" devices="iphone|ipad" align="righttop" x="30" y="30" width="120" html="[p]Gyro off[/p]" onclick="switch(plugin[gyro].enabled); set(view.camroll,0.0); if(plugin[gyro].enabled == false, set(html,[p]Gyro On[/p]), set(html,[p]Gyro Off[/p]));"/> /> 

<style name="gyrobutton"
		url="plugins/textfield.swf"
		keep="true"
		children="false"
		height="22"
		onloaded="set(alpha,0); set(textblur,15); set(blur,15); tween(alpha,1.0,0.3); tween(textblur,0,0.3); tween(blur,0,0.3);"
		onover="tween(alpha,0.7,distance(0.3,0.2));"
		onout="tween(alpha,1.0,distance(0.3,0.2));"
		autosize="none"
		css="p{color:#FFFFFF; font-family:Arial; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
		background="true" backgroundcolor="0x000000" backgroundalpha="0.7"
		bordercolor="0" borderwidth="0"
		blur="0"
		glow="4"
		glowcolor="16777215"
		roundedge="5"
		shadow="1"
		textblur="0" textglow="0" textglowcolor="16777215" textshadow="0"/>


How would I re-write this please so it detects?

Thanks,
Adrian
Many thanks,

Adrian Salisbury, UK
Smart Virtual Tours

  • »jeromebg« ist der Autor dieses Themas

Beiträge: 1 120

Wohnort: Angers - France

Beruf: 360 experiences creator

  • Nachricht senden

5

Freitag, 17. Februar 2012, 10:52

You can detect if the gyroscope is available onloaded :

Quellcode

1
2
3
4
5
6
7
<plugin name="gyro" url="gyro.js" keep="true" enabled="false" camroll="true" friction="0.5" velastic="0.2" onloaded="delayedcall(2,if(available, gyroscope, nogyroscope));" devices="iphone|ipad"/><action name="gyroscope">
set(plugin[gyro].enabled,true);
set(plugin[pausegyro].visible,true);
</action><action name="nogyroscope">
set(autorotate.enabled,true);
set(plugin[pauseiphone].visible,true);
</action>