This blog has moved to a new location! http://iqandreas.github.com/

Sunday, April 25, 2010

Getting started with Flash Player 10.1

Flash Player 10.1 added several neat multi-touch, gesture, and accelerometer input features. There are several more neat features of the new Flash Player, but the new input controls are what I find the most captivating (that, and global error handling, FINALLY!). The rest can be found on Adobe's website:
AdobeLabs - Flash Player 10.1 Features and Enhancements

Adobe really put a lot of effort into getting the newest version of Flash Player to work on numerous devices, naming this project the "OpenScreen Project". Quoting Adobe - "With support for a broad range of mobile devices, including smartphones, netbooks, smartbooks and other Internet-connected devices, Flash Player 10.1 allows your content to reach your customers wherever they are." [side note - sadly, iPhone support was shot down]


Flash Player 10.1 is still in the "prerelease stage", meaning it is not released as an "official" or currently updated version just yet. I'm not sure if bugs are being ironed out, or if Adobe mainly wants to wait until Flash CS5 is out. However, the new player is still available for developers who want to test out the new features.

So far, FP 10.1 seems to be working just fine for my every day uses, and haven't run into any major bugs yet. In fact, (since I'm in Linux still) the old Linux Flash Player (version 10.0.45.2) had several bugs which were never ironed out, and according to several Google results were quite common. However, with the new version, those bugs seem to be gone (at least so far):
[Solution] Flash sound stops working in FireFox on Linux Ubuntu 9.10
[Solution] Adobe TV crashes FireFox on Linux Ubuntu 9.10


Since 99.8% of your site/application/game users won't have version 10.1 installed, I really don't recommend using it for your sites just yet. However, if you have a phone or computer with multi-touch capabilities it might be fun messing around with the new features. In addition, if you read up on the classes and functions enough now, by the time it is fully released, you can be first in line when clients are looking for the newest features for their product.


So, where do I get started?

FIRST, you need to download the actual Flash Player 10.1. As with Flash 10, the browser and standalone versions are two different things, so if you update the browser player to 10.1, the standalone player will still be the old version and vice versa, so unless you plan on keeping the old player for any specific reasons, remember to update them both.

There is also a difference between the debug version and the regular version. Basically, the debug version is good if you do a lot of testing, since the error messages show up as dialogs, along with several other features not available in the "regular" release of the Flash Player. Otherwise, errors are silently ignored, which is good for regular users, but really annoying if you can't get your code working right, and you are having a hard time figuring out what's going wrong and where.

All versions of the player can be downloaded here:
http://labs.adobe.com/downloads/flashplayer10.html


THEN, all you need to do is download the new SWC library with all the new classes. I'm pretty sure they are just the "shells" for the classes which expose all functions and properties rather than contain actual code, just as the ActionScript files for MovieClips don't contain the actual code for them, but just expose functions to allow code hinting etc for developers. [a VERY good read on the matter]

I was worried I would need an updated compiler, but to my joyous surprise, you can still keep using Flash Professional, Flex Builder, the Flex SDK, or whatever compiler you use without any modifications. There should be dozens of tutorials on importing SWC libraries into your current editor, but if you can't find anything relevant, ask in the comments section, and I will lead you in the right direction. Don't forget to post what type of IDE you are using (Such as Flash Professional CS4 or FlashDevelop etc).

The SWC can be downloaded on the same page as the Flash Player (how convenient)
http://labs.adobe.com/downloads/flashplayer10.html#pgswc


Downloaded and ready! Teach me how to use it!

Sadly, I don't have any tutorials for it (I don't have a touchscreen or even a mobile device newer than 10 years old) but several others out there have already put up tutorials for FP 10.1 development.

gotoAndLearn - Multi Touch Gesture Applications
Multi Touch in AS3 / Flash Player 10.1 - Part 1. Setting Up
Multi Touch in AS3 / Flash Player 10.1 - Part 2. TouchEvent & MouseEvent Sequences


I'm in need of a lot more tutorials and examples, so if you know of any other good sources, or have written any good tutorials yourself, just leave a link in the comments section! :)


Some further reading

As always, I am never the first to write about things, so here are some helpful links which hopefully helps someone out there.

Adobe Labs - Adobe Flash Player 10.1
Introducing Adobe Flash Player 10.1 public prerelease
Flash Player 10.1 prerelease software demos and interviews
Adobe TV - Multi-touch capabilities of Flash Player 10.1
Kirupa Forums - Disappointing FP 10.1 First Impressions
TourDeFlex - according to Adobe, some examples should include some FP 10.1 features as well. Still very neat if you haven't used it before!


Good resources for FP 10.1 development

