Tips & Trix
A Handy Progress and Status Bar

Home
PUBz
Grafx Pax
Tips & Trix
Neo-Linx
Neo-Talk
Neo-Filez
Search NeoDezign
 
 

 


Have you ever wanted a Progress Bar representing the percentage completed for a task? A Status Bar indicating the task in progress? Easily done!
 

Progress Bar

Place a Title Text object on your page and in the Attributes give it a variable name such as [Progress]. Stretch and size the Text box across your page to your liking. Select a font like MS Sans Serif Bold and make the font color blue (or whatever color you like).

Then copy this bit of code into your action script...

SetVar "[Progress]" "•"
SetVar "[Progress]" "[Progress]•••"
SetVar "[Progress]" "[Progress]•••"
SetVar "[Progress]" "[Progress]•••"
SetVar "[Progress]" "[Progress]•••"
The "•" characters will appear as small blocks.

Next, insert actions in between the progress strings...

SetVar "[Progress]" "•"
SetVar "[Progress]" "[Progress]•••"
FileRead "data.dat" "1" "[source]"

SetVar "[Progress]" "[Progress]•••"
FileRead "data.dat" "2" "[destination]"

SetVar "[Progress]" "[Progress]•••"
FileCopy "[source]" "[destination]"

When you run your program the progress bar will fill from left to right as each action is executed.
 
 

Status Bar

In addition to the Progress Bar you can also add a Status Bar to your application. Place another Title Text object on your page and in the Attributes give it a variable name like [Status]. Stretch and size it so that it can accomidate a fair amount of text.

Now, add to the Action Script inserting descriptions of the tasks that are executing.
 

SetVar "[Progress]" "•"
SetVar "[Progress]" "[Progress]•••"
SetVar "[Status]" "Reading Source"
FileRead "data.dat" "1" "[source]"

SetVar "[Progress]" "[Progress]•••"
SetVar "[Status]" "Reading Destination"
FileRead "data.dat" "2" "[destination]"

SetVar "[Progress]" "[Progress]•••"
SetVar "[Status]" "Copying Files"
FileCopy "[source]" "[destination]"