Sie sind nicht angemeldet.

1

Donnerstag, 25. Oktober 2012, 00:58

Device object

Hello Klaus
First of all, your last update of the software, the 1.0.8.15 is a peace of gold!
thank you so much for such a great work!!!

I've been trying to work with the device object.
In the documentation you say that the old devices variable are being deprecated and shouldn't be used anymore.
So in stead use the new device object.

In the examples of the documentation it is used like this:

if(device.flash, ... );

But this is not working at all!

To be more specific this is what I tried to do:

this doesn't work
<plugin name="Somename=" url="..." ... .. onloaded="if(device.phone,set(scale,2));" />

But the old way it works:
<plugin name="Somename=" url="..." ... .. onloaded="if(isphone,set(scale,2));" />


So I tried other ways and I came up with this syntax wich works:

if(device === phone, ... );

I wonder why in the examples of the Docu it's set like that???

thank you!

Ariel
Ariel M.
Build and Customize your virtual tours with Spinattic
www.spinattic.com

My profile in Spinattic

2

Donnerstag, 25. Oktober 2012, 01:11

oh wait! =S

now if I do

onloaded="if(device === phone, set(scale,2) );"


it works, but it also does the scale,2 for tablets!!!!
I did a trace(get(device)) and I get null

so why is it resolving device === phone a true when it is a tablet and tracing null ???

this is really strange...
Or I'm stupid and I'm doing something wrong, or there's a bug with the device object

Klaus, please can you review? thank you!!!
Ariel M.
Build and Customize your virtual tours with Spinattic
www.spinattic.com

My profile in Spinattic

Tuur

Erleuchteter

Beiträge: 3 839

Wohnort: Netherlands

Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Nachricht senden

3

Donnerstag, 25. Oktober 2012, 10:26

Hi,
Try devices instead of device

Could help
?

Tuur *thumbsup*

4

Donnerstag, 25. Oktober 2012, 20:28

hi Tuur
thanks!
I tried that and still doesn't work

can someone test this code and let me know if it works or I'm just crazy?


Quellcode

1
<events onloadcomplete="if(device.flash,showlog());"/>


also try deviceS but i think it's the same

Quellcode

1
<events onloadcomplete="if(devices.flash,showlog());"/>


this is the simplest thing! I don't get why it doesn't work!

thanks!
Ariel M.
Build and Customize your virtual tours with Spinattic
www.spinattic.com

My profile in Spinattic

5

Donnerstag, 25. Oktober 2012, 21:43

SOLVED

So Klaus replied to my email and the point me out if I was using the latest Build 2012-10-05
and no, I thought I had the lates but it had the 2012-08-10

so if you come up with this issue, make sure you have the latest build.

cheers!
Ariel M.
Build and Customize your virtual tours with Spinattic
www.spinattic.com

My profile in Spinattic