Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Animation progress bar

Status
Not open for further replies.

mickjbud

Programmer
Joined
Jun 13, 2002
Messages
48
Location
GB
Hi all

I am trying to draw a progress bar using the code below. I got this from livedocs however the settings for animation and the box around it were set to show at position 0,0. I can get the box centred on the movie however I cannot get the progress bar to start or finish within the box. I starts the progress bar at x position 0 no matter what I set it to in the lineTo argument.

Where am I going wrong?

this.createTextField("loaded_txt", this.getNextHighestDepth(), 10, 10, 160, 22);
this.createEmptyMovieClip("progressBar_mc", this.getNextHighestDepth());
progressBar_mc.createEmptyMovieClip("bar_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.bar_mc) {
beginFill(0xFFFFFF);
moveTo(90, 120);
lineTo(270 ,120);
lineTo(270, 130);
lineTo(480, 130);
lineTo(480, 120);

endFill();
}
progressBar_mc.createEmptyMovieClip("stroke_mc", progressBar_mc.getNextHighestDepth());
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0xffffff);
moveTo(90, 120);
lineTo(270 ,120);
lineTo(270, 130);
lineTo(90, 130);
lineTo(90, 120);
}


TIA

Mick
 
Correction on the previous message


with (progressBar_mc.bar_mc) {
beginFill(0xFFFFFF);
moveTo(90, 120);
lineTo(270 ,120);
lineTo(270, 130);
lineTo(90, 130); //changed x,y
lineTo(90, 120);//changed x,y
endFill();
_xscale = 0;//extra line missed
}
 
Solved.

I simply used the built in component called a 'Progress bar' the clues in the name, works a treat!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top