knowledge.lapasa.net

Greater Toronto Area Flash Platform Developer Blog

List-at-a-time functions in AS3

TAGS: None

eokyere posted a pretty cool article/tips on how to make some of your AS3 code elegant in the case of applying functions to entire lists.
/*
For example, we have a list of donuts, and we want
to see which ones have chocolate, and then later
decide to take chunks of bites out of them:
*/

for (var i:Number = 0, n:Number = donuts.length; i < n; ++i)
if ((donuts[i] as Donut).hasChocolate())
v.push(donut[i]);

OR you can use Array’s filter function…

function choco(donunt:Donut):Boolean { return donut.hasChocolate(); }
var chocs:Array = donuts.filter(choco);

Very helpful read. It’s very easy to take for granted arrays and loops.

Link to eokyere’s blog entry on “Higher Order Actionscript” here.

Parlay is looking for Flash Developers

TAGS: None

Position Summary
Flash Developers will be responsible for integrating unique solutions within our Flash Gaming Suites. Parlay’s games use Flash front-ends to talk with Java servlet back-ends, this position will increase the size of our Flash development team. The position strongly emphasizes ActionScript programming, from core libraries to interface development. The position will be part of a team of 2-5 flash developers and 2-3 graphic designers of varying experience.

Key Responsibilities
- Assist in the creation and maintenance of Parlay’s suite of Flash games
- Integrate solutions within Parlay’s Gaming Suites
- Flash skill requirement is largely ActionScript and interfacing with Java and Web components

Required Skills and Competencies
- Competency in the use of all Flash IDE’s from Flash MX 2004 onward
- Extensive Flash ActionScript experience with AS1 and AS2 with a workable understanding of AS3.
- Familiarity with OO concepts, design patterns and is comfortable with implementing them for Flash applications
- Familiarity with HTML
- Must be flexible and able to work with AS1, AS2, and AS3 scripts
- Formal training in programming is a requirement
- 2-3 years related experience
- Strong written and oral communication skills

Definite Assets
- Proficiency in Photoshop, Illustrator, Sound and Video Editing Software
- Understanding of Java, XML, HTML, and other web technologies
- Gaming experience
- A College Diploma or University Degree in a technology field

At Parlay Entertainment, we’re putting a new spin on Internet gaming. Based in Oakville, Ontario, we pride ourselves in our casual yet professional work environment, where both clients and employees are highly valued and treated with respect.

Parlay is always searching for bright minds with big talent. Think you’ve got what it takes to get in the game? If you’d like to join a team that mixes business with pleasure every day, e-mail your resume with cover letter to: careers [at] parlaygroup [dot] com.

Please visit our website at http://www.parlaygroup.com/

Using the Flex Datagrid’s “labelFunction”

TAGS: None

Someone once asked me if they had a datagrid column that displayed millions, billions, and trillions of dollars, how could they render it in a non-numerical way so it would show as:

1,000,000 = 1 Million
1,000,000,000 = 1 Billion
1,000,000,000,000 = 1 Trillion

The other requirement is that it must still be in a numerical format to apply mathematical operations. Flex framework’s Datagrid component has a nice feature called “labelFunction” that lets you define your own custom label render so that you may apply your own rules. The following is one sample approach to the problem.




[Bindable]
public var myDataProvider:Array = [ 125000000.99,
1700000000.01,
984561321483.56,
0.99,
5.75,
31400000000.01];

public function myLabelFunction(item:Object, column:DataGridColumn):String
{
var amount:String = item.toString();
var dollars:String = amount.split(".")[0];
var dollarDigitCount:Number = dollars.toString().length;

var value:String;

if (dollarDigitCount >= 7 && dollarDigitCount <= 9)
{
value = dollars.slice(0, -6) + " Million";
}
else if (dollarDigitCount >= 10 && dollarDigitCount <= 12)
{
value = dollars.slice(0, -9) + " Billion";
}
else if (dollarDigitCount >= 13)
{
value = dollars.slice(0, -12) + ” Trillion”;
}
else
{
value = item.toString();
}

return “$” + value;
}
]]>





It looks like this:

© 2009 knowledge.lapasa.net. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.