logo
Currently Browsing: Flash

Molotov iScream and Nanobot Extreme Screenshots

logo

Hello all,

I, along with a handful of other classmates, was recently interviewed by Pat Peckham from The City Pages.  The interview focused on aspects of our WDMD major at school with respect to our Flash and interactive portion of the program.  I was very happy and appreciative of the interview and the time Pat took to hear us talk.  Following that, I put together some screenshots of the Molotov iScream (iPhone, Android), and a game I worked on over a year ago with Jeff Nehlsen and Joe Motacek called Nanobot Extreme.

As always, it’s a privilege and honor to be part of an awesome program at UWSP, and even better that our local community is curious about the things we do.

I felt like it would be a good opportunity to share the screenshots with you.  Enjoy and leave some comments!

(more…)

Flash Primitive Data Types

logo

ActionScript 3.0, like many other programming languages, contains a number of basic data types commonly known as primitives. ActionScript 3.0 contains five primitive data types, which is far less than other languages like .NET or Java.

Data Type

Function

String

A character or series of characters

Boolean

A value that is either true or false

int

Positive or negative whole numbers

uint

Positive whole numbers

Number

Positive and negative whole and real numbers

Strings

Strings are a very important data type in programming languages that support them. For instance, string value can represent a sentence, a phrase, a word, a letter, or a directory location in an application, all of which are vital to many applications developed.

  1. //declare a String, and assign a value to it
  2. var str:String = "This is a string.";
  3.  
  4. //trace the value of the String
  5. trace(str);

In the above example, when the value of String str is traced, the output will read This is a string.

Booleans

Booleans are a great way to evaluate whether a statement in code is true or not. A developer can program an application to do something whether or not a statement is true. For example:

  1. //declare an int with a value of 5 and boolean
  2. var five:int = 5;
  3. var bool:Boolean;
  4.  
  5. if (five > 6)
  6. {
  7.         bool = true;
  8. }
  9. else
  10. {
  11.         bool = false;
  12. }
  13.  
  14. //when comparing booleans, always make sure to
  15. //use two ‘=’ signs, otherwise you’ll set the
  16. //value of the variable to what you are trying
  17. //to compare. This is called a logical operator.
  18. if (bool == true)
  19. {
  20.         trace("This should actually be false. The value is 5, " +
  21.                   "greater than 6.")
  22. }
  23. else
  24. {
  25.         trace("The value of the int is 5.");
  26. }

The above code will set the Boolean value to false because the value of five is not greater than 6. After that, the second if statement checks to see whether or not the Boolean’s value is set to true or false. Seeing that the Boolean is false, it will return the trace statement in the else statement.

Integers, Unsigned Integers, and Numbers

Flash comes equipped with a small set of numeric data types that allow the flexibility for almost any developer. If a variable needs to store positive whole numbers, then one would use an unsigned integer to store the values. For whole numbers that are positive and negative, using an integer or Number would be ideal. The difference between integers and Numbers is that Numbers can also store real number values whereas integers only store whole numbers. Also, Number data types can store a headache inducing amount of data compared to integers and unsigned integers. Here’s a breakdown of numeric data type values in Flash

Data Type

Minimum Value

Maximum Value

integer

-2,147,483,648

2,147,483,647

unsigned integer

0

4,294,967,295

Number

4.9406564584124654e-324

1.79769313486231e+308

As you can see, Numbers are great for not only storing real numbers, but also for REALLY HUGE values. Remember, when programming, choose the numeric data type that’s the most ideal for the situation. For example, if you plan on storing numeric whole number values (positive or negative) that aren’t going to contain decimals, then you’re probably best off using integers. Any time decimals or real numbers in general are involved, use Numbers. When you are developing any type of application or animation, you have to keep system resources in mind to the best of your ability. By doing so, this ensures optimal performance on most computers.

As always, source code is available here.

How To Check for Dock Icon or System Tray Icon Support in Adobe AIR

logo

When creating Adobe AIR applications, one of the more important (and easily overlooked) things that people like is System Tray Icons (Windows) or Dock Icons (Mac) for simple user commands such as changing preferences in the application or exiting entirely.

One of the many advantages of using Adobe AIR is the cross platform support, but how does an application know if it’s running on a Windows or Mac platform in order to accommodate a System Tray or Dock icon for each respective environment? The development team behind Adobe AIR have conquered this problem for developers. Within the NativeApplication Class there’s two boolean properties to resolve this problem.  The boolean property supportsDockIcon is used to detect whether or not the native operating system supports Dock Icons (Mac) while the other, supportsSystemTrayIcon, is used for Windows based systems.

What can be done, is that an if-else if statement can be written to compensate for both environments.  In most cases, you’d want the logic in both parts of the statement to be similar, with the exception of the size of the icon.  This way, continuity and consistency is maintained between both platforms.

  1. if(NativeApplication.supportsDockIcon)
  2. {
  3.         //supports Dock Icons for Mac
  4.         //insert logic here
  5.         //examples: icon, menu options
  6. }
  7. else if(NativeApplication.supportsSystemTrayIcon)
  8. {
  9.         //supports System Tray Icons for Windows
  10.         //insert logic here
  11.         //examples: icon, menu options
  12. }

As you can see, the idea is pretty simple. If the boolean returns true, then the respective statement will execute.  If you would like this code expanded on, please let me know. I’d be more than happy to either update the post or write a follow up post on this topic.

Happy coding! icon smile How To Check for Dock Icon or System Tray Icon Support in Adobe AIR

Flash CS5 Code Snippets Panel Example

logo


This video demonstrates how to use the library of code snippets in the latest generation of Flash (CS5). The video showcases how simple it is to code an application without actually having to write the code.

The person narrating the tutorial has a somewhat strong accent, which may be slightly overbearing to some, but the information in this video is well worth the watch!

New Posts Are Coming!

logo

New posts will be up starting Monday. I’ve been very busy. Really, I have. Monday’s post will highlight some of what I’ve been up to.  Catch you on the flipside.

To keep you occupied, check out some of these videos about the upcoming Creative Suite (CS5) from Adobe:

Terry White’s 5 Favorite New Photoshop CS5 Features

Terry White’s 5 Favorite New Dreamweaver and Flash CS5 Features

Terry White’s 5 Favorite Flash Catalyst Features

Enjoy, kids.  See you soon.

Page 1 of 3123
logo
Powered by Wordpress. Copyright 2009 Brett Widmann.