问题
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