ドキュメントイベントをリッスンすることはできますが、コンポーネントをムービークリップにドロップしてムービークリップの参照を取得することはできないと思います。
ただし、最初に選択したムービークリップの参照を保存し、次にmcパラメータを設定してコンポーネントをステージに追加するコマンドを作成することもできます。
Buttonコンポーネントを使用した簡単な例を次に示します。コマンドgetは、選択したmcの名前であり、ボタンを追加し、mcの名前をボタン名として設定します。
var doc = fl.getDocumentDOM();
var mc = doc.selection[0];//get the mc
doc.selectNone();
//add the component
fl.componentsPanel.addItemToDocument({x:mc.x, y:mc.y}, "User Interface", "Button");
//setup parameter
//use this if you don't know the paramater's index in the list
setComponentValueByParamName(doc.selection[0],'label',mc.name);
//otherhise you can get away with
//doc.selection[0].parameters[2].value = mc.name;
//returns true if the param was found and value was set, otherwise returns false
function setComponentValueByParamName(component,param,value){
for(var i = 0 ; i < component.parameters.length; i++){
if(component.parameters[i].name == param){
component.parameters[i].value = value;
return true;
}
}
return false;
}
より良い画像を取得するには、 fl.componentPanel、ComponentInstance、およびParameterを確認してください。
HTH