Using Switch and Case

Following the samples from the Flash Docs you will have the following: ActionScript: switch (variable) {    case 0:    trace("Option0");    break;    case 1:    trace("Option1");    break;    case 2:    trace("Option2");    break; } But if … Continued

ActionScript Email Validation

Sooner or later you will face with the small quest of validating an email address for your flash application. The following script is a basic script and should not be used for websites that relay heavily on the email address … Continued

createTextField and removeTextField

ActionScript: createTextFieldOnce = function(){    trace("—> Text Field Created");    _root.createTextField("cMagnitude",this.getNextHighestDepth(),0,0,100,30);    cMagnitude.text = "Hello World"; }; deleteTextField = function(){    trace("—-> Text Field Deleted");    _root.cMagnitude.removeTextField(); }; createTextFieldOnce(); setInterval(deleteTextField,1000);

Loading a RSS feed into Flash

ActionScript: // create a new XML object var sports:XML = new XML(); // set the ignoreWhite property to true (default value is false) sports.ignoreWhite = true; // After loading is complete, trace the XML object sports.onLoad = function(success) {   … Continued

Removiing a Movie Clip on Stage with AS

ActionScript: //A square with id = square //A simple button named mca that removes the attached MCs this.attachMovie("square", "square1",1); this.attachMovie("square", "square2",2); square2._x =100; mca.onRelease = function() {  square1.removeMovieClip();  square2.removeMovieClip(); }