You are not logged in.

Ariel

Beginner

  • "Ariel" started this thread

Posts: 45

Location: Argentina

  • Send private message

1

Thursday, October 25th 2012, 12:58am

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

Ariel

Beginner

  • "Ariel" started this thread

Posts: 45

Location: Argentina

  • Send private message

2

Thursday, October 25th 2012, 1:11am

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

Sage

Posts: 3,839

Location: Netherlands

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

  • Send private message

3

Thursday, October 25th 2012, 10:26am

Hi,
Try devices instead of device

Could help
?

Tuur *thumbsup*

Ariel

Beginner

  • "Ariel" started this thread

Posts: 45

Location: Argentina

  • Send private message

4

Thursday, October 25th 2012, 8:28pm

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?


Source code

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


also try deviceS but i think it's the same

Source code

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

Ariel

Beginner

  • "Ariel" started this thread

Posts: 45

Location: Argentina

  • Send private message

5

Thursday, October 25th 2012, 9:43pm

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