GoogleMaps introduces “StreetView”

0

Yesterday, Google introduced a new technology called “StreetView.” It allows you to see a panoramic view of any street that you want, from any location that you want! It allows you to:

  • View street level photographs (select cities)
  • Take virtual walks; pan, rotate and zoom
  • Explore cityscapes, landmarks, points of interest
  • Find shops, restaurants, parks, hotels and more

Although there aren’t many cities supported *yet*, more will be on the way. Brilliant work. See it here.

Oh, and in-case you were wondering how the data was collected, check out the company behind the technology, immersivemedia.com.

Animated Cursor

1

Hopefully things will slow down at work so I can get back to the tutorials. In the mean time, check out the best animated cursor I have ever seen (and I typically can’t stand most animated cursors). It was created by www.1-click.jp, but I hosted it here in-case they ever move it.

PowerCursor – Flash Tactile mouse cursor response?

0

Check this out:

“Tactile sensations like stickiness, roughness, pressure, volume or mass can be experienced in a graphical user interface without resorting to special force feedback devices. Powercursor uses a technique called ‘visually simulated force feedback’ to evoke the tactile experience.”

Pretty cool concept. Not sure how practical it really is, but I can think of a few creative uses and a couple of unique flash games that would be fun to use it in.  It’s all in AS2, but I doubt it would be very hard to port to AS3. Nice concept. Check out the examples here.

ActionScript 3 Data Structures

1

I’ve been longing to re-create the Zelda Arena game I created a while back in AS 3 (under a different title so I don’t get sued by Nintendo), and actually finish the project (feature-complete) and post it online where multiple people could go up against each other on a single server. My dreams for the game might be larger than my spare time allows (it seems like I don’t even know what ‘spare time’ means lately), but I think I’ll take a shot at it and see what happens.

In order to do it properly and write some decent AI, I’ll need some good Graph and Tree data structures written in ActionScript 3. I was about to pull out all of my old C++ code for these structures that I wrote back in college and port ‘em over, until I noticed Michael Baczynski of Polygonal Labs did all the work for me! He called it AS3 Data Structures for Game Developers and, so far, has included the following structures:

  1. Multi-Dimensional Arrays (2d and 3d, native)
  2. Queue
  3. Stack
  4. Tree
  5. Binary Tree
  6. Binary Search Tree
  7. Hash Table
  8. Linked Lists
  9. Heap
  10. Priority Queue
  11. Graph
  12. Bit Vector

Although I haven’t begun to use them extensively yet, all of the features that I desire seem to be there. The code looks pretty good, both from an efficiency and a design pattern point of view. Everything has ASDoc supported comments. He even has a nice tutorial on using the Tree Class and it seems he might be adding more tutorials later. Nice work Michael!

You can download the structures here:

ActionScript 3 Data Structures for Game Developers

FLV Video Player Review

2

I had reason to run a downloaded flv file on my local system today. I tried three different players in the following order:

  1. Flash Video Player by FlashGuru
  2. Apollo Flash Video Player by Mutationevent.com,
  3. FLV Player 1.3.3 by Martijn de Visser

The first two both installed just fine, but when I double clicked my .flv file, the respective player started up and then nothing happened. So I moved on from those players in about 30 seconds.

The third player by Martijn de Visser installed easily and played my flv file when I double clicked on it first try! It has a nice, very simple interface, with a couple of basic features (such as zoom 1x, 2x, load file, load url, etc). The player certainly is lacking in advanced features and the author is aware of this and created a spot to post your wishlist for v2 features. However, that was back in April ’06 and he hasn’t blogged much since then, so the project might be abandoned–I can’t tell. Either way, this basic player serves its purpose well. Download it here:

Download FLV Player 1.3.3 by Martijn de Visser

Tweener Transition CheatSheet

10

Have you ever wished you could have all of the different Tweener transition types (based on the Robert penner easing equations) on a single cheatsheet? I have too. So, I finally got around to making said cheatsheet. Enjoy.

TweenerTransitionCheatSheet.pdf

Tweener Transition Cheat Sheet

Seven2 Interactive & Spokane FPUG

2

I live and work in Spokane, Washington, USA. Recently, I’ve been dreaming of having a SFPUG (Spokane Flash Platform User Group); but after trying hard to hire some good Flash developers for my current employer (DigiDeal), I was convinced that all of the good Flash developers in my somewhat-smaller-city were already working with me…

