the1stMovement: Our Playground http://playground.the1stmovement.com the1stMovement: Our Playground Mon, 11 Feb 2008 01:13:50 +0000 http://wordpress.org/?v=2.1.2 en Newsletter: Special Collector’s First Edition http://playground.the1stmovement.com/misc/newsletter-special-collectors-first-edition/ http://playground.the1stmovement.com/misc/newsletter-special-collectors-first-edition/#comments Mon, 11 Feb 2008 01:13:50 +0000 Ming http://playground.the1stmovement.com/misc/newsletter-special-collectors-first-edition/

Not everyone had a great 2007. Take the Writers Guild of America for instance. Not one of their best years. By a long shot. Or Don Imus, Britney Spears or the NBA referees. None of these people can be said to have had a great 2007. We at The1stMovement, however, did. Our 2007 was superb. So what better occasion to debut our newsletter and to wish you an employed, racially tolerant, sane, non-mob tied and most of all, successful 2008?

Read more at http://www.the1stmovement.com/newsletter/feb2008.html

]]>
http://playground.the1stmovement.com/misc/newsletter-special-collectors-first-edition/feed/
Form Validation with RegExp in AS3 http://playground.the1stmovement.com/flash/form-validation-with-regexp-in-as3/ http://playground.the1stmovement.com/flash/form-validation-with-regexp-in-as3/#comments Wed, 07 Nov 2007 16:41:23 +0000 Ming http://playground.the1stmovement.com/flash/form-validation-with-regexp-in-as3/ RegExp is a new native class for ActionScript 3 that lets you work with regular expressions, which are patterns that you can use to perform searches in strings and to replace text in strings. Natively supported by many programming languages, ActionScript 3.0 implements regular expressions as defined in the ECMAScript edition 3 language specification (ECMA-262). Specifically for Flash or Flex development, RegExp will most likely be useful for any data validation or search and replace any string.

For example, you would like to verify a string contains the letters “AS”, you would do

[ftf auto=”true” h=”50″]var pattern:RegExp = /AS/;
trace(pattern.test(”AS3″)) //true[/ftf]

The regular expression to see if a string contains the letter “AS” is /AS/ (remember the ‘/’ before and ‘/’ after the expression), and the above function defines a new RegExp Object and test it against a variable called sString.

There are a lot more complicated regular expression syntax, you can start from the Adobe AS3 LiveDocs here to learn more. Here’s a class we made to do simple form validation for AS3:

[ftf]/**
* Various Validation Methods for Forms
* @author Ming Chan (ming_chan@the1stmovement.com)
* @version 0.1
* @usage var formValidation:Validation= new Validation();
trace(formValidation.isValidName(”Name”))

*/

package com.the1stmovement.form {
public class Validation {
public function Validation() {
}
/**
* Validate not empty - has at least one non-whitespace character
* @param sString
* @return true or false
*/
public function isNotEmpty(sString:String):Boolean{
var pattern:RegExp = /^\S{1,}$/
return pattern.test(sString);
}
/**
* Validate Name - The name can contain only alphabets(in either case) and should be of minimum length 3 with no maximum characters. Only white spaces are allowed apart from alphabets.
* @param sName:String Name
* @return true or false
*/
public function isValidName(sName:String):Boolean{
var pattern:RegExp = /^([a-zA-z\s]{3,})$/
return pattern.test(sName);
}
/**
* Validate US State - either in upper case or lower case 2 letter abbreviation
* @param sState:String State
* @return true or false
*/
public function isValidUSState(sState:String):Boolean{
var pattern:RegExp = /^(?:(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY]))$/i
return pattern.test(sState);
}
/**
* Validate US Zip code - match either a 5 digit ZIP code or a ZIP+4 code formatted as 5 digits, a hyphen, and another 4 digits. (34564-3342 or 90210)
* @param sZip:String Zip Code
* @return true or false
*/
public function isValidUSZip(sZip:String):Boolean{
var pattern:RegExp = /^\d{5}(-\d{4})?$/
return pattern.test(sZip);
}
/**
* Validate US Phone Number - allowing user to enter 10 digit telephone number with segments of number separated by hyphens, periods or spaces. Also braces allowed around area code. (213-123-1234 2131231234 (213) 123-1234 213.123.1234)
* @param sPhone:String Phone Number
* @return true or false
*/
public function isValidUSPhone(sPhone:String):Boolean{
var pattern:RegExp = /^(\([2-9]|[2-9])(\d{2}|\d{2}\))(-|.|\s)?\d{3}(-|.|\s)?\d{4}$/
return pattern.test(sPhone);
}
/**
* Validates 1 or more email addresses. Email addresses can be delimited with either comma or semicolon. White space is allowed after delimiter, but not necessary.
* @param sEmails:String email addresses
* @return true or false
*/
public function isValidEmail(sEmails:String):Boolean{
var pattern:RegExp = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*([,;]\s*\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*/
return pattern.test(sEmails);
}
}
}[/ftf]

]]>
http://playground.the1stmovement.com/flash/form-validation-with-regexp-in-as3/feed/
HD Video on Web In Action http://playground.the1stmovement.com/flash/hd-video-on-web-in-action/ http://playground.the1stmovement.com/flash/hd-video-on-web-in-action/#comments Fri, 12 Oct 2007 20:44:32 +0000 Ming http://playground.the1stmovement.com/flash/hd-video-on-web-in-action/ Sometime in the next few months, Adobe is expected to incorporate the H.264 codec in all Flash players with the general release of Flash Player 9. You can already download a beta version from Adobe Labs. The H.264 codec is part of MPEG-4 and is the codec that Apple uses to compress all of the video downloads on iTunes. Once H.264 is part of Flash, the quality of streaming video on the Web will roughly double at current bandwidth speeds.

