How to set/access external swf file's dynamic text field in action script 3?

孤者浪人 提交于 2019-12-23 16:33:47

问题


I am working in a fla file where i added a swf file.

How I set a text on that swf file's dynamic text. Is there any to to direct set text. I don't want to pass as parameter in url.

I tried like this

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);
}

I got error

Error #1069: Property dDate not found on Time_date_fla.MainTimeline_Preloader_ and there is no default value.

Please advice me


回答1:


Are you using TLF text in your loaded swf?

in Time_date.fla goto file> publishSettings> actionScriptSettings> runtimeSharedLibrarySettings and change defaultLinkage to mergedIntoCode

you can read more about this problem here

hope this helps



来源:https://stackoverflow.com/questions/18373832/how-to-set-access-external-swf-files-dynamic-text-field-in-action-script-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!