This might be a silly question. Is there a another way to do it? (in java script)
EDIT!!!
This is my main problem.
in script A I use this code.
gameObject.AddComponent("B");//Add script name B
in script B I use this code.
var weapon:GameObject;//and I drag prefab name missile to this script.
The problem is. When I run the game. It add script name B as it should be,but in script B variable weapon is empty, not prefab name missile as it should be.