Some video sharing sites already started implementing the player including Vimeo (http://vimeo.com/highdef)

]]>
http://playground.the1stmovement.com/flash/hd-video-on-web-in-action/feed/
FITC Hollywood 20% off http://playground.the1stmovement.com/flash/fitc-hollywood-20-off/ http://playground.the1stmovement.com/flash/fitc-hollywood-20-off/#comments Thu, 11 Oct 2007 16:49:59 +0000 Ming http://playground.the1stmovement.com/flash/fitc-hollywood-20-off/ Event highlights include:

  • 50 + presentations and panels
  • Presentations from Adobe, bigspaceship.com (Joshua Hirsch), Blitz (Ivan Todorov), Hello Design (David Lai) Trailer Park (Marcelo Guerra and Jason Seigler) and others
  • Pre-festival workshops
  • Free ‘Get A Job’ evening event
  • Parties and other networking opportunities

For event details, go to http://www.fitc.ca/hollywood, and enter “hotshop20″ to get 20% off

]]>
http://playground.the1stmovement.com/flash/fitc-hollywood-20-off/feed/
AIR Apps http://playground.the1stmovement.com/air/air-apps/ http://playground.the1stmovement.com/air/air-apps/#comments Mon, 01 Oct 2007 16:53:10 +0000 Ming http://playground.the1stmovement.com/air/air-apps/ As expected, at the Adobe Max Event in Chicago, Adobe launched a Beta 2 release of their AIR application, along  with many good looking AIR apps including:

and more here

]]>
http://playground.the1stmovement.com/air/air-apps/feed/
Free As3 Training Class in 10 cities http://playground.the1stmovement.com/misc/free-as3-training-class-in-10-cities/ http://playground.the1stmovement.com/misc/free-as3-training-class-in-10-cities/#comments Thu, 20 Sep 2007 07:23:30 +0000 Ming http://playground.the1stmovement.com/misc/free-as3-training-class-in-10-cities/ Renowned Flash Instructor and author of the “Essential Actionscript 3.0″ Colin Moock is doing an intensive full day of AS3 Training in 10 cities including San Francisco, Los Angeles, New York, Tokyo, London, and more..

Don’t miss it and go sign up now!  http://www.adobeas3tour.com/

]]>
http://playground.the1stmovement.com/misc/free-as3-training-class-in-10-cities/feed/
“The Interior” - New Internet Drama-Series http://playground.the1stmovement.com/viralmarketing/the-interior-new-internet-drama-series-in-private-beta/ http://playground.the1stmovement.com/viralmarketing/the-interior-new-internet-drama-series-in-private-beta/#comments Tue, 17 Jul 2007 16:46:42 +0000 Ming http://playground.the1stmovement.com/viralmarketing/the-interior-new-internet-drama-series-in-private-beta/ Back in the summer of 2006, Dreamscape Films approached us (the1stMovement) with a very unique idea: A drama-series broadcast exclusively online and furthermore, let the Internet users choose the casts. As Geert Heetebrij and Helmut Schleppi, founders of DreamScape Films, put it:

“Don’t scale the gates of Hollywood. Walk around them”

We were immediately hooked with the idea and after about a month of consultations, design and development, we launched the Interior Phase I in October 2006.

interiorphasei-custom.jpg

Along with that, we launched the world’s first completely open, online talent casting call for a drama series. For the next two months, hundreds of actors/actresses flocked to upload their audition videos online to The Interior YouTube group. And out of the hundreds of submissions, the top five were chosen by YouTube users and in December 2006, the 4 main actors/actresses for the drama series were casted online and off to shooting in the rainforests of Central America.

