"E Michael Brandt" <michael@valleywebdesigns.com> wrote
in message
news:fb3rqv$qv3$1@forums.macromedia.com...
>
> If you read the Extension help you'll see that certain
functions are
> indeed required by each type of Extension, whether
Behavior, Command, or
> Object. And certain methods are disallowed by each type
as well.
>
Yes i have the manual in front of me, i'm building a behavior
to call
commands in the AIR runtime, the air object is just available
in the
document when the AIRAliases.js is included, it doesn't need
a "helper"
function.
So what i'm doing now is inserting a proxy function to call
the original
function, return the name of the proxy function from
behaviorFunction and
wrap the call, that just seems like a lot of overhead.
Joris
function AIR_exec(cmdName) { //v1.0
if(typeof air != 'Object'){
alert('ERROR: AIR object not loaded, please include
AIRAliases.js');
} else {
var cmd = 'air.'+cmdName+'(';
for(var i=1; i<arguments.length; i++){
cmd += (i==1) ? arguments
: ','+arguments;
}
cmd += ')'
eval(cmd);
}
}
//Return the name of the function that we want to be inserted
into the
user's document.
function behaviorFunction(){
return "AIR_exec";
}
//Returns the actual function call string that will be
inserted into the
event handler
function applyBehavior() {
addAIRAliases();
return
"AIR_exec('trace',"+document.theForm.traceMessage.value+")";
}