Helmut Granda

learning through interaction

Category

ActionScript

Short hand for If Statement

a = b ? true : false; a == b ? (true1, true2) : false

Error in supported CSS properties in Flash

So actually there is not an error in the way the CSS properties are handled within Flash, if you area always in the run trying to get things done you will notice that the first column in the Flash Help… Continue Reading →

Using Switch and Case

Following the samples from the Flash Docs you will have the following: [as]switch (variable) { case 0: trace(“Option0″); break; case 1: trace(“Option1″); break; case 2: trace(“Option2″); break; }[/as] But if you are about to test against a string variable instead… Continue Reading →

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… Continue Reading →

Never Understimate the power of MovieClips used as Graphics

When the time comes when you have to develop the same set of animations for different sets and different sizes don’t forget to use your MovieClips as Graphics, this is a great way to save work for everyone. Not only… Continue Reading →

createTextField and removeTextField

[as]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);[/as]

Loading a RSS feed into Flash

[as]// 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) { trace(sports); };… Continue Reading →

Removiing a Movie Clip on Stage with AS

[as]//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(); }[/as]

© 2014 Helmut Granda — Powered by WordPress

Theme by Anders NorenUp ↑