View Full Version : Datechooser component (customise)

petter mikke
11-30-2006, 12:34 AM
I want to use a datechooser component to enable the user to chose a day and when that day its clicked triggers an event that loads a movieclip.

So how do i instruct the component to respond with an event when a day its clicked?

IŽll be most gratefull http://www.actionscript.org/forums/images/smilies/smile.gif
:) on your help on this function. thanks!

11-30-2006, 09:37 PM
from the help section:

This example, written on a frame of the timeline, sends a message to the Output panel when a DateChooser instance called my_dc is changed. The first line of code creates a listener object called form. The second line defines a function for the change event on the listener object. Inside the function is a trace() statement that uses the event object that is automatically passed to the function, in this example eventObj, to generate a message. The target property of an event object is the component that generated the event (in this example, my_dc).

// Create listener object.
var dcListener:Object = new Object();
dcListener.change = function(evt_obj:Object) {
var thisDate: Date = evt_obj.target.selectedDate;
trace("date selected: " + thisDate);

// Add listener object to date chooser.
my_dc.addEventListener("change", dcListener);

so instead of the trace statement... call a function or event to trigger instead.