Sie sind nicht angemeldet.

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

1

Freitag, 24. Oktober 2014, 14:01

Reference error when using a variable inside the callwith(); action

Hi!

I use styles extensively and today also tried to use a variable inside the callwith(); action. Like this:

Quellcode

1
callwith(hotspot[get(targetspot)], pause(););


where "targetspot" is the name of the needed videospot. But I get this in the log:

ERROR: Calling action 'callwith' failed! ReferenceError: Error #1069


I wonder if it's possible to use get(); inside callwith();


thanks!
Regards,

Alexey

2

Freitag, 24. Oktober 2014, 21:09

Hi,

the get() should be no problem.

But the problem itself is strange - I can't currently image a case where this could happen... maybe when something bad would happen in the 'pause' function, but even that shouldn't be possible...

Can you show a small example where this happens?

Best regards,
Klaus

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

3

Freitag, 24. Oktober 2014, 22:29

Hi)

Yes, here's the link: http://tours.viewit360.se/develop/bug_reports/reference/
And code: http://tours.viewit360.se/develop/bug_re…erence/tour.xml

The idea is to have the video on the wall and near it there's a hotspot by clicking which a) the wall video must pause and b) youtube video must start to play. As there could be many such hotspots I decided to use style for them with "targetspot" parameter to know which video must be paused. And here this error occured.
Regards,

Alexey

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

4

Freitag, 24. Oktober 2014, 22:54

Just noted that the log error itself appears in Flash (Chrome desktop tested) but the video spot is not paused both in Flahs and html5.
Regards,

Alexey

5

Montag, 27. Oktober 2014, 11:00

Hi,

the error is correct, your xml code is wrong:

Your variable 'targetvideo' is defined with that value:

Zitat

targetvideo="J3LYTge4jB8"

and in your onclick event you are trying to use that variable to get a hotspot with that name:

Zitat

onclick="callwith(hotspot[get(targetvideo)], pause(););

but there is no hotspot with that name!
You probably wanted to use 'targetspot' instead of 'targetvideo'...

Best regards,
Klaus

  • »Alexey Tkachenko« ist der Autor dieses Themas

Beiträge: 770

Wohnort: Russian Federation

Beruf: Interpreting, Building virtual tours

  • Nachricht senden

6

Montag, 27. Oktober 2014, 11:23

Hi!

sure, I was inattentive here...((

Of course it is "targetspot" which must be checked. But again, the error is still there.

Check out updated link:

http://tours.viewit360.se/develop/bug_reports/reference/

http://tours.viewit360.se/develop/bug_re…erence/tour.xml

I added trace(); before the callwith and it returns the right name of the hotspot to be paused (video_to_pause). But callwith still give reference error. Hmm... Am I so inattentive here to miss something else very obvious?? *cry*

Sometimes I feel myself "blind".... *wacko* *wacko*
Regards,

Alexey

7

Montag, 27. Oktober 2014, 11:41

Hi,

right, there is still a problem here - I've check my code again - internally the local scope reference when resolving the first callwith parameter is missing... (I was unfortunately inattentive too ;-))

That means the 'get()' can't be resolved correctly in this case, because it can't access the 'hotspot' scope.
This will be fixed in the next release (1.18.1).

As workaround you could 'resolve' the hotspot object manually first and then use the hotspot object directly,
e.g.
instead of:

Quellcode

1
callwith(hotspot[get(targetspot)], pause(););

do this:

Quellcode

1
2
copy(hs, hotspot[get(targetspot)]); 
callwith(hs, pause(););


Best regards,
Klaus