PDA

View Full Version : So I'm trying to create my own pseudo progress bar... and I'm unsuccessful.


glam
11-14-2007, 01:33 PM
<window id="progresswindow" name="progresswindow" haswindowfocus="true" visible="false" x="350" y="330" height="70" width="150">
<view id="box" name="box" height="30" width="10" bgcolor="blue" />
<text y="3" align="center">loading...</text>
<handler name="onvisible">
this.box.setAttribute("width", "10");
this.box.animate('width', 140, 10000, false);
</handler>
</window>


I have a window that's not visible. Every time a button is pressed, this window will be set to visible as those components are loaded. The view 'box' with a blue background will be animated to increase it's width, which will make it look like it's showing the status of the new components being loaded. I try to set the 'box' width back to 10 every time the window becomes visible and have it animate from there. But of course... it's not working. Any ideas?

Thanks.

senshi
11-15-2007, 11:11 AM
You need to change at least this:

this.box.setAttribute("width", "10");


to that:

this.box.setAttribute("width", 10);

glam
11-16-2007, 05:00 PM
Thanks. I hate those little things. :o

bhavana V
06-23-2008, 11:35 PM
Hey Glam,

I have used your code to create progress bar and i have added some more code to it and it is working fine.


Thanks Glam


Regadrs

Bhavana