Best way to simulate action specific variables like XML / FileSet

I wrote some actions to parse JSON documents.  I want to have the actions behave in a maner similar to XML and FileSet variables, in that the variable gets defined and then subsequent actions manipulate the variable.  The solution that I used (and I would guess isn't quite right) is to create a hidden Option Property.

I tried using JavaScript variables, but scripts don't seem to persist.

Should I have used Context.SetVariable()? Is there a specific format or convention to prevent interference with project / user variables?

Would using Context.SetVariable in the OnValidate script work (since OnLoaded comments seem to indicate it shouldn't be used)?

Thanks

 Hi John,

 
What you're wanting to use is a 'project object', basically an object that is kept around longer then the execution of a single action, this is what the FileSet, XML, FTP, etc actions use. In the current version of FinalBuilder you can only create actions that define project objects by creating them as custom .NET actions. Attached is an example action + source of how to use a project object, please let us know if you have questions.
 
Regards,
Paul.
ProjectObject.zip (12.378 KB)

Thanks, I was able to transcode my previous attempt into a working set of actions using the code provided as an example.