You can declare a global variable and set the value in the after callback function. Here's some pseudocode to help you get the idea:
var curSlide;
$(window).load(function() {
$('.flexslider').flexslider({
after: function(slider) {
window.curSlide = slider.currentSlide;
}
});
});
function useCurSlideHere() {
alert(window.curSlide);
}
Although ideally you'd avoid using a global variable and you could make the useCurSlideHere function into a class which you create an instance of on window.load and use it when you pass the curSlide variable in the after callback function.
$(window).load(function() {
var customSlider = new useCurSlideHere();
$('.flexslider').flexslider({
after: function(slider) {
customSlider.setCurSlide(slider.currentSlide);
}
});
});
function useCurSlideHere() {
this.curSlide = 0;
this.setCurSlide = function(curSlide) {
this.curSlide = curSlide;
}
this.getCurSlide= function() {
alert(this.curSlide);
}
}
EDIT: Edited the answer to use slider.currentSlide.