And then, out of nowhere, in steps a company I had previously never even heard of, Seven2 Interactive. They’re a Spokane based outfit that has done some very nice work for some pretty big namers, such as Nintendo, MTV, Cingular, etc. I met up  with the two founders today, Tyler & Nick, over sushi. It seems like these guys are as cool as their company’s work is. The inside of Seven2′s office was very stylish–they even had three conference rooms named Rock, Paper, & Scissors–rad. Cool facility, cool view, and even a cool game room. It’s good to see impressive Flash & design work coming from Spokane.

My dream for having a SFPUG has been renewed. Anyone else in the area that’s interested? Drop me a comment…

Flash, UML & gModeler Review

4

I started looking for different UML tools today to use for my next project. I wanted something free. I remember seeing a couple done in Flash in the past, so I figured I’d try those out. I came across three of them:

  1. gModeler – Done by Grant Skinner and his team in Flash. Free to use.
  2. gliffy – Done in Flash. Does many other diagrams besides UML. Looks slick. But it’s only free to try (3 free diagrams).
  3. Saffron – Done by Samuel Agesilas in Flash/Apollo. Looks very nice, but it’s not out yet. I can’t wait to try it. If you read this Samuel, I would love to be on the private alpha!

So, I decided I would go with gModeler to see how it panned out. Here’s my review:

Strengths:

  • It’s free.
  • It’s very easy to figure out. Without any documentation, I was up and running in about 5 minutes.
  • It has most of the features I was looking for. I could create class objects, add properties, methods, and events. It has an “inspector” that allows for further details of the class such as method parameters and documentation. It was easy to link compositions, aggregations, dependencies, inheritance, etc.
  • It allows you to save your document online, or export/import the corresponding XML to and from your local machine (not directly, of course, since Flash doesn’t support direct saving of files, but it gives the XML which can be pasted into a text editor and saved locally).
  • You can zoom in and out.

Weaknesses:

  • The project was created in 2003. I think it may have been abandoned.
  • No undo command. This is by far my largest complaint; it really slows down overall productivity.
  • Tab focus is sometimes awkward. For example, when I was in the “inspector” adding parameters, I had the parameter name in focus and I wanted to specify the parameter type, so I pressed Tab. Although it applies a highlight to the Type field, it does the same to the “Short Description” field as well. I started typing, and it replaced my short description text. I tried to undo, but no such functionality.
  • It has a really slick code documentation feature, but it’s not up to date. It didn’t use ASDoc tags, such as @param.
  • The Inspector is something that I would access very often. It’s annoying that it takes two clicks to get to it. There should be a toolbar icon that gives direct access.
  • There were a few keyboard shortcuts that I discovered by randomly pressing keys, but I didn’t notice any documentation for what they are. Toolbar hints that list the shortcut would be very handy. It would also be nice if they were more consistent with the Flash IDE; for example, the arrow tool should be “v” instead of “1″.
  • You could not copy things by pressing [CTRL]+[C].

Overall Opinion:

It seems like it wouldn’t take that much to make this tool a great free tool that I would actively use. But, the current weaknesses are too great for me to consider using it for the long run. So, unless Grant and his team happen to make some updates, I’ll keep searching for a new, free, UML tool. Any suggestions?

Registered Socket Functions

0

Now that you know how to dynamically cast variables at runtime, we can create a very cool static class I dub RegisteredSocketFunctions. The purpose of this class is to allow any function to be “registered,” which, by doing so, allows global access to the function directly.

The goals of the RegisteredSocketFunctions class:

  • Any function in any class can be very easily “registered.”
  • Once registered, any function in any class can be executed, maintaining all parameter functionality.
  • Any implied or direct usage of the “this” expression in the executed function will be interpreted properly.

Here’s the API:
[as]
/**
* Adds a new function to the list of available socket function calls.
*
* @param sFName Socket function call string reference name.
* @param funcReference A Function reference to the actual function.
* @param thisObject A reference to the object that should be the “this” object when this function is executed.
*
* @usage RegisteredSocketFunctions.registerFunction(“myTestFunction”, myTestFunction, this);
*/
public static function registerFunction(sFName:String, funcReference:Function, thisObject:Object):void
[/as]

[as]
/**
* Removes a function from the list of registered socket function calls.
*
* @param sFName The socket function call that should be removed.
*
* @usage RegisteredSocketFunctions.unregisterFunction(“myTestFunction”);
*/
public static function unregisterFunction(sFName:String):void
[/as]