Keep these links in your toolbox. They usually come to use quite a bit:
ActionScript 3.0 Language Reference (with updates for Flash Player 10.1)
ActionScript 3.0 Developer's Guide (also with FP 10.1 updates)
Adobe Forums - Flash Player 10.1
Adobe Bug tracking and management - On case you do find anything wrong with the new version. When submitting, remember to check for existing bugs, as chances are you aren't the first person ever in the world to run across that bug. ;)



If anyone has any demos of what they have accomplished with the new features in FP 10.1, leave a comment and share your work with others (source code is appreciated, but not required). I will provide the SWF hosting if you require it.

Tuesday, April 13, 2010

"Go screw yourself Apple" — Lee Brimelow

"Go screw yourself Apple" — Lee Brimelow

Instead of just adding to the oodles of posts out there on Apple's recent move with just another long hateful rant, I will just add my two cents in little paragraph, as well as a few good reads on the matter.


What are you talking about?

Okay, let's start from the beginning.

In the past, to develop iPhone apps, users had to download the "free" (note the quotes) SDK from Apple, which ONLY runs on MAC. In addition, developers had to pay $99 per year to Apple and join the "iPhone Developer Program" in order to publish their apps to the store. The only way to put iPhone apps onto your iPhone is via the apps store (unless you jailbreak the phone, but that may void your warranty)

This was the only way to develop games and applications on the iPhone, and some companies would offer to port the games for a fee.

On October of 2009, at the Adobe MAX conference, Adobe announced that Flash Player CS5 will have the ability to export Flash games and applications to a format that can run natively on the iPhone. Natively means no slow interpreters or emulators, but direct compiling to the iPhone's bytecode. [Ryan Ragona's comprehensive blog post, Lee Brimelow's video, and Adobe's official iPhone apps site]

The compiler upgrade in CS5 was VERY exciting for developers, as not all developers have the time or money to port all their games to the iPhone format or go through each line of code and translate it to Objective-C.


Wohoo! Now even I can make iPhone games!

Not so fast, I haven't come to the bad news yet.

Early April 2009 Apple announced that it is illegal (or whatever legal term they used) to compile your iPhone applications using any other tools then their SDK.

Sunday, April 11, 2010

[Solution] Flash sound stops working in FireFox on Linux Ubuntu 9.10

If you leave the browser open for too long, pretty soon all Flash content on all sites will no longer give off any sounds. Luckily, the fix was easy, just restart FireFox and you will be good as new. However, it still gets REALLY annoying, especially when you have 25+ tabs open (maybe that's what was causing the sound problems after too long?).

This would happen on a completely clean LiveCD system as well as the full installation with the following specs:
Ubuntu Linux 9.10
FireFox 3.5.8 with no extra add-ons installed
Flash Player 10.0.45.2


Instead of debugging and finding the source of the error, I took the easy way out and installed Flash Player 10.1 (currently in Beta I believe?)
http://labs.adobe.com/downloads/flashplayer10.html

I have been running FP 10.1 for almost two weeks now, and still haven't had any sound problems. :)


I could file a bug report for these old problems, but considering how much Adobe ignores Linux users, I doubt they would go back and update Flash Player 10.0 for these fixes. Instead, I'll file bug reports only if I receive problems in the new version.

See also blog entry Adobe TV crashes FireFox on Ubuntu 9.10

Wednesday, April 7, 2010

[Solution] Adobe TV crashes FireFox on Linux Ubuntu 9.10

I have no idea why, but whenever I would access AdobeTV, as soon as the video started loading, FireFox would freeze up and need a restart. Every single time.

This would happen on a completely clean LiveCD system as well as the full installation with the following specs:
Ubuntu Linux 9.10
FireFox 3.5.8 with no extra add-ons installed
Flash Player 10.0.45.2


Instead of debugging and finding the source of the error, I took the easy way out and installed Flash Player 10.1 (currently in Beta I believe?)
http://labs.adobe.com/downloads/flashplayer10.html


Perhaps the new Flash Player version will also fix some other issues I have had:
  • Playing sound stops working completely, and needs a browser restart in order to work again  [Yep. Fixed!]
  • SWF projects using computeSpectrum will not work (the sound plays, but it doesn't do anything on the stage)  [Hm... Still seems to not work...]
  • In the standalone Debug version of the player, even if you hit "Dismiss All", some errors will show up again, and no matter how fast you dismiss the errors, the dialog will keep popping up, forcing you to kill FlashPlayer manually  [No problems so far] 
  • Constant "flickering" between layers when playing games or apps with several layers  [Problem persists even in FP10.1]

I could file a bug report for these old problems, but considering how much Adobe ignores Linux users, I doubt they would go back and update Flash Player 10.0 for these fixes. Instead, I'll file bug reports only if I receive problems in the new version.