eh... just trying something.
Quote:
|
Originally Posted by tg
so the all the code necessary to make it work is all in one place, and it is portable
|
I was under the impression that's what _global variables and functions are for. You define it once and it is accessible everywhere
Quote:
|
Originally Posted by tg
you would need to move all of the global funcitons also....
|
If your talking about the fact that declaring the same function more than once would cause problems, easily can be solved by putting the following into the component script:
ActionScript Code:
if(myGlobalFunction == undefined){
_global.myGlobalFunction = function(){
//bla bla bla....
}
}
Basically just think of it like this... you have a component but you don't want to have to refer to it relatively or absolutely throughout your code, (i.e. - _root.mc1.mc1_s1.myComponent.doSomething(); ), you just want to call the function from anywhere like a _global function