[as]
/**
* Executes a Function that was previously registered using registerFunction with the name sFName.
*
* @param sFName The string reference name of the function that is to be executed.
* @param argArray The optional list of parameters that should be executed with the function.
* @param thisObject The optional object to which the Function referenced by sFName is applied. The “this” operator for the executed function will be thisObject if thisObject is non-null; otherwise, it will be the thisObject specified when registerFunction was called.
*
* @return Returns whatever value (if any) is returned by the function being called.
*
* @usage RegisteredSocketFunctions.registerFunction(“myTestFunction”, [var1, var2]);
*/
public static function executeFunction(sFName:String, argArray:Array = null, thisObject:Object = null):*
[/as]

Example:

Let’s say you have the following class
[as]
package
{
import com.natejc.utils.communication.RegisteredSocketFunctions;

public class RSFTestClass
{
private var _sName:String;
private var _nAge:uint;

public function TestClass()
{
RegisteredSocketFunctions.registerFunction(“testFunc”, testFunc, this);
} // END CONSTRUCTOR

public function testFunc(sName:String, nAge:uint):String
{
this._sName = sName;
this._nAge = nAge;

trace(“Hey ” + _sName + “, I can’t believe you’re ” + String(_nAge) + ” years old!”;
return sName + String(nAge);
} // END FUNCTION testFunc

} // END CLASS TestClass

} // END PACKAGE
[/as]

Then any other class in any other function could execute testFunc by doing the following:
[as]
var s:String = RegisteredSocketFunctions.executeFunction(“testFunc”, ["Joe Mama", 90]);
trace(s);
// which traces:
// Hey Joe Mama, I can’t believe you’re 90 years old!
// Joe Mama90
[/as]

Caution:

This class is intended to allow execution of functions across a network (which we will be discussing further later). Although this may seem like a cool, time saving way to allow classes all over your code interact with each other, doing so is definitely poor coding practice. Just like in real life, a child should never have command over its parent ;) . Having said that, if your project is due in 1 hour and you don’t have time to write all of the event handling that you should write, well, congratulations; you just found a class that will encourage your bad habits…

Download: RegisteredSocketFunctions.as

Internet Anarchy over “Free Speech”

0

I’ve never seen anything like it before in my life. It’s a large scale internet revolt. In-case you haven’t yet heard, the hex code to break the HD-DVD encryption was publicized on wikipedia and digg (among other various places). Both places removed it. The result? Check out Digg’s home page as of about five minutes ago and then Digg’s home page as of right now:

Digg.com Revolt Digg.com Revolt result

It shut Digg down! It’s everywhere. It’s hidden all over Flickr in various images such as these:

Internet Anarchy kitten picture from Flickr Internet Anarchy cmd picture from Flickr

People are hiding it in tons of wikipedia articles that have nothing to do with it to make sure wikipedia can’t keep up. Someone even registered the domain name! It’s being blogged about everywhere in articles such as this.

My thoughts? I honestly wouldn’t even care except that I have never seen anything like this before in my life. The great strength of the internet is information sharing. The scary weakness of the internet is information sharing. In a matter of minutes (literally), this thing has spread so far no one can stop it. Is this actually a good thing? What if it was the “noc list” so-to-speak? What if it was the secret to your company’s livelihood (and therefore the source of your paycheck)? What if it was your personal bank account information?

I believe in freedom of speech and I love the concept of internet communities and information sharing, but there is obviously a line somewhere. Everyone would agree it is drawn before our personal bank account information, but not before freedom of the press to speak out against an oppressive government.

Where exactly is this line drawn? Be careful not to jump on a bandwagon too quickly without considering the implications…

The Aftermath:

After the revolt blew over, Digg.com founder Kevin Rose wrote: “…after seeing hundreds of stories and reading thousands of comments, you’ve made it clear. You’d rather see Digg go down fighting than bow down to a bigger company. We hear you, and effective immediately we won’t delete stories or comments containing the code and will deal with whatever the consequences might be. If we lose, then what the hell, at least we died trying.”

I respect Rose’s choice to fight it; although it would seem very sad to me if the company truly did ‘die trying’ to defend freedom of speech for the very users that were the cause of their downfall. More on the subject at Forbes

Tweener + Bezier + Zeh = Brilliance

1

Zeh, the brains behind Tweener, has done it again. One of the main goals of Tweener was to create a system designed to allow the creation of animations (be they simple or complex) very easily. This goal was definitely accomplished. However, designing something that is appealing to the crowd wishing for simplicity, often leaves the crowd looking for more power, in wanting. Furthermore, attempting to appease both crowds congruently, is often like getting a camel through the eye of a needle.

