From AS3 to C#, Part 4: Abstract Classes and Functions

Tags: , , , , ,

Continuing from last time, this article begins covering features of C# classes that aren’t in AS3. We’ll begin with abstract classes and functions, which AS3 required workaround code to enforce even at run-time. Today’s article shows you how to use C# to cleanly enforce these at compile-time.

Read the rest of this article »

8 Comments

From AS3 to C#, Part 3: AS3 Class Parity

Tags: , , , , , , , ,

Picking up from last time, today we’ll finish off classes in C# from an AS3 perspective in preparation for next week when we delve into all-new concepts that aren’t in AS3 at all. Read on to learn the C# way to implement getters and setters, final functions and classes, const variables, and packages.

Read the rest of this article »

4 Comments

From AS3 to C#, Part 2: Extending Classes and Implementing Interfaces

Tags: , ,

Let’s continue the From AS3 to C# series from last time by continuing to investigate C# classes from an AS3 developer’s point of view. Today’s article will cover class inheritance, interface implementing, and interface inheritance.

Read the rest of this article »

8 Comments

From AS3 to C#, Part 1: Class Basics

Tags: , ,

This article is for the AS3 developer who’s decided to switch to Unity and doesn’t know the first thing about programming in C#. It’ll walk you through the basics of C# to get you oriented and productive.

Read the rest of this article »

11 Comments

From Flash to Unity

Today marks a big change for JacksonDunstan.com and the Tip of the Week e-mail list. After writing about AS3, Flash, and AIR for five years and 317 articles, I’m going to start writing about C# and Unity3D. Today I have posted two articles. The first talks about why I’m switching from Flash to Unity and the second is the beginning of a series of transitional articles entitled From AS3 to C#. Read on for the first article.

Read the rest of this article »

48 Comments

Should You Bother Giving Variables a Type?

Tags: , , ,

Many modern strongly-typed languages have introduced a way for you to not have to type a variable’s type. In C#, you can use var instead of the actual type. In C++, you use auto. AS3 has a similar feature with it’s “untyped” type: *. In those other languages, var and auto are syntax sugar that the compiler replaces with the actual type. Will the AS3 compiler and/or Flash Player do the same for us? Today’s article finds out if it’s safe to skip the type and just use *.

Read the rest of this article »

7 Comments

Faster Functional Methods for Array and Vector

Tags: , , , , , , , ,

Four years ago I tested the functional programming-style methods of Array and Vector: every, filter, forEach, map, and some. In that article I showed that these functions are much slower than doing the same task through traditional loops. Today’s article seeks to improve the performance of the functional methods while retaining readability by using ASC 2.0′s [Inline] metadata. Can homemade versions of these functions beat the built-in ones from Adobe? Read on to find out!

Read the rest of this article »

No Comments

Making describeTypeJSON 50x Faster than describeType

Tags: , , , , , , , , , , , ,

The hidden describeTypeJSON function is faster than the XML-based describeType function by default, but we can make it even faster. Today’s article describe just how this is done and achieves a nearly 10x speedup!

Read the rest of this article »

No Comments

describeType vs. describeTypeJSON

Tags: , , , , , ,

flash.utils.describeType has been around since Flash 9 and is the standard way to find out interesting information about a Class type, including its metadata/annotations. However, there’s a hidden function called describeTypeJSON that provides an interesting alternative. Since describeType is notoriously slow, could describeTypeJSON be the speedy alternative we’ve been looking for? Today’s article puts them to the test!

Read the rest of this article »

7 Comments

The Right Way to Check An Object’s Type

Tags: , , , , ,

There are lots of ways to check the type of an object in AS3. These include the is operator, the deprecated instanceof operator, the constructor field, and a combination of getQualifiedClassName and getDefinitionByName. Which is fastest, cleanest, and most effective? Today’s article puts them all to the test to find out!

Read the rest of this article »

4 Comments