Title: SUCCESS with scrolling text in Acrobat 5!

With MUCH help from Norman Leonard, I was able to create a scrolling text area in Acrobat 5 -- controllable with buttons!


I'll do my best to recap how it's done:

THE SCROLLING TEXT AREA
> For the text area that will scroll, lay out the text in a program (Quark, etc.) and create a pdf. Use it as the icon image in a button field.

Set the button field properties to: read only, never scale, and set the icon placement coordinates to (50,100)


THE SCROLL BUTTONS
> SCROLL UP BUTTON - use a form field button. Place the following _javascript_ actions on mouse enter and mouse exit.

Place this script on mouse enter:
ScrollUp();
function ScrollUp(){
global.SU=app.setInterval("DoScrollUp()", 50);   }   //The higher the number, the longer the interval.
function DoScrollUp(){
var f=this.getField("YOUR SCROLLING TEXT BOX NAME");
global.BAlignY=f.buttonAlignY;
if (global.BAlignY<100){
    f.buttonAlignY=(global.BAlignY+1);  //here, we are scrolling 1% of the total scrolling area. This number must divide into 100 evenly (100%)

}else{
if (global.BAlignY==100){
    f.buttonAlignY=100;
    app.clearInterval(global.SU);
    delete global.SU; delete global.BAlignY;
}}}


Place this script on mouse exit:
try {
app.clearInterval(global.SU);
delete global.SU; delete global.BAlignY;
}catch (e) {}


--------------------------

> SCROLL DOWN BUTTON - use a form field button. Place the following _javascript_ actions on mouse enter and mouse exit.

Place this script on mouse enter:
ScrollUp();
function ScrollUp(){
global.SU=app.setInterval("DoScrollUp()", 50);   } //The higher the number, the longer the interval.
function DoScrollUp(){
var f=this.getField("YOUR SCROLLING TEXT BOX NAME");
global.BAlignY=f.buttonAlignY;
if (global.BAlignY>0){
    f.buttonAlignY=(global.BAlignY-1);  //here, we are scrolling 1% of the total scrolling area. This number must divide into 100 evenly (100%)

}else{
if (global.BAlignY==0){
    f.buttonAlignY=0;
    app.clearInterval(global.SU);
    delete global.SU; delete global.BAlignY;
}}}




Place this script on mouse exit:
try {
app.clearInterval(global.SU);
delete global.SU; delete global.BAlignY;
}catch (e) {}


------------------------------

"JUMP" BUTTONS - to jump to beginning and ending of scrolling text area

> JUMP TO TOP BUTTON - use a form field button. Place the following _javascript_ actions.

Place this script on mouse up:
getField("YOUR SCROLLING TEXT BOX NAME").buttonAlignY=100; //pushes button icons up to the visual top




> JUMP TO BOTTOM BUTTON - use a form field button. Place the following _javascript_ actions.
Place this script on mouse up:
getField("YOUR SCROLLING TEXT BOX NAME").buttonAlignY=0;



-----------------------------------------------------------------
** Be sure to replace the "YOUR SCROLLING TEXT BOX NAME" in the scripts with the name you gave to the scrolling text box. If you have these scrolling text boxes on multiple pages, remember to give each scrolling text box a unique name, and adjust the scripts on each page to reflect the text box names accordingly.

-----------------------------------------------------------------

Hope that makes sense!
(Thanks again Norman)

-Karen




Reply via email to