I never thought Brazil had camels, but Zeh just threaded the needle with one. Introducing, Bezier curves in Tweener. Check it out.

Dynamic Casting and * in ActionScript 3

2

This discussion is necessary in order to continue with our network programming lessons.

Casting (converting one variable type to another) in ActionScript 3 is very easy. The following code casts a uint as a String:
[as]var nNum:uint = 5;
var sNum:String = String(nNum);[/as]
But what if you don’t know what the variable should be cast as? For example, let’s say you have a client-server application. The server sends you an XML packet that contains the data for a variable and it tells you what the type of the variable should be with a written String expression. Your goal is to store this data in a variable of the proper type.

First, you have to know about the * (Special Type) operator. This can be used to create a variable that is “untyped.” For example, the following function can take any type of variable as a parameter:

[as]public function helloUntypedVariable(myVar:*):void
{
trace(“hello ” + String(myVar));
}[/as]
If you have an untyped variable you can determine which type of variable it is at runtime using the is operator:
[as]public function customTypeOf(dataObject:*):String
{
if (dataObject is uint)
return “uint”;
if (dataObject is String)
return “String”;
}

var n:uint = 5;
var s:String = “Hello World”;

trace( customTypeOf(n) ); // traces “uint”
trace( customTypeOf(s) ); // traces “String”
[/as]
It’s important to note that the “is” operator returns true for anything and everything that the variable in question is qualified to be. For example, the following code all returns true:
[as]var n:int = 5;
trace(n is uint); // traces “true”
trace(n is int); // traces “true”
trace(n is Number); // traces “true”
trace(n is String); // traces “true”[/as]
Even though n is of type “int”, it even returns true in the statement “n is uint” because the value is positive and therefore qualifies to be a uint.

Now we know enough to create our “CustomCaster” utility class. This static class has two purposes: to determine the most restrictive type of a variable (CustomCaster.customTypeOf) and to cast a variable as some other data type that can be specified at runtime (CustomCaster.customCast):

Download the latest version here.

Flash Network Programming via TCP/IP, part 2

0

Today, I give you a free utility class that handles everything you need to handle in order to establish a connection. Tomorrow, I give you the world a class that make it seem like you are calling functions directly on the server and visa versa.

Download the latest version of the ConnectionEstablisher class here.

Usage example:
[as]// To establish a new connection, do the following:
var _server:ConnectionEstablisher = new ConnectionEstablisher(“127.0.0.1″, 4500);

// To send data to the server, do the following:
var xmlPacket:XML =
2007
Toyota
Baja 1000 FJ Cruiser

_server.send(xmlPacket);[/as]

Flex SDK Goes Open Source

0

Although I went on a rant about Adobe yesterday, I really do like and respect the company–even more so today. If you haven’t heard yet, Adobe just open sourced the Flex SDK as of this press release. This is definitely a bold move. From the release:

“The definition and evolution of Flex has been influenced by our incredibly talented developer community from day one,” said David Mendels, senior vice president, Enterprise and Developer Business Unit at Adobe. “The decision to open source Flex was a completely natural next step. I am incredibly excited to deeply collaborate with the developer community on Flex, and further fuel its momentum and innovation.”

Now, although this would normally make sense to me, it doesn’t make half as much sense as it would for Adobe to have open sourced the FlashPlayer, which is not a direct source of income for them. The Linux community has been shouting loud for this to happen for some time now (with good reason, imho). If Adobe doesn’t want to support the FlashPlayer on Linux (which I *completely* understand and even agree with to some degree), they should just open source the FlashPlayer. Doing so would allow the community to create a better Linux player, integrate Flash content into more unique /non-traditional applications on any OS, and generally increase the spread of Flash content across all media platforms. Then, the demand for the ability to create Flash content would increase. If Adobe maintained the control of the applications used to develop the content that is used by these players, this would definitely increase their revenue. This seems like more of a “natural next step” then releasing the Flex SDK.

I say this only to question the true motives for going open source, not just to be another complainer. It doesn’t seem a complete coincidence that Microsoft Silverlight was officially released 11 days ago. But regardless of their motives, I tip my hat to Adobe for this bold move. Like Josh Tynjala talked about, there is definitely the possibility that people will be able to develop Flex and perhaps even Flash content without need for Adobe products. And although they will still have a monopoly on their FlashPlayer, this is not the product that brings in money for them.

In any case, I do agree that this will “further fuel its momentum and innovation.” Which, not so coincidentally, will help Flash platform development to remain more attractive than Silverlight (unless Microsoft follows suit). Way to go Adobe.

Go to Top