Any object that inherits (extends) DisplayObject such as a Sprite, MovieClip, TextField, etc... can dispatch events. One helpful trick, is to setup your own static constant variables to be used when Dispatching an event and listening to an event... this way No Typo's and it's intellisensed

In this example, we are dispatching a custom event, and also listening for it using the const "TEXTBOX_ADDED" which we also made as the Event String Name to use.
Code:
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
public class Gallery extends Sprite {
private var _textBox:TextField;
public static const TEXTBOX_ADDED:String = "textBoxAdded";
public function Gallery() {
addEventListener(TEXTBOX_ADDED, onTextBoxEvent);
_textBox = new TextField();
_textBox.text = "Hello world";
addChild(_textBox);
dispatchEvent(new Event(TEXTBOX_ADDED));
}
private function onTextBoxEvent(e:Event):void {
trace("textfield just got added!");
}
}
} You can also setup the event to "bubble" up which means it can keep transfering up the chain of objects, so your bottom-level element (a child within a child within a child) can fire/dispatch an event, and the top-level can hear it. The second optional parameter is a boolean for bubbles (if it should bubble or not):
Code:
dispatchEvent(new Event(TEXTBOX_ADDED, true));
The last parameter is cancelable - another boolean value - incase you would like you would like the event to be cancelable. So if your child wants to stop the bubbling to the top event, it can be cancelled before the top-level sees it... which is a nice addon
Code:
dispatchEvent(new Event(TEXTBOX_ADDED, true, true));
Events can also be setup to occur in a certain priority - as in X needs happen before Y which hppens after Z. Lots of nice additions with events in AS3 (Just another reason to switch from AS2)... Happy coding!