Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

JavaScripting linear fill

Avatar

Avatar
Level 2
mistersing
Level 2

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
mistersing
Level 2

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile
mistersing
Level 2

16-10-2008

Trying to get a linear fill, top to bottom, in a button or field using JavaScripting so I can change the colors when needed. Adobe documentation says it can be done, but is not clear as to how to get the desired result. Any ideas?

Thank you.

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-10-2008

Not sure what you mean can you elaborate?

Avatar

Avatar
Level 2
mistersing
Level 2

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
mistersing
Level 2

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile
mistersing
Level 2

16-10-2008

In a button or field you can use the following code to add a fill or background color:



fieldname.border.fill.color.value = "255,0,0";



I would like to be able to do the same thing with a top to bottom linear (gradient) background 2-color fill.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-10-2008

OK now I understand. You will have to setup your field with the appearance the way you want (i.e. Linear toBottom) with white to white before you run your script. This will give the same appearance as a normal field but it will put the neccessary nodes in the XDP to allow you to manipulate them. Once you do this you will need three commands to complete your change.



1. To set the style of the appearance:

TextField1.ui.textEdit.border.fill.linear.type = "to Bottom";



2. Set the color that you are fading to:

TextField1.ui.textEdit.border.fill.linear.color.value = "0,0,255";



3. Set the colro of the field that you are starting from:

TextField1.ui.textEdit.border.fill.color.value = "255,0,0";



Lastly you will need to put fous on the field to have your changes applied:

xfa.host.setFocus("TextField1");