Help creating an Action button

Just to let you know, I am very new to working with Vassal Modules. I am not at the point where I can create a Module but I can modify them as needed. So far so good. But here is what I want to do, Create an Action button on the Main Map that will highlight, using a Layer image I crated, certain cards that have a certain prototype set.
I have defined a Prototype trait for the specific card and named it FTR.
I have defined that Trait under [Game Piece Prototype Definitions] and named FTR [Definition].
Under the FTR [Definition], I have created a Layer (Named: Highlight), that puts a Border around the card.

How can I create an Action button on the Main Map [Map Window] that when pressed will search the map for all cards that have Prototype: FTR, and activate the Border layer I created? What would be the entries for said Action button?
Is this even possible?

Thanks

What you want to achieve is possible.

One thing you may not have appreciated yet is that a Prototype Definition leaves no trace of itself in a running module. When you open the module each Prototype trait is replaced by the contents of its Prototype Definition, and that’s it.

To achieve your goal, add a Marker trait to the Prototype Definition with a name or value that unique to that Prototype. Then, in a Global Key Command button, you can specify that Marker in the Property name field to find the pieces that use the Prototype.

Here’s an example. This example assumes that you’ve put a Layer trait on the pieces, as you intend to do and that Layer responds to the Key Command doHighlight. In the example, the Marker is called prototype.

Note, I’ve used a Global Key Command button in preference to an [Action Button].(VASSAL Reference Manual) The later is more suitable if you wish to do compose several actions and effects into one button or if you need to qualify the action with a condition check. However, of itself an Action Button won’t interact with pieces directly.

Another - more straightforward - method to achieve Layer changes would take advantage of the Layer trait’s Levels follow expression value field.

Using this for your use case, you can control whether the Highlight Layer displays or not by using a Global Property specific to the Prototype. Implement the controlling button as a Change-Property Toolbar Button that toggles between the display/no display values (see sub-components of Global Property).