AS3 Email Validator using regexp

Posted in Software Development on October 17th, 2008 by Russ Tarleton

Quick and dirty way to validate email addresses:
http://www.stimuli.com.br/trane/2007/sep/13/email-validation-actionscript-3/

Here’s my short version:

public function isValidEmail(pEmail : String) : Boolean
{

var emailRegexp : RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i;
return Boolean(pEmail.match(emailRegexp));

 

}

Motorcycle Safety Class

Posted in Updates on October 17th, 2008 by Russ Tarleton

I think the best way I’m going to be able to memorize these acronyms for the written test tomorrow is to write them down myself. These are the important ones so far:

T-CLOCS (Pre-ride Inspection Procedure)

  1. Tires
  2. Controls
  3. Lights
  4. Oil
  5. Chassis
  6. Stand

FINE-C (Startup Procedure)

  1. Fuel
  2. Ignition
  3. Neutral
  4. Engine
  5. Choke (on cold day) and Clutch

SEE (Riding Checklist)

  1. Search
  2. Evaluate
  3. Execute

New Electric Porsche

Posted in New Technology on October 10th, 2008 by Russ Tarleton

The actual vehicle is based on a Porsche 911, not the Cayman as previously reported. Powered by a three-phase electric motor that offers about 200 horsepower along with an impressive 480 lb.-ft. of torque, the eRUF Model A can reportedly hit 60 miles per hour in under seven seconds and can reach a top speed of 160. Power comes from a lithium iron phosphate battery pack, which produces 317-volts and 480-amps and is made up from 96 individual cells. A full charge takes a rather long 10-hours, and regenerative braking is included in the package allowing for a range of up to 180 miles.

http://www.autoblog.com/2008/10/10/rufs-electric-porsche-breaks-cover/

Who plays, how much, and why?

Posted in Sociology on October 7th, 2008 by Russ Tarleton

The Journal of Computer-Mediated Communication has published an article based on survey results from 7,000 gamers who play the game Everquest 2. The intro mentions that 40% of adults are now regular “gamers”, compared to 83% of teenagers. Those numbers are staggering to think about. I thought some of the questions posed in the conclusion were also pretty interesting: “Why, for example, are older female players playing at the highest rates? Why are older players playing more when younger people are thought to have more free time? Why are these gamers physically healthier than nongamers? Why do minorities play at lower rates?” Definitely an enlightening read if you have the time.

Abstract:

Online games have exploded in popularity, but for many researchers access to players has been difficult. The study reported here is the first to collect a combination of survey and behavioral data with the cooperation of a major virtual world operator. In the current study, 7,000 players of the massively multiplayer online game (MMO) EverQuest 2 were surveyed about their offline characteristics, their motivations and their physical and mental health. These self-report data were then combined with data on participants’ actual in-game play behaviors, as collected by the game operator. Most of the results defy common stereotypes in surprising and interesting ways and have implications for communication theory and for future investigations of games.

http://www3.interscience.wiley.com/cgi-bin/fulltext/121394419/HTMLSTART?CRETRY=1&SRETRY=0

Getting the AS3 ScrollPane Component to automatically scroll to the bottom

Posted in Software Development on October 1st, 2008 by Russ Tarleton

Here’s my updated AS3 method that forces the ScrollPane to scroll all the way to the bottom in order to show the newest entry. It’s important to remember that there is a delay in AS3 after doing an addChild() call so this method should only be called after you can ensure your new dynamic content has been added to the ScrollPane source via an addedToStage listener or checking loop.

import fl.containers.ScrollPane;
public function updateScroller() : void
{

/*
Pre-Conditions:
1. scrollContainer is an instance of ScrollPane on the stage
2. commentContainer is a movieClip containing dynamic content on the stage
3. All Elements to be added have finished being added to commentContainer
*/

scrollContainer.source = commentContainer;
scrollContainer.update();
scrollContainer.verticalScrollPosition = scrollContainer.maxVerticalScrollPosition;

}