Sie sind nicht angemeldet.

1

Dienstag, 2. Juni 2009, 22:07

Personalize loader

Hello all, I have a simple question.
I have a software which allow me to build my own swf loader, is it possible to change the default loader and replace it with the one i build ?

Thanks for your reply.

Steph'

2

Sonntag, 7. Juni 2009, 18:34

Hi all,
can someone please answer me ?

Klaus can you tell me if it's possible tu use personnal preloader.

Thanks.

Steph'

Shanti

Fortgeschrittener

Beiträge: 301

Wohnort: Puerto Vallarta

Beruf: Web Developer

  • Nachricht senden

3

Sonntag, 7. Juni 2009, 19:00

not in that way *YET*

you could make a png and use the built in loaders, and use wait(LOAD) to remove the png, after its loaded :)

4

Montag, 8. Juni 2009, 14:58

Hi,

it would be possible to write a plugin (flash, as3) that draws a custom loading bar,
(use krpano 1.0.8 beta 8)

e.g. AS3 code for Flash CS3:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import krpano_as3_interface;

var krpano:krpano_as3_interface = null;

this.addEventListener(Event.ADDED_TO_STAGE, startplugin);

function startplugin(evt:Event):void
{
  // get interface to krpano
  krpano = krpano_as3_interface.getInstance();

  // first - disable the build-in progressbar 
  krpano.set("progress.showload","none");
  krpano.set("progress.showwait","none");
  
  // check every frame if krpano is loading something
  addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}

function enterFrameHandler(event:Event):void
{
  if( krpano.get("progress.isloading") == true )
  {
    // bytesloaded/bytestotal are the number of bytes currently loaded and total
    // note - for tiled and multiresolution panoramas these value can vary quickly!
    // better use the "progress" value in this case!
    var bytesloaded:Number = Number( krpano.get("progress.bytesloaded") );
    var bytestotal:Number = Number( krpano.get("progress.bytestotal") );

    // "progress" is a value between 0.0 and 1.0
    var progress:Number = Number( krpano.get("progress.progress") );

    // draw/scale something with this value
    ...
  }
}


include this plugin in the xml and set "preload" to "true"!

xml:

Quellcode

1
<plugin name="myloader" url="myloader.swf" preload="true" keep="true" />


best regards,
Klaus

5

Montag, 8. Juni 2009, 15:47

Hi, Klaus

Sorry for my poor english and I am a poor as3 flasher

What do you mean by

Quellcode

1
2
  // draw/scale something with this value
    ...

6

Montag, 8. Juni 2009, 15:54

Hi,

I mean you could draw or scale something based on the progress value,

e.g.
if want a image as progress bar, scale the width of the image with the progress value,
as3/cs3 code:

Quellcode

1
2
3
4
5
6
7
var progressbarwidth:Number = 300;

// calc left offset of image:
image.x = stage.stageWidth/2  - progressbarwidth/2;

// calc width (depending on the progress):
image.width = progress * progressbarwidth;


I will provide a .fla example in the next release

best regards,
Klaus

7

Montag, 8. Juni 2009, 16:04

Thank's for the code ;-)

But I can't make anything in as3, sorry

8

Montag, 8. Juni 2009, 16:21

there will be a xml only way soon too

Shanti

Fortgeschrittener

Beiträge: 301

Wohnort: Puerto Vallarta

Beruf: Web Developer

  • Nachricht senden

10

Montag, 8. Juni 2009, 17:40

and here is the swf version, with the fla, copied from this post :)

the loader is green horrible, but its an example so you can change it to whatever you like :)

Quellcode

1
<plugin name="loader" url="progress.swf" keep="true" align="leftcenter" />
»Shanti« hat folgende Datei angehängt:
  • progress.zip (10,21 kB - 657 mal heruntergeladen - zuletzt: 12. Oktober 2023, 20:18)

11

Montag, 8. Juni 2009, 18:16

