# DateField Component to display in Dynamic textfield

**URL:** <https://forum.kirupa.com/t/datefield-component-to-display-in-dynamic-textfield/296006>\
**Category:** flash\
**Created:** [September 8, 2009, 4:32pm UTC](https://forum.kirupa.com/t/datefield-component-to-display-in-dynamic-textfield/296006 "2009-09-08T16:32:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![undertoad666](https://avatars.discourse-cdn.com/v4/letter/u/ea666f/32.png) [@undertoad666](https://forum.kirupa.com/u/undertoad666)\
**Post date:** [September 8, 2009, 4:32pm UTC](https://forum.kirupa.com/t/datefield-component-to-display-in-dynamic-textfield/296006/1 "2009-09-08T16:32:51Z")

</div>

I’ve seen different versions of this question but I can not find the specific answer I need to make this work.

Simply as I can put it, I drag a Datefield component on stage and then create a dynamic text field on stage. I’m looking for the actionscript to make the selected date from the DateField also appear in the dynamic textfield.

I’ve found the script to do this for a numeric stepper

var my\_nstep:mx.controls.NumericStepper;

var nstepListener:Object = new Object();  
nstepListener.change = function(evt\_obj:Object){  
myText.text = evt\_obj.target.value;  
}  
my\_nstep.addEventListener(“change”, nstepListener);

I’ve tried modifying this script to work with the datefield but all I can get to happen is for the dynamic textfield to say “undefined.”

If anyone can give me the correct actionscript to make this work for the datefield, it would be most appreciated.
