using URLloader to place text from an external .txt file to an EXISTING text box
hi,
i'm web developer works using php html , css. however, having retrofit site client created in flash. have lot of flash experience using basic action script 1.5 animations , basic ui. in need of doing replacing areas of text exist in swf files dynamic text generated reading external.txt file. right can access external .txt file , use generate copy in test movie. big problem remains: having put existing text field can format appropriate existing movie.
here's actionscript:
var mytextloader:urlloader = new urlloader();
var mytextfield_txt:textfield = new textfield();
mytextfield_txt.wordwrap=true;
mytextfield_txt.autosize=textfieldautosize.left;
mytextloader.addeventlistener(event.complete, onloaded);
function onloaded(e:event):void {
mytextfield_txt.text = e.target.data;
addchild(mytextfield_txt);
}
mytextloader.load(new urlrequest("mytext.txt"));
makes text appear. i've tried name instance of text field mytextfield see if trigger go in there.
i'm lost.
alternatively, i'd settle creating new text field format.
help?
you want use:
:
var mytextloader:urlloader = new urlloader();
/*
var mytextfield_txt:textfield = new textfield();
mytextfield_txt.wordwrap=true;
mytextfield_txt.autosize=textfieldautosize.left;
*/
mytextloader.addeventlistener(event.complete, onloaded);
function onloaded(e:event):void {
your_existing_textfields_instance_name.text = e.target.data;
//addchild(mytextfield_txt);
}
mytextloader.load(new urlrequest("mytext.txt"));
to find your_existing_textfields_instance_name, should search (use movie explorer) textfield.
More discussions in ActionScript 3
adobe
Comments
Post a Comment