Greats Shanti thank's a lot *thumbsup*

I try to understand as3

12

Dienstag, 30. Juni 2009, 16:58

Great thanks for all.
I use to build my own loader with a simple software which save it directly in swf, so can i insert it easily in the xml file using a plugin function or is it more difficult ?

Steph'

13

Donnerstag, 2. Juli 2009, 10:49

I use to build my own loader with a simple software which save it directly in swf, so can i insert it easily in the xml file using a plugin function or is it more difficult ?
yes, that's "all"

the example from Shanti is great to start (thanks )

best regards,
Klaus

bulp

Fortgeschrittener

Beiträge: 390

Wohnort: Malaysia

  • Nachricht senden

14

Sonntag, 5. Juli 2009, 10:41

Thank you Shanti... great example..

15

Sonntag, 18. Oktober 2009, 21:57

Add logo to Shanti's example?

Hi,

For a preloader is there any way just to have a stationary logo, loading bar underneath and then a % counter under the bar?

Using the FLA example, I tried to add a logo above the 'loadimg' movie clip but for some reason it remains visible after the bar has loaded 100% and then disappeared.

I then tried adding the logo inside the actual 'loadimg' movie clip (made the stage a little bigger) but when it works the logo is stretched along with bar and looks odd.

I see that Job.1 mentioned making one with xml but the link is dead so I've no idea what code to use although I did see one in action on the main website but the code is encrypted *sad*

Look forward to any advice please.

Thanks,

Andrew

16

Dienstag, 20. Oktober 2009, 09:56

Hi,

you need to change/extend the action script code,

e.g.

Quellcode

1
2
3
4
5
6
7
8
9
10
if (krpano.get("progress.isloading") == true)
{
  ...
}
else
{
  ...
  // add this (yourimage is the name of your image sprite/movieclip/displayobject...)
  yourimage.visible = false;
}


best regards,
Klaus

17

Mittwoch, 21. Oktober 2009, 18:44

Thanks Klaus. That did the trick. It now appears and goes when it should *smile*

Seem to be having some alignment issues with the logo appearing way left above the loading bar but will attack that at the weekend.

All the best,

Andrew

18

Mittwoch, 30. Dezember 2009, 10:40

Supress preloader with AS3 code work only one time

Hello,
I'm coding an AS3 plugin for my project.

I have already code personal loader for one panorama, but, now i'm coding for a virtual tour ( more than 10 panos)

I have use your sample code, an modify it for the multiple resolution percent support.

In my code, i'm use this code for deactivate the integrated loading bars :

Quellcode

1
2
3
4
5
6
7
8
9
10
function startup_plugin(event:Event):void
{
	// first krpano calls - disable default progressbar
	krpano.set("progress.showload","none");
	krpano.set("progress.showwait","none");
	
	// here, other code...
	
	
}


In my virtual tour, the two progress bar are desactivate for the first pano, but if i load another one (by clicking on xml hotspot, no AS3 loading function at this time)

the krpanos loading bar are reactivate.

i have insert my plugin like this in the xml :

Quellcode

1
<plugin name="loadingBarPerso" url="data/graphics/loderPerso.swf" preload="true" keep="true"/>


it is a KRpano bug ? or do you have a specific function for desactivate theses bar all the time ?

Thanks

19

Donnerstag, 31. Dezember 2009, 00:35

Hi,
it is a KRpano bug ? or do you have a specific function for desactivate theses bar all the time ?
use the MERGE or KEEPALL or KEEPPROGRESS flags in the loadpano() call,
without one of these flags the <progress> settings will be reset back to default
when there are no new settings in the new xml,

see here:
http://krpano.com/docu/actions/#loadpano

best regards,
Klaus

20

Donnerstag, 31. Dezember 2009, 11:01

Hello,
Ok i have completely forget theses flags.
I'm sure, i knows theses but, in the panic, i don't have search about it.

Thank for your help