How do I create a button & assign a value to a text box within it, in actionscript?
Can I create an instance of a button from the library dynamically?
How do I create a button & assign a value to a text box within it, in actionscript?
Can I create an instance of a button from the library dynamically?
hi!
i 'have been doing this in a million ways, and not working!
The thing is that i could only make it work if creating the text field inside the button by action script, eve if the button allready has a instance name!
It allways says “undefined” value.
Does anyone knows why?
example:
with (this.bt) {
txtField.text = “some text”;
}
// does not work! retrieves undifined value!
with (this.bt) {
this.createTextField(“asd”,1,0,0,20,16);
asd.text = “some text”;
}
// works this way
[quote=EyEpOkEr;2111909] [COLOR=seagreen]Succesful solution [/COLOR]- encapsulate the button & text in a move clip. Dupe the clip as many times as needed. The movie clip consists of a blank button (no text) on one layer and a dynamic text field on another layer. use AttachMovie to dupe this movie clip and you will be able to succesfully update the contents of the text field and the button will still work. The bonus is that you only need to position the encapsulating movie clip and not the button and text individualy.
dynamicMovieClipInstanceName.dynamicTextFieldVarName = arg;
FlashMX 2004, WindowsXP SP2[/quote]
I was wondering if you could explain this part.
dynamicMovieClipInstanceName.dynamicTextFieldVarName = arg;
I would like to use it but I’m not sure how to use it.
:: Copyright KIRUPA 2024 //--