2 Replies Latest reply: Oct 19, 2009 1:47 AM by Mike.Edel RSS

    (JavaScript, CS3) calling functions with arguments on click?

    Mike.Edel Community Member

      Hi all,

       

      this is getting tricky:

       

      I want to call a function when the user clicks on a button in my scripted application (a javascript window dialog).

      Unfortunately, I need to pass several arguments to the function.

       

      According to the scripting documentation, ".onClick" functions won't take arguments.

      I would (somewhat reluctantly) work with (global) variables but the function itself is limited to variables within its own scope - blocking all variables set in main()

       

      How should I approach this?

       

      The basic idea is to have people set some settings in the UI and then do some things after they click ok.

      The actual work is pretty complicated (replacing colors etc) and needs to be done to a lot of objects so it would make sense to do it in a function.


      I'm pretty confused right now and don't know how to proceed.

      Any hints are appreciated.

       

      Many thanks,

       

      Mike