Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Dienstag, 30. Juni 2009, 16:12

switch with two actions?

Hi,

I have a button, that I want to use as a toggle: add a plugin and remove the same plugin. For this functionality I wrote two actions.

But how can implement this? onclick="switch(action(one),action(two));" dont work.

I think also in 1.0.8 there is no plugin attribute like plugin.isadded or so.

Its no problem with two button, but I think only one button would better tu use.

Thanks in advance
Karl

2

Dienstag, 30. Juni 2009, 23:27

Hi karl,

onclick="switch(action(one),action(two));" must work.... ;-)

please, post here your code to see what's wrong.

Salut.

3

Mittwoch, 1. Juli 2009, 10:31

Hi,

Zitat

I have a button, that I want to use as a toggle: add a plugin and remove the same plugin. For this functionality I wrote two actions.

But how can implement this? onclick="switch(action(one),action(two));" dont work.
a way would be to declare two onclick attributes (e.g. onclickA and onclickB)
and to call them from the real "onclick" event and set in onclickA and onclickB
the normal "onclick" to the other one,
e.g.:

Quellcode

1
2
3
4
5
<plugin ...
        onclickA="action(one); set(onclick, onclickB() );"
        onclickB="action(two); set(onclick, onclickA() );"
        onclick="onclickA();"
        />


but other there are also other possiblites,
e.g. by using a "state" (action1or2 here) variable and if(),

Quellcode

1
2
3
4
<plugin ...
        action1or2="1"
        onclick="if(action1or2 == 1, action(one), action(two)); switch(action1or,1,2);"
        />

Zitat

I think also in 1.0.8 there is no plugin attribute like plugin.isadded or so.
the "onloaded" event could be used to get noticed when the plugin was loaded and added,
there are the following attributes about the current loading state of a plugin or hotspot,
they could be used too:
  • plugin[name].loaded
    • "false" when not loaded or while loading
    • "true" when loaded and ready for usage
  • plugin[name].loading
    • "false" when not loaded or when loading has finished
    • "true" while loading
best regards,
Klaus

4

Mittwoch, 1. Juli 2009, 11:49

Hi Klaus,

thank you for your promptly answer. both approaches work very well.

By the way: not only your software, also your support including the response time are super.

Greetings
Karl

5

Mittwoch, 2. September 2009, 01:18

i cand change the png url

hii i use this code to hide my buttons but i want that the main button that do this mission will

be changed with 2 different png (hide & show).



i try evrything with no success



sh

6

Mittwoch, 2. September 2009, 11:50

Hi,

what was the problem?
can you show your not working code?

e.g.

Quellcode

1
onclick="switch(url, image1.png, image2.png);" 


should work, but therefore the image1.png and image2.png must be in the same folder
as the swf,

to make the paths relative to the xml use such code:

Quellcode

1
2
3
4
5
6
<plugin ...
url="%CURRENTXML%/image1.png"
...
onclick=switch(url, %CURRENTXML%/image1.png, %CURRENTXML%/image2.png);"
...
/>


best regards,
Klaus