如何在动作脚本3中设置/访问外部swf文件的动态文本字段?

时间:2013-08-22 07:07:44

标签: actionscript-3 flash fla

我在fla文件中工作,我添加了一个swf文件。

我如何在该swf文件的动态文本上设置文本。有没有直接设置文本。我不想在url中传递参数。

我试过这个

var rq:URLRequest = new URLRequest("subwindow/Time_date.swf");
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
ldr.load(rq);

function done(e:Event):void
{
   var externalSWF:MovieClip = MovieClip(e.currentTarget.content);

    // I have dynamic text field named dDate. I tried like this but got error
    externalSWF.dDate.text = "tdfdfd";       
    addChild(externalSWF);
}

我收到了错误

  

错误#1069:找不到属性dDate   Time_date_fla.MainTimeline_ 预加载器 _并且没有默认值。

请指教我

1 个答案:

答案 0 :(得分:3)

您在加载的swf中使用了TLF文字吗?

在Time_date.fla中转到file> publishSettings> actionScriptSettings> runtimeSharedLibrarySettings并将defaultLinkage更改为mergedIntoCode

您可以详细了解此问题here

希望这会有所帮助