You are not logged in.

cptvideo

Beginner

  • "cptvideo" started this thread

Posts: 7

Location: Oregon, USA

Occupation: video producer, director

  • Send private message

1

Saturday, January 21st 2012, 3:12am

Trying to close a pop-up plugin on a 'onviewchange' event

I'm sure I'm just not quite coding the magic words but: I'm trying to get a pop-up plugin to close when there's a 'onviewchange' event.

My plugin is simply a .png that has a name=testwindow1 and a visible that's set to"true" when a hotspot is clicked.

To make the visible = "false" I try this:

Source code

1
<events  onviewchange= "checkH();" />

then:

Source code

1
<action name="checkH"> 	if ( (plugin[testwindow1].visible,true), set(plugin[testwindow1].visible,false) );   </action>  

But the plugin doesn't respond. I've also tried putting the set(plugin[testwindow1].visible,false) inside a seperate action which I call from the if statement, but that's a no-go as well.

Any ideas out there? Thanks in advance, Craig.

mindlessboss

Professional

Posts: 1,082

Location: Russia, Kaliningrad

  • Send private message

2

Saturday, January 21st 2012, 4:48am

Hi!
wrong:
if ( (plugin[testwindow1].visible,true), set(plugin[testwindow1].visible,false) );

correct:

if ( plugin[testwindow1].visible, set(plugin[testwindow1].visible,false) );


Regards
Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

cptvideo

Beginner

  • "cptvideo" started this thread

Posts: 7

Location: Oregon, USA

Occupation: video producer, director

  • Send private message

3

Saturday, January 21st 2012, 7:07am

Thanks for your help with syntax but your code still doesn't affect my plugin.

I'm confused by this, because I have a functioning piece of code, inside an action connected to the 'onclick' event in the plugin, that lets me "close" the plugin when click anywhere directly on the plugin. But when I put the same code, or action-call, inside another action I get nothing!

So, to be clear, when I do this:

Source code

1
<plugin name="testwindow1" url="testpopup.png"  visible="true"  enabled="true" " alpha="1.0"  onclick="Simonshutsup()" />

and this:

Source code

1
<action name="Simonshutsup">  set(plugin[testwindow1].visible,false); </action>

it works.

But when I do this:
<events onviewchange= "checkH();" />
and this:

Source code

1
<action name="checkH">  if ( plugin[testwindow1].visible, set(plugin[testwindow1].visible,false) ); </action>

it doesn't work!

As they say in the Bronx, "What's up with that?"

cptvideo

Beginner

  • "cptvideo" started this thread

Posts: 7

Location: Oregon, USA

Occupation: video producer, director

  • Send private message

4

Saturday, January 21st 2012, 7:43pm

I was wrong. It works! I just needed to get a good night's sleep and be careful about the order of execution inside of actions that call other actions.

Thanks for your help.

c.u.