Thank you for the reply, you were right. I thought that the fonction has to be defined before the load of all files, as the loading off all files takes more time , But I see that the callBack function is chacked before starting loading files as shown in the definition of require function :
Code:
/**
* Loads all classes by the given names and all their direct dependencies;
* optionally executes the given callback function when finishes, within the optional scope.
*
* {@link Ext#require Ext.require} is alias for {@link Ext.Loader#require Ext.Loader.require} for convenience.
*
* @param {String/String[]} expressions Can either be a string or an array of string
* @param {Function} fn (Optional) The callback function
* @param {Object} scope (Optional) The execution scope (`this`) of the callback function
* @param {String/String[]} excludes (Optional) Classes to be excluded, useful when being used with expressions
*/
require: function(expressions, fn, scope, excludes) {
var filePath, expression, exclude, className, excluded = {},
excludedClassNames = [],
possibleClassNames = [],
possibleClassName, classNames = [],
i, j, ln, subLn;
expressions = Ext.Array.from(expressions);
excludes = Ext.Array.from(excludes);
fn = fn || Ext.emptyFn;
scope = scope || Ext.global;