While they were in productions in rainforests, we launched Phase II of the Interior for the cast and crew to post blogs and behind the scene videos to share. And finally, after six months of preparations and productions, the first episode is available through invitation only on the Interior (http://www.theinterior.tv).

interior01-custom.jpg

(more…)

]]>
http://playground.the1stmovement.com/viralmarketing/the-interior-new-internet-drama-series-in-private-beta/feed/
Flash Player 9 (build 9.0.60.120) huge performance updates http://playground.the1stmovement.com/flash/flash-player-9-build-9060120-huge-performance-updates/ http://playground.the1stmovement.com/flash/flash-player-9-build-9060120-huge-performance-updates/#comments Wed, 13 Jun 2007 03:53:46 +0000 Ming http://playground.the1stmovement.com/flash/flash-player-9-build-9060120-huge-performance-updates/ The new Flash player Update 3 Beta 1 (build 9.0.60.120) has some of the biggest improvements I have seen. Download here.

Most notably, it has the new mipmaps support which will significantly improve the quality and rendering of bitmaps for Papervision 3D content. Another one that I am really excited about is multi-threaded video decoding, which means 1080p video is now possible and also full-screen mode with hardware scaling which leverages DirectX on Windows and OpenGL on OSX.

Read more here , and Full-screen mode HW here

]]>
http://playground.the1stmovement.com/flash/flash-player-9-build-9060120-huge-performance-updates/feed/
Adobe AIR Beta & on AIR Bus Tour http://playground.the1stmovement.com/misc/adobe-air-beta-on-air-bus-tour/ http://playground.the1stmovement.com/misc/adobe-air-beta-on-air-bus-tour/#comments Mon, 11 Jun 2007 05:35:39 +0000 Ming http://playground.the1stmovement.com/misc/adobe-air-beta-on-air-bus-tour/ http://labs.adobe.com/technologies/air/

Previously codenamed Apollo, Adobe launched AIR (Adobe Integrated Airtime). This version added HTML and AJAX support so you can create an .air application without Flash. The final version is expected to be released by end of the year.

Adobe is also taking a nationwide bus tour for developers all around the nation. The1stMovement will be attending the July 16th Los Angeles one. You can register here for free. Leave us a comment if you want to meet up during the event!

]]>
http://playground.the1stmovement.com/misc/adobe-air-beta-on-air-bus-tour/feed/
Six Ways to write more comprehensible Flash ActionScript Code http://playground.the1stmovement.com/flash/six-ways-to-write-more-comprehensible-flash-actionscript-code/ http://playground.the1stmovement.com/flash/six-ways-to-write-more-comprehensible-flash-actionscript-code/#comments Sat, 02 Jun 2007 00:37:31 +0000 Ming http://playground.the1stmovement.com/flash/six-ways-to-write-more-comprehensible-flash-actionscript-code/ I came across this article (six ways to write more comprehensible code) while reading the BigSpaceShip Blog. It is definitely a good read for Flash developers as I have seen my fair share of Flash designers claim to be “developers” and write absolutely unmaintainable code.

So I thought I would take the IBM article and apply it specifically for Flash actionscript coding:

1. Comments

Taken from point #1 from the IBM article:

Comment your code. Obviously. If you write a procedure, fail to comment it, and return to it a few months later to rework it (and you will), not having comments will cost you time. And time is your most valuable resource. Lost time can’t ever be replaced.

But commenting, like anything else, is a skill. You get better with practice. There is good commenting, and there is bad commenting.

You don’t want to write too much. Suppose you write comments for a function that, in the future, saves you ten minutes of time understanding your code. Great. But suppose your comments are so verbose that it takes five minutes to write them and then, later, five minutes to read them. Then you’ve saved yourself zero time. Not so good.

You don’t want to write too little, either. If code goes on for a page or two without something breaking down what’s going on, well, I hope that code is clear as crystal, because otherwise you’re wasting future time.

The only thing I would add to it is you can minimize the use of comments by making the code self-documenting by appropriate name choices and an explicit logical structure. i.e. a Function named “getCurrentDate” needs no comment whereas “doDate” would probably need some explanation on what the function actually does

2. Constants and Variables

Similar to point #2 in the article, I highly recommend clearly defining and differentiating variables and constants. Our naming convention has always been if it’s a constant, use all caps, i.e. nSCORE (a constant named score which is a number), whereas if it’s a public variable, nScore. To take it further, declare all the constants in one place, don’t do it within the functions, but in the Class Variable Definition. i.e.

class SomeClass {

public var nSCORE:Number= 100

….

}

(more…)

]]> http://playground.the1stmovement.com/flash/six-ways-to-write-more-comprehensible-flash-actionscript-code/feed/