Sie sind nicht angemeldet.

pixelcase

Schüler

  • »pixelcase« ist der Autor dieses Themas

Beiträge: 89

Wohnort: All over

Beruf: this

  • Nachricht senden

1

Freitag, 27. Februar 2009, 10:28

Loading swf (or image I suppose) only once a hotspot is clicked

Hi Guys,

It seems that all plugings, images, etc etc are all loaded up and are invisible) A bit like FPP

I would like to only load a swf when the user clicks on a certain hotspot - with its own preloader etc.

I am sure this is possible...... isn`t it...?

Thanks in advance

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

2

Freitag, 27. Februar 2009, 14:37

I haven't tried... but it sounds like "addplugin" might do something like this...

setup something like...

onclick="action(load_my_plugin);"


action name="load_my_plugin"
addplugin(plugin_name)
set...
set...
/action

http://www.krpano.com/docu/actions/#addplugin

If that works then you might also be able to replace all of the sets with an includeurl item if you want to keep your main xml page clean.

All of this is speculation though since I've not tried it.

3

Samstag, 28. Februar 2009, 00:54

Hi,

yes, you can, use the addplugin() or addhotspot() action to create a new plugin/hotspot,
or just leave the "url" attribute empty, and set it later on demand,

the file/image will be loaded when the "url" was set/changed

e.g.

Quellcode

1
2
3
<plugin name="image" url="" align="center" />

... onclick="set(plugin[image].url, image.jpg);" 


or completely dynamic via addplugin():

Quellcode

1
2
3
... onclick="addplugin(image);
             set(plugin[image].align,center);
             set(plugin[image].url, image.jpg);"


best regards,
Klaus

flash360

Schüler

  • »flash360« ist der Autor dieses Themas

Beiträge: 89

Wohnort: All over

Beruf: this

  • Nachricht senden

4

Dienstag, 3. März 2009, 01:01

Thanks Guys,

Next question - could I unload swfs like "hide images"

just I have over 40 plugins and I want to keep it smooth!!

cheers

JB

EDIT - I READ THE DOCS!! _

removeplugin(name)


removes a plugin object



parameters:

  • name

    name of the plugin be to removed




example:


removeplugin(button);

;-)

Graydon

Profi

Beiträge: 614

Wohnort: Texas

Beruf: Industrial gas turbine services.

  • Nachricht senden

5

Dienstag, 3. März 2009, 05:03

I want to see 40+ plugins... *smile*

flash360

Schüler

  • »flash360« ist der Autor dieses Themas

Beiträge: 89

Wohnort: All over

Beruf: this

  • Nachricht senden

6

Montag, 13. April 2009, 06:03

OK I`m nearly there!!!

However I have a button that should remove all plugins (a bit like hide all images) - however if some plugins have not yet been loaded it brings up an error:

ERROR: remove - unknown array item - pluginname

??

cheers

7

Montag, 13. April 2009, 11:06

Hi, can you explain your test suite a little bit more or show some code?
if addplugin() was called then removeplugin() should also work...

best regards,
Klaus

flash360

Schüler

  • »flash360« ist der Autor dieses Themas

Beiträge: 89

Wohnort: All over

Beruf: this

  • Nachricht senden

8

Montag, 13. April 2009, 14:28

Thanks Klaus -

Imagine opening plugins like opening images (like your example)

<action name="hideallplugins">
removeplugin(lot1);
removeplugin(lot2);
removeplugin(lot3);

action(hideimage,hidebutton);
</action>

Now - this works - however, if one of the plugins (e.g. lot2) has not yet been opened - it calls the above error.

I could make them invisible but would rather remove them...

Cheers

John

9

Montag, 13. April 2009, 16:09

i am very curious to see the end product here as well. i have a project ill be starting very soon that will require that many or more plugins and have started to think about how to handle it. keep us posted.

10

Dienstag, 14. April 2009, 00:08

Hi,

when you use the latest 1.0.8 beta,
you could add a if() check before removing,
e.g.

Quellcode

1
2
3
if(plugin[lot1].loaded, removeplugin(lot1) );
if(plugin[lot2].loaded, removeplugin(lot2) );
...


best regards,
Klaus

flash360

Schüler

  • »flash360« ist der Autor dieses Themas

Beiträge: 89

Wohnort: All over

Beruf: this

  • Nachricht senden

11

Dienstag, 14. April 2009, 03:10

Thanks Klaus....

I`m sure you are very busy - apreciate your swift replys.

This is the reason I switched from FPP - and now, after playing with KRpano for a while now. I realise the xml is sooooo much more ordered.

It was a bit weird to start but its great after a while

Ähnliche Themen