Passing dynamic data into a function

Passing dynamic data into a function

Hi all,

is there someone how can help me? I am definitely stuck within this problem
I am quite used now (as beginner yet) to use e.data with my functions but now I want to go a step further as I have dynamic data to pass to a function.
I am working with Jquerys cookbook and there is the chapter „Passing Dynamic Data to Event Handlers“.
Yet, it seems I am too stupid to understand this :-(

I have in my case the following code (part of a simple (not for me;-) slider):

    $("#arrowForward") .click(function(e) { nextWorkChart = workChart + 1; EdgeStageJumper();} );
    $("#arrowBackward").click(function(e) { nextWorkChart = workChart - 1; EdgeStageJumper();} );

function EdgeStageJumper() {
…  
var comp = $.Edge.getComposition("work_" + nextWorkChart);
var stage = comp.getStage();
stage.getSymbol("Stage").play("Jump")

}
}

I helped myself here with a global variable changing on click either +1 or -1,
but it looks very unprofessional, I believe.

Instead I read that it would be done with trigger() and extra arguments, but as I said, too stupid…

Someone here how could help me?

Thanks a lot
Garavani