[help] Redraw problem with script

Hi there -

I wanted to do a mod of a Avescripter desklet and encountered a small problem:

I want to make an option available that replaces part of the skin to give it another look - so by choosing a theme in a dropdown menu, the skin changes.

Unfortunately, after choosing the theme and pressing "Done", the theme is applied very slowly and soon afterwards AveDesk crashes...

I've got no clue of scripting, I just tried to adapt existing Redraw-functions. This is what I did:

In the xml-file:

side 0:

side 1:

and

In the main.js-file:

function UpdateBG(){

if (this.GetCurrentSide()>0){

var newcolor = this.controls('colorval').Value;

this.parameters('color').Value = newcolor;

this.layers('backcolor').src = newcolor;

this.Redraw(true);

this.FlipTo(0);

}

}

I'm pretty sure it's a problem of the UpdateBG-function...

To I have to add another variable to make it more stable? I've tried a lot of variations, but didn't get it working...

By the way, another question:

Can I launch a program/commandline without using vbs - I know you can't do so in a browser, but with Ave?

#356352

Can you email me your desklet so I can see the entire thing?

This would help me a lot to identify the problem.

Have you tried it with the beta version?

#356410

Just looked at your code. You got an endless loop!

OnBeforeFlip your flip to 0 which causes the flip to trigger again and again and again...

You don't need your onBeforeFlip.. remove the code. in onbeforeflip

#356527

Thanks a lot -

I never would have found the bug I'm afraid, I was looking in the totally wrong direction!

But now it's working and I just uploaded it at your page... :D

Unfortunately I seem to have problems with uploading a screenshot :(

#356786

Ya.. the software I'm using for the website is buggy... i'm hoping to switch over once the new site is ready.

Just PM the details of the problem I can fix it manually.

#356930