| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
CustomDispatcher |
|
|
| Method | Defined By |
|---|---|
|
CustomDispatcher()
Creates a new instance of the CustomDispatcher class. |
CustomDispatcher |
|
doAction(delay:int, repeat:int)
Initiates a timer. |
CustomDispatcher |
| Event | Defined By |
|---|---|
| All inherited events of the EventDispatcher class. | EventDispatcher |
| Constructor Detail |
|---|
|
CustomDispatcher () Constructor
public function CustomDispatcher() |
| Intializes a new CustomDispatcher instance. |
| Method Detail |
|---|
|
doAction(delay:int, repeat:int) This method will initiate creating the grid. |
Parameters
|
| Examples |
|---|
Create an Actionscript file and put the script from below. Name the file DispatcherTest.as. Create a new fla file and name it CustomDispatcher.fla. Place the fla and .as file in the same folder as the biz folder. In the Document class textbox add DispatcherTest. Then test the movie.
package
{
import flash.display.Sprite;
import biz.flashscript.events.CustomDispatcher;
public class DispatcherTest extends Sprite
{
private var myDispatcher:CustomDispatcher;
public function DispatcherTest ():void
{
myDispatcher=new CustomDispatcher ;
myDispatcher.addEventListener (CustomDispatcher.ACTION, detetcRoot);
myDispatcher.doAction (1, 1000);
}
private function detetcRoot (e:Event):void
{
if (root != null)
{
e.target.removeEventListener (CustomDispatcher.ACTION, createTextField);
trace (root);
}
}
}
}
|