Main

January 28, 2010

Handling user upload of big images

Working a lot these days so few posts, but I made a class for a project that some may find handy. When you let users upload pictures using the Flash Player 10 local FileReference feature, you can get all kinds of image sizes (and content!). Most modern cameras have quite a few megapixels and Flash Player 10 can easily choke on large pictures.

FP10 has problems with images that have width or height larger than 8191 pixels. This is still much better than the 2880x2880 pixels we had to work with in FP9 so that alone is a great reason to insist on FP10 for this kind of applications. There is also another limitation mentioned in the official documentation that says "the total number of pixels cannot exceed 16,777,215 pixels". I've found that this isn't a problem for this implementation, so users can easily upload 8000x8000 pixel images without causing problems. The class will take the uploaded image and scale it to whatever max size you want. If the uploaded image is smaller than the max, it'll leave the image unchanged.

Using the class is straightforward. Just make an instance and pass in what you want returned as the maximum width/height:

var bigImageHandler:BigImagehandler;
bigImageHandler = new BigImagehandler( 1500 );

and then add listeners to respond to what the user does:

bigImageHandler.addEventListener(Event.CANCEL, userFail);
bigImageHandler.addEventListener(Event.COMPLETE, userSuccess);
bigImageHandler.addEventListener(Event.CLOSE, userCancel);

Click here for example (Source code)

The project I did this for is also quite cool and I'll give a small presentation of it on the next FUGN meetup. It's a small app that'll allow you to make yourself old. Just upload an image (or use a WebCam), position facial features and you can turn on/off wrinkles, hair and more. Feel free to give it a spin! Click the image my old self to get started making your own. (Note: the app is in Norwegian, but I'm sure you'll figure it out by just clicking around)

bligammel.jpg

December 01, 2009

Extra return in Textfields

Spent some time debugging a strange issue today where input-textfields always contained an undesired extra line. Since I found little info via Google, I'm posting it here for future reference.

If you make a multiline textfield with a border and autoSize set, you'll see the problem easily. Every time the .htmlText property is set, an extra line is appended. It is not a newline character (\n), but rather a return (\r). This is done by the Flash Player itself and I can't find a good reason? You can see the bug here (source). I've reported the bug in the Flash Player bugbase and initially I had no solution to the bug.

Then, my friend Fabrice found a solution. Adding this line after seting htmlText solves the issue:

tf.htmlText = tf.htmlText.substring(0,tf.htmlText.length-1);

October 14, 2009

FDT quick tips for Flash Player 10

Just a quick post to save this somewhere. Two important things when using FDT for Flash Player 10 projects:


  1. Remember to set the target-player parameter in your Compiler Arguments for both the Debug and Run configuration (-target-player=10.0.0.0)

  2. When using the Embed-tag in FDT, you can't use the "Pure" config. You have to use the ordinary one

I haven't seen this noted anywhere and I couldn't find it on Google. Guess it's worth posting. Another thing that have bitten me when working with FDT - asset paths require a starting slash like this:

		[Embed(source="/image.jpg")]
		private var img1:Class;
Another thing that will come in handy is this list of Flex Compiler arguments. FDT does not set/update any of these automatically, so it's really handy. I keep having mixed feelings about FDT. There's so many nice things, but all the rough edges seem to ruining my experience of it. I guess I'm just a little spoiled?

BTW: I've been really busy lately. Lot's to catch up on after summer holidays, FOTB, all the MAX announcements (as the iPhone one) and client work. I'll also go to Sydney to visit my brother next week so it's been a while since last post. Will probably be so a while ahead as well. So much to do and so much fun ahead!

August 30, 2009

Please smooth your video site!

Lately there's been several great websites that are based on video. We Choose The Moon and Instant Campaign are two of them. Both these sites must have cost thousands of dollars to make, but the video looks quite pixelated. It's actually so pixelated that it annoys me, especially since it's so easy to fix. Have a look at the picture below.

smoothing.jpg

Common for both of these sites is that they scale the content to the width of the browser. If you view any of these sites on a big screen such as the Apple 30", this looks extremely bad and all you need to fix it is one simple line of code:

video.smoothing = true;

That's it and your video will look much better on big screens. Doing this adds a little to the CPU usage, but this won't matter much on the average machine.

I've also uploaded an example FLA that you can have a look at to test this. Just run the file to load play video. Scale the SWF and click the video to toggle smoothing on/off.

PS: sorry about the lack of updates recently. I've been on holidays and been quite busy with client work lately. Finally having a little free time now to experiment and play! :)


May 22, 2009

Realtime 3D on the web - a toy or a useful tool?

A little late, but here's the slides from my presentation at the FlashForum Konference in Cologne. In the session, I discussed 3D on the web and what it's good for. I started with a historical overview for we've had 3D on the web for a long time already. It's never been a success though and I highlighted some possible reasons as well as why Flash changes this. I also tried to draw up some rules for what constitutes "good use of 3D on the web". Is showed no code at all in the presentation and the slides don't give away all I said, but you'll get the idea.

PDF of presentation

I've done lots of presentations before, but this was the first time I presented at an international conference in English. I was super-nervous but the session went really well and I got some good feedback. It kind of surprised me how little feedback you get initially. Just a few mentions on Twitter that said my session was "nice" - not all that encouraging. Later I got the feedback from the Feedback forms as well as blog articles such as this one that said "Fantastischer Vortrag und super Redner". Really strange to not just give feedback like I usually do on Flashmagazine, but also receive it! :D

jensaAtFfk09.jpg
Photo by Marc Thiele/FFK

The day before the conference, I also did a full-day Away3D workshop. Renowned community expert Peter Elst was there and I'm glad he enjoyed it! I also did two reports from the event for Flashmagazine.

I have to congratulate Marc and Sascha - they really know how to pull off such an event! The mood was excellent. 500 attendees, 28 sessions, 10 workshops and not a glitch. Pretty neat and all served at a fraction of the cost of other conferences? Pretty impressive if you ask me! I had a great time!

May 14, 2009

AIR window resize inconsistencies

The last two weeks I've been working on 3 different AIR apps and I have to say I really like Adobe AIR. It's easy to develop for and quite consistent across the various Operating Systems. One thing that had me (and others) puzzled is how the windowing system works, so I thought I'd add a post for future reference.

There's two main ways you control the appearance of the main application window. One is by setting properties on the mx:WindowedApplication tag and the other is to set properties in the application.xml file that defines each AIR app.

Resizing

The application.xml has a xml property that controls the resizing of your app:
<!-- Whether the user can resize the window. Optional. Default true. -->
<resizable>false</resizable>
So to prevent resizing, you just set this parameter to false, right? Not right. You will notice that the "gripper" is still present in the lower, right corner of your app and this allows rescaling. To turn off the gripper, just add showGripper="false" to your WindowedApplication tag and that's it. Or is it? Of course not. To make this work with the system chrome, you'll actually have to turn off the Maximize button as well, making the complete settings like this:
<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<systemChrome>standard</systemChrome>
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
<transparent>false</transparent>
<!-- Whether the window is initially visible. Optional. Default false. -->
<!-- <visible></visible> -->
<!-- Whether the user can minimize the window. Optional. Default true. -->
<!-- <minimizable>false</minimizable> -->
<!-- Whether the user can maximize the window. Optional. Default true. -->
<maximizable>false</maximizable>
<!-- Whether the user can resize the window. Optional. Default true. -->
<resizable>false</resizable>

The other option is to not use the operating system's windowing style, but rather the standard one that AIR provides.


<!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
<systemChrome>none</systemChrome>
<!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
<transparent>true<transparent>

These settings will automatically hone the setting specified in the XML, so the window can't be resized. You'll still see the "gripper", but it won't have any effect and you can easily turn it off.

The Fullscreen bug

Another, slightly related thing you should be aware of is that there's a bug relating to using standard window chrome and setting the / properties in the application.xml. If you turn off these properties, they will be grayed out (disabled). Once you set the app to FullScreen mode and return from it, the maximize/minimize buttons are now incorrectly set as enabled allowing the user to set them. Only workaround I know of is to loose the OS native window chrome.

It would be great if this was cleaned up and made more consistent for the next iteration of the AIR runtime. If I turn off the gripper, I want it to disappear (no matter what) and if I set resizable to false, I actually don't want it to be possible to resize the app, no matter what.

I'd also love to be able set properties such as "Application.application.maximizable" at runtime so I don't need the XML file at all. It's really just annoying and messing up my development process.

Note: This post applies to AIR 1.5. I'm not sure, but I think this applies to NativeWindows as well.
airLogo.jpg

February 26, 2009

Flash MP3 player for JavaScript

I recently got a request from a friend that's a JavaScript developer and he needed to play some sound effects in an an app he's working on and he asked me for advice. I quickly made a headless SWF that can play, pause and stop any online MP3 file from JavaScript and I figured that others might also be interested in this so I'm posting it here for others to grab.

Bare bones example - Actionscript class - FLA file

PS: if you use this, send me an URL so I can link to it?

Actionscript syntax highlighter

Due to a limitation in EE I had to change all the Flashmag tutorial code from using <pre> to <code> tags and figured I'd add some nice syntax highlighting while at it. After checking a few, I found SyntaxHighlighter 2.0 that looked clever. Only one problem - they didn't have a syntax file for Actionscript, so now I've made one and you can see it in action here (scroll down to the code listing). You can pop up a nonformatted version, copy straight to clipboard (via a small shim SWF file and print. Nifty, isn't it?

I initially figured that I wanted all AS3 classes/datatypes to highlight as well, but that was a little too ambitious :) The AS3 core language with all AIR and Flex extensions amounts to more than 950 classes! Just the class names make up 14Kb so I rather settled for a lightweight version that only highlights the classes you'll use the most such as arrays, booleans, sprites and more.

If you want to add this to your own site, download the .js file (lightweight version/full API version) and here for the .css file. You'll also need to download the SyntaxHighlighter files.

Installing is just a matter of copying the files to the server and adding a few lines to your templates. Here's what I've added to the header on this site:

	<script type="text/javascript" src="/js/shCore.js"></script>
	<script type="text/javascript" src="/js/shBrushAScript.js"></script>
	<link type="text/css" rel="stylesheet" href="/js/styles/shCore.css"/>
	<link type="text/css" rel="stylesheet" href="/js/styles/shThemeActionscript.css"/>
	<script type="text/javascript">
		SyntaxHighlighter.config.clipboardSwf = '/js/clipboard.swf';
		SyntaxHighlighter.all();
	</script>

On Flashmag, I've also changed from using the default <pre> tag to <code> by adding this line:

SyntaxHighlighter.config.tagName = "code";

February 07, 2009

Flash and IE6 bug when loading XML

Last week I stumbled upon a really odd Flash Player bug. I'd done a project for a client that loaded XML. It worked great on the clients test-server, but when moved to the deployment server we got a weird error - in Internet Explorer 6, the XML refused to load, returning an IOError?

When I debugged I found that the Flash Player was indeed loading the XML but it apparently failed to parse it? After some Googling I found this article at MediaCatalyst that claimed that this had to do with the headers sent from the servers? Didn't really sound probable, but it was worth a shot. It worked...? Wow. Somebody should fix this bug, shouldn't they?

So - if you're having problems loading XML with only IE6, make sure you check that the server does not send the HTTP response header: Cache-Control: no-cache You can easily check this using a tool like Charles.

Luckily, IE6 is less and less popular and with some luck, web designers can stop worring about it in a year or two.

February 03, 2009

Is Flash 3D a toy or a tool?

Yesterday I delivered a talk at the first Norwegian FlexCamp here in Oslo. My session topic was "Realtime 3D on the web - toy or a useful tool?" and it went down really well. I discussed why 3D on the web never got popular and what "Good use of 3D" could be. It's a little hard to find good use cases if you don't include the obvious things such as games, product presentations and experimental interfaces, but if you have good examples - please post it in the comments?

I showed 5 projects I've made that I think makes good use of 3D and I got lots of nice feedback. As promised, here's the link to my presentation. The presentation is in Norwegian, but I'll also do something similar for my session at the FlashForum Conference in Cologne in April and that session will be in English. At FFK09 I'll also do a full day workshop on Away3D so if you want to get started with 3D in Flash, this could be a good start.

presofco.jpg

Today also marks the beta launch of my first public facing 3D application, a 3D StreetView covering the Oslo area. Click the blue dots in the map to view a location. There's more than 120.000 panoramas in total, so you can see pretty much every part of Oslo. Go check it out!

gatebilde.jpg

December 18, 2008

CopyPixels and browser speed limits

Can it be true that Flash Player running in the Opera browser on Windows XP is more than 4 times faster than Safari on the Mac? It certainly looks like that and I need some help testing...

graffiti.jpg

I'm currently working on a project where I need to offset some bitmaps and I stumbled upon a very interesting speed difference among browsers. I'm shifting a bitmap along X and Y using the copyPixels function. This is apparently the fastest way to set an offset on bitmapData, but the browsers seems to have their own speed limitations? The difference between Safari on OSX and Opera on XP is downright scary...

The test file is set to play at 900 fps, so the results you are getting will be the maximum of what your browser is capable of. If you have the time write a comment with the results you are getting and I'll add it to the table below. Make sure you specify your CPU speed and that you don't have other software running that'll steal CPU time (such as Spotify). Here is the test file and for those in need of an image scrolling class, here's the AS3 class and the class to create the test as well. (The image is a neat graffiti I found just up the street from Bill's in Brighton).

PS: I know the Flash IDE can't be set to more than 120 fps, but in a Flex actionscript project you can set it to 999fps without any problem...

Browser OS CPU speed Player version Fps result
Firefox Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 54
  Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 9.0.124.0 55
  Mac OS 10.5.6 2,4 GHz Core 2 Duo 10,0,12,36 60
  Mac OS 10.5.5 2,4 GHz Core 2 Duo 10,0,12,36 34 (?)
  Mac OS 10.5.5 2.1 Ghz Core 2 Duo 10,0,12,36 49
Safari Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 60
  Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 9.0.124.0 62
  Mac OS 10.5.6 2,4 GHz Core 2 Duo 10,0,12,36 53
  Mac OS 10.5.5 2.1 Ghz Core 2 Duo 10,0,12,36 43
Opera Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 19
  Mac OS 10.5.5 2 x 2,8 GHz Quadcore Xeon 9.0.124.0 14
Firefox Win XP 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 133
  Vista Ultimate 3 Ghz Core 2 Duo 10,0,12,36 130
  Vista 64bit 2.6 Ghz Core 2 Duo 10,0,12,36 136
  Win XP 2.5 Ghz Quadcore Xeon 10,0,12,36 139
  Vista Ultimate 2.4 Ghz Core 2 Duo 10,0,12,36 134
  Win XP 2.4 Ghz Core 2 Duo 10,0,12,10 72
  Win XP (Parallels) 2.4 Ghz Core 2 Duo 10,0,12,36 137
  Vista 64bit 2.0 Ghz Core 2 Duo 10,0,12,36 136
  Win XP 1.8 Ghz Core 2 Duo 10.0.12.36 130
Chrome Vista Ultimate 3 Ghz Core 2 Duo 10,0,12,36 120
  Vista 64bit 2.6 Ghz Core 2 Duo 10,0,12,36 80
  Win XP 2.5 Ghz Quadcore Xeon 10,0,12,36 115
  Win XP 2.4 Ghz Core 2 Duo 10,0,12,10 104
  Vista 64bit 2.0 Ghz Core 2 Duo 10,0,12,36 80
Opera Win XP 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 279 (!)
  Vista Ultimate 3 Ghz Core 2 Duo 10,0,12,36 134
  Vista 64bit 2.6 Ghz Core 2 Duo 10,0,12,36 166
  Win XP 2.5 Ghz Quadcore Xeon 10,0,12,36 240
  Win XP 2.4 Ghz Core 2 Duo 10,0,12,10 180
  Vista 64bit 2.0 Ghz Core 2 Duo 10,0,12,36 142
Safari Win XP 2.4 Ghz Core 2 Duo 10,0,12,10 144
IE8 Win XP 2.5 Ghz Quadcore Xeon 10,0,12,36 63
IE7 Vista Ultimate 3 Ghz Core 2 Duo 10,0,12,36 64
  Vista 64bit 2.6 Ghz Core 2 Duo 10,0,12,36 65
  Vista 64bit 2.6 Ghz Core 2 Duo 10,0,12,36 136
  Vista Ultimate 2.4 Ghz Core 2 Duo 10,0,12,36 64
  Vista Ultimate 2.4 Ghz Core 2 Duo 9.0.115.0 64
  Vista 64bit 2.0 Ghz Core 2 Duo 10,0,12,36 65
IE6 Win XP 2 x 2,8 GHz Quadcore Xeon 10,0,12,36 63
Webkit Nokia N800 0.33 Ghz TI OMAP 2420 9.0.48.0 8 :-)
Webkit PS3 3.2 Ghz CELL 9.0.124.0 65

December 11, 2008

Away3D doughnut?

Been working on the final Away3D primitives tutorial for Flashmag today. So what do you use a Torus for other than a Doughnut? Speaking of Doughnuts - anyone remember how The Swedish Chef made them?

dougnut.jpg

The tutorial should be finished soon. Hopefully this weekend.

November 27, 2008

More Away3D tutorials posted on Flashmag

I finally got three more Away3D tutorials posted on Flashmagazine. These contain the source to the Panorama viewer, sound visualizer and CMYK color separation examples posted here along with how to create them.

Here's the complete list of the nine Away3D tutorials I've written up until now:

Flash 3D Basics (not Away specific, but with Away example source)
Installing Away3D for Flash, Flex or Flashdevelop
Away3D Basics 1 - A simple Away3D class explained
Away3D Basics 2 - The View and the Scene
Away3D Basics 3 - The Camera(s)
Away3D Basics 4 - Manipulating 3D objects
Away3D Basics 5 - Primitives (Part 1)
Away3D Basics 5 - Primitives (Part 2)
Create the Earth and heavens in less than an hour with Away3D

Supporting tutorials:
Using Actionscript projects in Flex or Flash
Using Flex Actionscript files with Metadata in Flash CS3

I hope many will find these useful! I'm now working on the last one on the primitives. The next batch of "Basic" tutorials will cover materials and lighting, interactivity and working with imported models. And - it's soon weekend so I can allow myself to play with a neat little AIR app I started last weekend :)

November 18, 2008

Away3D panorama viewer

Another example from upcoming Away3D Tutorials. This is a simple panorama viewer. Code will be in the tutorials. Will publish these right after MAX.

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player
Saint Germain en Laye church. The panorama image used here was created by Seb Przd and is distributed under the CC ByNcSa 2.0 license. Seb's done some really cool panoramas, so check out his Flickr account.

Away3D video-wall

Still working on those Away3D tutorials, I wanted to show an example of a Video Wall. I've seen this done lot's of times with Papervision3D, so I figured it'd be easy to do with Away3D as well. Turns out it wasn't that easy, but from now on it should be since I made a VideoMaterial. In this demo, I've added sound support as well so you'll only hear the sound of the video facing you.

Continue reading "Away3D video-wall" »

November 13, 2008

Sound vizualizer with Away3D

I keep playing with examples for upcoming Away3D tutorials on Flashmagazine. Here's a simple sound visualizer using Away3D. I store the average 512 samples in 20 values and use these to scale and color the cubes. I've spent way too much time playing with this one (without getting the results I wanted), so I better move on to the next example. I guess Beat Detection is a little harder than I thought...

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player
The source will be in the tutorial and there's no interactivity on this one, just enjoy the music:)

November 10, 2008

Another CMYK separation in 3D

By putting each channel on a 3D plane with a slight depth offset and set the planes to blend using the "multiply" blendMode, you'll get an impression of how CMYK separations are done for printed media. While not technically correct, it works much in the same way. Just move the camera a little to see the blur effect that happens in newspapers when the colors miss.

I did this experiment as an example for an upcoming Away3D tutorial I'm writing for Flashmagazine. Rather than using the Munch image, I wanted an image where you could clearly see the difference in the C, M, Y, K color channels, so here I've used a color wheel that Adobe's John Nack published of the CS3 icons.

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player
Click and drag to see the CMYK color layers. I'll publish the source files for this one when the tutorial is done. Click here for a much larger version.

I used a slightly different approach for creating the color channel PNGs this time and I think this became even more alike the original this time. I Google'd a lot to figure out how to do a proper separation of the channels to PNGs with transparency, but I'm sure there must be a better and easier way than what I did. If you know how to produce PNG files holding only the color information, feel free to leave a comment and I'll try it out.

November 09, 2008

3D CMYK Munch

Saw a thing on TV today about how color separations for print works and got this idea: How would it look if I split the CMYK colors out each their 3D plane and then blend them back again as a picture? Here you can see a painting by Edvard Munch using this effect.

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player
Click and drag to see the color separations. Click here for the source. Click here for a larger version.

The hardest part here was actually figuring out how to split out the C, M, Y and K channels as each their separate, transparent PNG. In the end it was quite simple.

1. Open the picture in Photoshop and convert to CMYK
2. Grab a screenshot of each channel and re-open them in Photoshop
3. Copy the contents into the Alpha channel to use brightness as alpha
4. Tint each channel to the proper color, crop and export as PNG
5. Make a standard Away3D scene with a HoverCamera and 5 planes (One plane for each of the CMYK PNGs + one white plane that the back that'll serve as the paper)
6. Set the materials for each plane and set their blendmode to multiply

Fun eve project instead of watching telly :D

PS: you can find the original image as well as a lot more of Munch's works at munch.museum.no. Well worth a visit if you're ever in Oslo and interested in art.

UPDATE: just posted a new version with a more suitable image

October 22, 2008

Bezier drawing with Degrafa

I've made a couple bitmap-based drawing programs in Flash/Flex and figured it'd be fun to make a Bezier-based drawing tool as well. Thinking it couldn't be too hard, I set out to see what already existed of code out there. I found a couple good resources, but boy was I wrong. Bezier math is kind of complex, at least for someone with limited math skills as myself.

I read and searched and then I saw somebody commenting "Why don't you just use Degrafa?". I've always thought of Degrafa as a Flex only thing, but Flex is really just a powerful abstraction layer. It's all Actionscript and so is Degrafa. The more I read in the Degrafa source code, the more I loved it. Degrafa has really good classes for both Cubic and Quadratic beziers that you can easily use straight from AS3. Here's my first take on this (right click to view source):

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player

I'll eventually extend this further to a full, but basic drawing program. I'd love some comments on the way I've structured this, so if you got the time... thanks! If you want to do anything related to programmatic drawing, make sure you check out Degrafa. Loads of cool stuff you can do with it!

October 14, 2008

Playing with vectors

Experimenting with vector drawing today. As I've done a couple bitmap-based drawing programs earlier, I figured I might as well have a stab at making a vector version also and while playing around, I made this. Looks kind of pretty, doesn't it?

This content requires Flash Player 9 (or a more recent version). You need to upgrade your Flash Player
(Move the mouse above the SWF to make it run)

September 18, 2008

James Ward at FUGN today

Adobe evangelist James Ward did a packed session at JavaZone in Oslo yesterday. There was hardly room to stand in the room, so Flex sure seems popular with the Java crowd. Tonight, he will visit Flash User Group Norway (FUGN) for an informal session about Flex - a rare chance for Norwegian Flex users to get some info directly from the source (and maybe grab a beer or some pizza as well?).

Unfortunately, I can't go there myself tonight, but I'm posting it here so others will know what's happening.

Pretty, additive cubes

Just read about this Flash Player 10 test. Thought the cubes looked nice and wondered how Away3D stacked up using the current Flash Player 9 version. Plays pretty well? (Source)

cubes.jpg

September 10, 2008

Awesome Peacock example

Mario just posted an extremely cool example of Peacock - the Pattern Generator in the Aviary suite. I can't help myself re-posting this as I love Lego's and this Peacock "filter" will let you take ANY image and have it built with 3x2 Lego blocks. It's amazing how powerful this online Flash based application has become, just check out the video below to see how it is done.


Plastic Block Fishy from mpeutz on Vimeo.

PS: I still have two more Peacock invites to the first commenters on this post :) Invites are now gone :)

September 08, 2008

Icanhaz flashburger?

Going to Flash On The Beach? I'm so looking forward to this conference and I'm hoping that as many as possible will join in on the Flashburgers the day before the event! See you in Brighton!

catburger.jpg
(image courtesy of icanhascheezburger.com)

September 02, 2008

ReferenceError: Error #1056: Cannot create property

Quite often, I do projects where I do the code and somebody else do the graphics. I usually set this up so that the designer can work in Flash CS3, whereas I do my code in Flex Builder. I set my class to be the Document Class and then set the FLA to not "Automatically declare stage instances" so I can reference the animators MovieClips inside my code.

Today I got an error that I've also gotten on a couple other occasions and I thought I'd blog the solution here for future reference.

This is the error:

ReferenceError: Error #1056: Cannot create property anim1 on Bynett.
	at flash.display::Sprite/constructChildren()
	at flash.display::Sprite()
	at Bynett()

By default, I usually set all properties in a class to "private". This error will occur if you set a MovieClip to "private" when it should have been "public". What happens is that since the MovieClip is set to private, the Flash CS3 environment won't have the required access to this clip. Just make sure that all objects that the designer will control is set to "public" and all is fine.

(Thanks to Kadazuro for reminding me of the solution!)

August 26, 2008

First FUGN meet this season

Flash User Group Norway (www.fugn.com) kicks off the season next Monday (September 1st) at 18:00. If you're in the Oslo area or anywhere near, feel free to drop by. The User Group meetings are at Peppes (Stortingsgata, downtown Oslo) and they are open to everyone be it users of Flash, Flex or anything related to the Flash Platform.

The meetings are informal with Beer, soda, pizza (and other foodstuff) served. Occasionally there's presentations on relevant topics or spontaneous showcases of stuff people work on. It's a great place to meet people, ask a question, discuss your designs or even get a job.

fugn_030308_003.jpg
Here's a pic from a former meeting (photo by Øystein Wika)

Click here to read more

August 04, 2008

iPhone - Hot without Flash

I've had my iPhone for some weeks now and I totally love it. There's some really good things about it and a few things that annoy me, so I thought I'd post my hot/not list for future reference to see what Apple if able to fix going forward. One thing that does NOT annoy me is the lack of Flash support. I don't think Flash is important and I can see many reasons for Apple not supporting it in the future.

Continue reading "iPhone - Hot without Flash" »

July 29, 2008

Playing with Aviary

Looks like the Aviary crew isn't spending the summer on the beach (as I'm fortunate to do these days). This eve I've been playing with Peacock, their pattern generator and it's loads of fun! I have beta invites for the three first to comment so be quick :D

aviary_mess.jpg

I'm by no means an artist, but generating patterns with Peackock is mighty fun!

If you've not seen what these tools can do, I suggest you check out this vid of the Phoenix image editor in action. This crew and the artists keep amazing me! (more transformations here)

April 11, 2008

Macromedia and Adobe - newly combined?

I had to reinstall my CS3 package today and got a surprise when I logged in to retrieve my serial number. On the page listing your registrations it says "We’re making improvements to support the newly combined Macromedia and Adobe community". Wow? What can I say? Two years in the making and you still can't view the serial numbers of your licensed products.

I sure hope this only temporarily, or the Adobe customers will have to pay the bill in the form of foolish costs to call centers that just tell people what their serial numbers are. There's also a link to your Adobe registered products that is "Temporarily Unavailable". Good thing I'm not in a hurry then, after all I just make a living from Adobe tools... Luckily there's warez sites with serial numbers around, so you at least have a chance to run your software ;-P

Oh - and did I mention why I had to reinstall the entire CS3 package? Since I was part of the Dreamweaver Beta and I forgot to uninstall the software before it expired, I had to delete it manually by searching for files (The uninstaller would not start since it was expired too...). This in turn prevented it to be installed when I got my CS3 package. Not having Dreamweaver isn't such a big deal any more. I much prefer FireBug and TextMate, but Dreamweaver wasn't the only bit that didn't install.

The Dreamweaver Beta also installed Device Central and Bridge and the CS3 installer was unable to remove these as well. Another problem I've had recently is that my Photoshop CS3 crashed upon every Open or Save attempt. The last drop was that I needed Device Central yesterday and it claimed my product was expired, so I bit the sour apple and spent an hour deactivating, uninstalling and reinstalling it all. Amazing how much stuff the uninstallers actually leave behind.

Update: Photoshop and Dreamweaver now works, but Device Central just says "License Expired". It appears to be impossible to reinstall just this one bit. Any suggestions welcome!

Update 2: The CS3 cleanup script did the trick when used on level 2. Blahhh... what a day to spend a day :(

Here's something to cheer up anyone with similar problems: Elijah Wood gets mortified.

February 22, 2008

TypeError: Error #1009

Chances are that you've seen this error message before. This is my number one wish for ALL the Adobe compilers - better error messages! I've always wondered why Flash / Flex can't throw proper error messages and this is a brilliant example. In this case, Flash obviously knows exactly what is wrong so why not just just tell it? How about something like this:

 
TypeError: Error #1009: Cannot access the property "someprop" since it is a null object reference.
	at no.netron.tusenfryd::Map/onLoadSingle()
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/onComplete() 
 

If I just knew the name of the object, I didn't have to search all over for it...

February 21, 2008

Flash CS3 Quicktime export bug

How can the same timeline export to two different lengths? This is for sure a bug in the Quicktime export in Flash CS3. A little background - I'm working on a project where we'll let the user rotate a huge 3D model left or right by clicking some arrows. If you have ever tried to play Flash video backwards, you've noticed that this won't play smoothly since Flash have to calculate any missing keyframes. The best solution is to use two FLVs embedded in each their movieclip and do some smart toggeling of the two movieclips so you only play one video at a time, but always in the forward direction.

For this to work, you'll need two videos. One containing the normal sequence and one containing the reverse. These videos have to have exactly the same length, or you won't be able to jump between them. Ive done this a bunch of times in former versions of Flash, but in CS3 this is totally broken. Have a look at the timeline below (click for full size version). it has three layers. The first layer (right) contains a series of PNG images showing the rotation of the model towards right. The second layer (left) contains the same images in reversed order.

I export the "rotateRight" quicktime movie and then turn the "right" layer into a guide and export the "left" rotation. The resulting Quicktime movies will now be of different lengths!?!? Not only that - if I re-export the lengths change at random??? Seriously - somebody did not do their homework here! This also reminds me of a problem Andre Michelle is experiencing where the sound object is now less precise than if was before.

Come on - time is only relative in movies. In real life a frame is a frame and a second is a second! I've now spent way too many hours researching this. I'll now dig up my old PC version of Flash 8 and fix this.

UPDATE: Using Flash 8 worked like a charm. This is definelty a CS3 bug...

qt_small.jpg

Click to view large image

Just to make it worse - the last update for CS3 that I whined about has broken Photoshop. It crashes every time I try to open an image using the Open File dialogue or try to Save. Just brilliant when you want to make pictures illustrating another bug in Adobe software... And - this is not my machine acting up either. My wife has the exact same behavior on her video editing Mac at work and the export issue has also been confirmed by others. It's the same. 100% repeatable randomness.

February 18, 2008

Adobe Updater

Today, the Adobe Updater started whining about another update. It does this so often that it's a real annoyance since the core component it keeps updating are stuff I never use or care about such as Bridge and Version Cue. Today, the darn updater has interrupted my work flow more than 5 times over the course of two hours. I sit there working happily and that annoying updater keeps juming in the dock...

Anyone have some good advice on how to control this better? I do want updates to the applications I use, but I really don't want to be bothered when it comes to all that other crap...

Update: JD got me some good advice. Comments are now working.

February 05, 2008

A Love Letter to Flash

Just brilliant!

January 31, 2008

What is Singularity?

What's Aral up to?
Singularity?

December 14, 2007

Mike Downey comes to Oslo

Sweet - finally a visit from "the mothership" to little Norway :-)
January 31st 2008, Mike and several other Adobe evangelists (Stephanie Sullivan Greg Ewis and Jason Levine) will head to Oslo, Norway for a free full day conference. There will be sessions on Flex, AIR and AS3 with Mike as well as Photoshop, Fireworks, Dreamweaver and AJAX. These free one-day things are usually pure marketing, but this looks like it could be quite interesting.

Mike has his sabbatical right now - one of the nice things with working at a big company like Adobe. If I remember correctly, Adobe offers six weeks and Macromedia used to offer eight weeks after working a certain time. Probably very well deserved as he's been doing nothing but traveling for a really long time now... If it wasn't for this, I'd invite him to visit the norwegian Flash User Group FUGN. I'll shot him an email when he's back in January :)

PS: If you're in Norway and didn't know about FUGN - tell all your friends and colleagues and join us the first monday every month. The meetings are informal and hosted at bars (like the London FPUG). The informal atmosphere makes easier to ask questions and present stuff you're working on. We don't mind the beers either :)

UPDATE: Turns out there is some kind of special event the day before and the FUGN members present at last weeks meet got invites for this :)

December 03, 2007

Inspectable metadata

If you're making Components for use in CS3, you'll no doubt stumble upon the Inspectable metadata tags looking like this:

[Inspectable(defaultValue="auto",enumeration="on,off,auto")]

I had a hard time finding more information about this until I downloaded and read through this PDF from Jeff Kamerer at Adobe. Only the first part of his tutorial on creating components in CS3 is up on the ADC site right now, but at the very end of the page he has some PDFs that is a veritable goldmine for component developers. I have not read through it all, but it looks as if he's skipping the very last, important part that details the packaging of components. Spender at the Flash Brighton blog has a good writeup that I think will solve that for now.

(Too bad Adobe didn't take the time to ship this as part of the docs. They obviously had all the knowledge in-house, but I guess they did not have the time for this just before launch? Experience has learned me that the sooner you document stuff like this the fewer mistakes the devs will do, so I do find it odd that this is the only documentation we have...)

November 27, 2007

Should I Bubble?

Working on a fun AS3 project now, where I'll make some UI components. The components has several events that they want to notify the world about, but I'd love some help on a design decision: should the events dispatched from a component bubble per default?

November 11, 2007

Life of an evangelist

I loved Scott Barnes entries at MossyBlog. About a year ago, Scott started with Microsoft and now he has a brand new blog titled "Life of an evangelist" with video, photos and even his own comic strip! Go check it out!

October 25, 2007

Projector issues in CS3

fargevelger.jpgWorking on a kids game now that we'll deliver as a projector for both Mac and PC and thought I'd share a few Gotcha's I've gotten in the process. These relate to unloading movieclips, FLV playback, Events, AS3 vs designers and Shared Objects. The game is a classic kids game with an animated story that ties together some 30 mini-games.

Continue reading "Projector issues in CS3" »

September 11, 2007

Curiosity sucks

On many occasions I've wished I wasn't that curious, but I must say that Adobe has messed my machine up with AIR and the Flash Player. As a developer, I'm always keen to check out new tech so I "had to" install the beta version of the Flash Player supporting MPEG4 video and check this out. That caused my debug player to disappear, and also royally screwed up installing AIR apps. In an attempt to rectify this and check out Digimix - an excellent AIR app (according to Paulo) I uninstalled and reinstalled the latest distribution version of the player. Now I'm stuck with a setup that boots my Parallels installation every time I click an AIR install badge. Great...

I assume this is just a setting in Parallels that I can fix myself, but still - the player selection feels a little screwed at the moment. What I really want is a version that has both debug for Flex, installs AIR files AND shows me the latest and greatest. That way I didn't have to go through all these instalIs/uninstalls, but I guess this is impossible due to the development process? I guess I'll have to install the FireFox Flash Plugin Swithcher.

Update: Figured it out. Parallels 3 makes shortcuts to all your windows apps, included the AIR installer on Windows... Just had to delete that from my Windows Applications folder under OSX.

August 29, 2007

Papervision Rocks on

Picture 4.jpgPapervision keeps amazing me. Today I saw this nice depth of field effect by Ricardo Cabello aka Mr.doob (Check his experiments section for more 3D Flash fun). One of the contributors to the Papervision project, John Grden, needs a new machine. If you use Papervision or have use for it in the future, I recommend chipping in. In addition to contributing on Papervision, John has also made the XRay debugger, Red 5 streaming server. He is spending an awful lot of his time helping other Flash users so he really deserves help on getting a Mac.

July 12, 2007

The future of Flash and Adobe

This is a great read for anyone curious about where Adobe may be heading with Flash - An AIR of Invisibility: Adobe has Microsoft in its sights. The article points out that Flash (and PDF) is now everywhere and to such an extent that it's just one of those things you expect from a decent device. If it can't do Flash, then it IS a watered down version of the internet.

There's just one point that the author fully misses on as he says "... and there are just as many Flash developers as Java developers". This is just plain wrong. Every university teaches Java, but very few teach Flash. This is certainly something Adobe should focus more on, as the demand for Flash talent is extreme now.

Multitouch Flash

Check this Youtube vid - multitouch app done using Flash and AS3!

(via Andre Michelle)

July 06, 2007

My best CS3 error message thus far

CS3 is pretty stable, but when importing a MovieClip from an AS2/Flash 8 file today, I got this sort of fun message when trying to set the class name:

Picture 3.png

"This feature is not supported by Flash Player 9, Actionscript 3.0. To use this feature, you must target Flash Player 9, Actionscript 3.0."

Ehrrmm.... This is exactly what I am doing? My file is indeed targeting "Flash Player 9, Actionscript 3.0"... Got around this by just copying the frame contents into a new MovieClip, but this gotta be a bug?

May 28, 2007

Need a unique canvas for your Flash work?

This will change how you think about screens or even t-shirts! Just after Sony's announcement of ultra-thin OLED screens, Philips takes this a step further. Why print the logo on t-shirts when you can have it animate? Any kind of cloth can now be turned into a screen - how's that for a canvas for your next Flash animation?

April 29, 2007

OSX and FireFox growing steadily

Ever since I switched to Mac about a year ago, I've been sure that the Intel Macs and OSX would become serious competition for Microsoft. According to thecounter.com, Mac users now account for almost 4,3% of all their visitors (72.993.015 person user sample thus far this month).

I'm not saying that the figures from thecounter.com are 100% representative. They are based on info from a small JS that is loaded on all of internet.com's sites, so it's a tech-based audience, but still it's very interesting to see how steadily the number of Mac users grow. Two years ago, mac users were only 2%. I seem to remember that Gartner Research predicted late 2006 that Mac's wouldn't get above 2.9% in 2007? Fun to see how analysts fail to really research the market. Just imagine the rush that will come now that Adobe finally has delivered CS3 on the Intel Mac platform. I bet they forgot to think about how that will affect Mac growth?

Another fun fact - the project I've been working on the last year has seen insane Mac growth. Initially, only two of the coders had Macs in the building. Now it's about 20 of us doing Flash, HTML and Java on shiny new Intel Macs. I'm pretty sure that OSX will have near 6% market share by the end of this year, driven by iPod and iPhone sales.

On a similar note - Back in 2005, mozilla based browsers was at about 5%. Now, these account for more than 24%. Who said the browser wars were over? ;-)

April 27, 2007

Worms multi-player clone

Great example of how simple one can make an advanced multiplayer game. Sort of a Worms-ripoff but great friday fun! Just click "Quick Play" and you're started.

February 28, 2007

Don't trust Stage.width

Just found an issue with cached SWF files in IE7 - Stage.width will sometimes be reported incorrectly. We had a Movieclip that used Stage.width for positioning and whenever the SWF was cached, that movieclip would be positioned off stage. Hardcoding a variable instead of using the property solved the problem.

I seem to remember that there were some issues with Stage.width some years ago as well? Anyway - great to finally be doing some Flash work after editing JSP and portlets the last couple months...

December 12, 2006

Mac Intel debug player annoyances

Some weeks ago, Paulo discovered that the debug player that ships with the MacTel Beta of Flex is terribly old and there is no new version up on Adobe.com. Just as Paulo, I need to have the debug player installed, but today I found a really annoying thing with this version: it cannot install the Breeze / Connect plugin as the normal Flash Player can. Due to this, I'll have to use Acrobat Connect with Parallels and XP. Would be great if Adobe could keep all versions up to date...

Anyway: the new Acrobat Connect service (formerly called Breeze) totally rocks! Saved my ass yesterday as I could sit and watch M4 while he implemented some changes to a script. Since I saw what he typed, I could instantly catch any errors that occurred. Brilliant! Saved me a load of time!

November 07, 2006

Back in the saddle

Came back from MAX last week where I had a blast of a time hangin' out with with David and Jeremy. I missed out on a couple sessions that I really wanted to attend (those by Jesse Warden and Chafic Kazoun), but I also got to meet a lot of folks I've only emailed with such as Ryan Stewart, Ted patrick, Alex Uhlmann, Christophe Coenraets, Kevin Hoyt, Nick Welloff and Jeremy Geelan from Sys-con Media. Looks like you'll find one or two of my articles in upcoming issues of Sys-con's WDDJ and maybe even an interview on sys-con.tv some time? Fun, but a little odd since I don't speak english natively and I don't like being in front of a camera :)

One of the articles you'll find in WDDJ (formerly called MXDJ) is about the upcoming fight over developers and how the Dreamweaver team has been sleeping in class. One great example of this is that since I cannot transfer my licenses for Adobe software to my MacBook, I'll experiment with other software such as this neat CSS editor (via Paulo). Adobe should really watch out, or Dreamweaver could start lagging far behind. They now have so much legacy code to maintain, that others can quickly become better at core features such as CSS editing and debugging. This is after all what we developers spend our time doing.

October 22, 2006

Just arrived in Vegas for MAX

Really looking forward to this event. The event itself will be huge (3000+ attendees) but seriously - The Venetian Hotel is insanely big. In just a few months time they'll have more than 7500 rooms and every room is a suite? The room I got is the size of a nice studio apartment with two beds, big bath, two TVs and a lounge area with both a sofa area, a round table area and a desk with fax and whatever is needed... Definetly the biggest hotel room I've ever stayed in so this starts out nicely. Now all I have to do is find David :)

October 09, 2006

3D in Flash

Now we're getting somewhere! Check out this demo of a 3D Rhino, exported from 3DS Max and rendered complete with textures in Flash. This demo was made by Carlos Ulloa Matesanz (Make sure you check out his spiffy 3D portfolio as well) using a 3D engine he's been working on for some time. You may have seen this engine in real life already at the Robbie Williams site RudeBox. It's been heavily optimized since then and Carlos also just announced that this engine will be Open Source, so I really look forward to test it!

September 19, 2006

Norwegian Flash 10 year party

Flashcake.jpgYesterday, I did a preso for my local Adobe User Group as part of the Norwegian Flash 10 year celebration. Before the session I made a small Keynote presentation that just cycled through screenshots from FutureSplash Animator/Flash 1 to Flash 8. I'm posting it here in case others need something similar and want to save the time installing all the trial versions. I found the first four over at Joen Amussen's blog and added the last 4 myself (Download Keynote file here). The main preso highlighted the different versions, the related software and important events (as seen by me). This presentation was in Norwegian so it's probably not that interesting for english speakers. I'll use bits of it for an article on Flashmagazine.com at some point.

We had huge cake with the Flash logo on, so there was more than enough to eat for the twentysomething that showed up. Socially, this was one of the better NAUG meetings as more than half the crowd joined us for beers and chat afterwards at "Den Gamle Majors Lab".

September 06, 2006

Playing with bitmapdata

I've always loved MP3 visualizers. I really like the beautiful patterns that race across the screen in tune with the music and so does my kids. Sometimes they even say "dad can we watch some music" :)

A couple months ago, there was a competition over at GotoAndLearn.com where Lee Brimelow asked for cool use of the computeSpectrum() method. I didn't have time to participate, but this eve I finally got to play with the BitmapData classes in Flash 8. (Note to self: make less webapps and more fun stuff!). It's nothing fancy, but I'm pleased with the looks and how simple it was to do it.


Looks pretty good for something less than one Kb (if the FPS counter is removed)? Guess I'll make an AS3 version next to see how that affects speed (+ add computeSpectrum support). Download FLA

August 28, 2006

Need a new phone, what to get?

My phone took the plunge this morning - literally. It fell to the floor as it tried to wake my up... Can anyone recommend me a good phone to play wiith Flash Lite applications on?

August 23, 2006

Photorealistic drawing in Flash

I remember seeing this site by VectorKid about 6 years ago. Awesome skills and he explains it all in tutorials on the site. The illustrations are still amazing and he's now published a tutorial book. Probably a great place to start if you want to learn illustration using Flash.

August 11, 2006

Happy Birthday

get_flash.gifYesterday was sort of the official birthday of Flash, so what better way to celebrate my own birthday (today) than checking out this excellent Breeze presentation wrapping up the last ten years of Flash with Kevin Lynch, Mike Downey, Mike Chambers and Eric Wittman? Interesting to hear how video in Flash came about as well. Makes me think back to Flash 3 - the time I decided to quit using Director and do Flash fulltime.

Flash is an important part of my life as it is both my job and my hobby. My greet on Flash's Birthday goes out to the man who made Flash initially and is still very much is the driving force: Jonathan Gay. Thank you so much for inventing Flash and making it what it is today! I couldn't do without it :)

Video from the 10 Year Party (by Mike Chambers):

Wish I was there...

August 06, 2006

Hah! I knew this was coming!

Great stuff! Andre Michelle (with others) has almost finished a MOD-player called 8bitboy. Now you can really start to think about implementing full-length audio in your Flash games without adding too much to the file size :)

While I was off on holiday, a lot of new info on manipulating sounds in Flash has come up. Just check out Andre's Scratch My Back. If sound can be manipulated as just numbers in an Array, I have a hard time seeing what would NOT be possible? A Flash based Sound Editor with effects such as delay and reverb? Keep at it guys! Now all I need is a couple days without client work...

PS: 3D in Flash is really moving forward these days! (I can't wait to see real 3D in Flash 10...)

June 14, 2006

MacBook experiences

So, I've had my MacBook Pro for a little more than two weeks and I thought I'd share my experiences using it for Flash development. The release of the BootCamp beta was my primary reason for switching and funny enough, I've only used it three times. The first time was for installing XP, CVS, Flash and FlashDevelop on it and the two other times was for playing C&C Generals. The second time, the whole machine froze and I had to reboot. A little discuraging, but BootCamp is after all in Beta so I guess I'll blame it on that. Paralells proved to be the solution for Flash development.

Continue reading "MacBook experiences" »

May 28, 2006

Testing MacBook compile times for Flash and FlashDevelop

The test results are in. I've tested my new 17" MacBook Pro (2,16Ghz CPU,2Gb RAM) using both BootCamp and Parallels against my Toshiba P20 (3Ghz P4 CPU, 1Gb RAM). The results are stunning.

I've tested three different projects, one of them was tested in both Flash 8 and FlashDevelop on all platforms for better comparison. The "Slideshow" app (tested in both FD and Flash) is a Slideshow Builder application made for a large Norwegian cultural institution. It's made up of 12 classes and 4 components. The CMS project is a full CMS done in Flash (22 classes, 17 components) and the 3D Graph is a small FD project based on the code in this tutorial (great read!). Here are the compile times:


(All numbers are seconds)

The main difference in the test machines apart from RAM and CPU is that the MacBook has a newer and much faster memory arcitechture. Much of the speed is probably related to this since it can move data to and from the processor much faster.

It's facinating to see that even using Parallels for emulation, the MacBook is much faster than the PC. I didn't expect that. The compile times for FlashDevelop speak for themselves. They are the reason I hardly use the Flash IDE anymore (5-10 times the speed of compiling in the Flash IDE). I'm sure Flex will get me back in, but there's no Mac version of Flex on Adobe Labs at the moment. I guess I'll use BootCamp or Parallels for that as well.

Update: I've added figures for the non-universal version of Flash 8 running on OSX since several wanted that. The numbers for that looks good for the Slideshow, but for some reason it slows down when compiling all the components in the CMS app? The reason I didn't test this initially is that all my licenses are on PC, so I won't be able to switch them over until next upgrade. Hopefully, that's when the Universal Binaries arrive.

The Toshiba was well spec'ed when I got it and it's still a good PC. The reason I'm getting a new machine is that I've worn it out. The mousepad is dead, the screen goes partially black and the battery time is less than 10 minutes so it's now more of a stationary than a portable.

How I tested

Every project was opened and compiled once. I then compiled it three times in a row and wrote up the average. The complie time is the time from I click the Test Movie option until the finished SWF shows up on screen. FlashDevelop had Verbose output turned on so that I could see the precise time used. Flash 8 was timed using a stopwatch since there's no similar option. With an average of three compile times, it will still be correct enough for comparision.

Some observations

Running BootCamp on a MacBook is just like using any other PC. BootCamp is in beta and there are some small snags such as keyboard mapping not being entirely correct. You'll hunt a bit until you figure out that it's mapped as if the Mac keyboard was a PC keyboard. This means that you'll find the @ sign at the key "2" and not on the @-key as it is on the Mac keyboard (yeah, the Mac has it's own @-key so there's no need to fiddle with AltGr+2). Not a big thing, but it'll be annoying over time so I hope they fix it for the next release. My initial report about C&C Generals playing fine wasn't quite correct. I had a spectacuar crash yesterday while playing. Had to do a full reset (Fun to play the old singleplayer missions again at even greater resolutions!)

Paralells is great! You can even install Windows 95, 98 and Linux there for testing. I'm definetly paying $40 for that possibility. It's also available for PC (without OSX support) so non-switchers can enjoy this treat as well. Only thing I have against it is the response time on the mouse. It's really laggy - enough to irritate you since it's not precise. I guess I'll just develop a habit of using the keyboard more often, but it would be great if the fixed this in the final version.

May 25, 2006

BootCamp and Paralells - first tests

I've had a little too much to do lately. Despite having a brand new MacBook Pro next to me on the table I've had to do client work. All work - no play, but today is a public holiday so I finally have some time on my hands! Installin BootCamp and Paralells was a breeze. Installing XP on these took it's time as usual, bt it worked perfectly. The driver disk made by the BootCamp software worked perfectly and all devices was up and running at first reboot. Perfect!

The first thing I did in Boot Camp was installing C&C Generals: Zero Hour since that's one of the games I play a lot. Worked like a charm and I´ve never had that good framerates on my gaming-PC (2Ghz Pentium M with 1 gig ram and ATI XT800 GPU). It was however odd to play a RTS game with only one mouse button :)

Next step: testing compile times with FlashDevelop on Paralells.

(This is also my first post from the MacBook. Something up with the apostrophes? hmmm)

May 23, 2006

I'm Switching to Mac

jcb_w_mac.jpgMy old Toshiba P20 has been great, but it weighs a full 5,5 kilos. It's also 2,5 years old and I've worn it out. The mousepad is dead and the screen has started failing so I needed a new machine. I had already decided on an Acer Travelmate 8100. Then came Apple's announcment of the new 17" MacBook Pro's. I was sold at once. It weighs about the same as the Acer, but has better hardware AND I can dual boot to play all the PC games I want :)

I'll start setting it up this evening and I'll post here about how it works for Flash development using Parallells (for emulation) and BootCamp. Can't wait for the Universal versions of all my Adobe software! Here is a pic of it on top of my Tosh. It's half the height, 3 cm smaller and it even looks smaller than Paulo's 15" Dell!

tosh_mac_dell.jpgJust picked up a XP disc as well, so I'm all set to try this out...

May 10, 2006

Odd MTASC issue

We just encountered an odd issue: if you try to set a variable in the class definition to a color value from a static class, Classes will fail to initialize as they should thus causing havok in our apps. Has anybody else encountered this or have an explanation?

Details: This bug has bugged the project I'm on for several occasions and Paulo just figured it out. The projects that had unexplainable problems all had one thing in common - they defined variables in the class definition and filled them from a Static Class where we stash all the colors used in the project. Since these technically are of the Number datatype, it should be safe to set them directly in the class definition, but for some reason this will cause odd and unexplainable behavior. Filling these variables in the constructor instead rectified the problem.

UPDATE: Nicolas Cannasse (author of MTASC) responded to this with a good answer when I posted it on FlashCoders.

May 04, 2006

Fun with Bodygrooming

Cool use of Flash video and pretty funny on this site. I'm sort of curious if this humor valid in the US as well or is this a subject one really doesn't discuss publicly? There's quite a difference in what one can show on TV here in Europe versus the US. Is this ad campaign too private for most americans? (via Paulo)

April 27, 2006

Swap IconBuffet Icons?

iconbuffet.jpg
As a coder, I'm not too artistic but I have a small trick to make my apps look good. It's called IconBuffet and I have two of their commercial Icon sets. Stylish and Professional are probably the words describing them the best. Considering what you get, they're really cheap but they also have a free service that will get you a bunch of icons that you'll probably never use, but they're "nice to have" and you just "might" need them one day. Following up on this entry, here's my list of what icons I have and what I can offer in return.

I've collected the free icons for some time but I'm still missing these:
Durango Research
Manhattan Night Life
Modena Alfanumerico Cold
Shanghai Tech Vector
Taipei Buddies 1
Taipei Buddies 2
Tower Grove Wedding

If you have one of these, send it to "nospam (at) netron.no" along with an email of wich you want me to send you back.

These are the 15 icon sets I can swap back:
Blinksale (5)
Dresden Tournament (1)
Farewell Snow (5)
Helsinki Hi-Fi (5)
Mallow Buzz 1 (4)
Mallow Buzz 2 (5)
Manhattan Metroplex (5)
Manhattan Finance (5)
Manhattan Veggie (4)
Marseilles Cafe (3)
Modena Simbolo(4)
Oslo Atmosphere (5)
Oslo Easter (5)
Oslo Finance (5)
Shanghai Tech (0)
Shanghai Tech Smilies (5)
Taipei Monkey (5)
Taipei Night Market (5)
Taipei Plastic Primates (4)
Tower Grove Melee (2)
Tower Grove Promenade (5)

(x) = deliveries remaining

February 24, 2006

Skinning the Flash DataGrid (Part 2)

I keep fighting to make my DataGrid look just like my Ad agency desires and todays biggest problem was a bug in the DataGrid component that renders the "backgroundColor" style for it useless. No matter what color I set, it turns up as the same shade of red... How to get around that then? I could start digging around the class files again, but it didn't feel too tempting. What other solutions are there then?

After some searching around, what looked the best was the $5 DataGrid extensions by Tufat (and Darren Gates?). At $5, it's almost too cheap? Anyway - it's a great extension that offers sorting numerically (how could MM omit that?), HTML display, editing, text wrapping, turning off the gridlines and much more. It even gives you proper coloring of rows that allow you to combine alternating rowcolors and custom column colors. The $5 gives you not only a SWC, but the full Source Code as classes so you can modify them as you like. Very neat!

Only problem is that when I extend it, my checkbox cellrenderer fails to render properly. Oh well. Working on it... :)

February 22, 2006

Extending the Macromedia V2 Components

Lesson learned: When extending the V2 components, it is not enough just to construct the new class using the "extends" keyword like this:

class my.Components.MyDataGrid extends DataGrid
{
  function MyDataGrid()
  {
    trace("MyDataGrid instance created with scope "+this);
  }
}

To successfully extend the components you will need two things. One is a set of static variables that the component structure requires. The other is some exported symbols that will be referenced in the variables.

class my.Components.MyDataGrid extends DataGrid
{
  static var symbolOwner : Object = MyDataGrid;
  static var symbolName : String = "MyDataGrid";
  function MyDataGrid()
  {
    trace("MyDataGrid instance created with scope "+this);
  }
}

"symbolName" must be the same as the export ID in your library.
"symbolOwner" should be the base name of your class.

Next, create a FLA containing the component we're extending (DataGrid) and an empty movieClip with the identifier (Export ID) specified in "symbolName". The symbol should also link to the AS2 class using full path: my.Components.MyDataGrid. If you're using FlashDevelop, just add the exported SWF and select "Add to Library".

Now your extended class is ready to do it's job. Just add any methods you want to over-ride or any additional functionality required.

February 20, 2006

Stream from any point in a FLV using PHP

Cool script that allow you to seek in FLV files on a server (posted for future reference).

February 17, 2006

If in doubt - wait one frame

I don't remember who said it first, but it may have been Sam Wan at a Flashforward conference. Many things we do in Flash are based on timing. If a movieClip is not present just when you think it should be, you'll run into trouble. You'll run into this quite often when using Components. You instantiate a component, but it's really not there until the Flash movie has gotten time to redraw. Here's a utility class I've written to work around this problem. It's really simple to use and it cleans up after itself. One could solve this using Intervals, but that comes with a whole new set of issues, so I prefer this way for now. (I have heard that there is a fix for cleaning up intervals though, but I haven't seen that posted anywhere)

Continue reading "If in doubt - wait one frame" »

Skinning the Flash DataGrid

transp_datagrid.jpgFor a current project, I needed a datagrid with partially transparent rows. No problem I thought - I'll just extend the V2 datagrid and write my own versions of the required methods. All so simple in theory, not so simple in real life. There are two things that must be made transparent, the general component background and the background of each row. I first tried overwriting the methods I thought to control this but that did not work. The one who made the datagrid never thought that anyone would ever want partially transparent gridrows. The component just does not contain any code that enables this. Another thing is that no matter what you do, you cannot re-pack or alter the datagrid assets that are used to draw the grid.

Continue reading "Skinning the Flash DataGrid" »

February 13, 2006

Dumbest Dreamweaver error ever...

wtf.gifDreamweaver MX04 has been a real drag to work with. Every time I restarted my machine, I had to start Dreamweaver, force-quit it, wait for the program to close and then restart it. It's got something to do with the Flash movie in the startup screen. Today I got a wicked error message that made me yell out loud: "No error occured"... I mean - I know the program isn't the best piece of code written by Macromedia, but honestly - why on earth tell me that no error occured???

My friend Chris coined it perfectly! "Dreamweaver MX04: Winning heart and minds - one strange bug at a time". Gotta start using DW8 now that they've delivered the first patch for it...

January 12, 2006

Using CVS/Subversion with Flash

Working with CVS and Flash for a project these days and needed a way to create a linked folder (not shortcut). I vaguely remembered a post from Christian Cantrell about this. Posting it here for future reference. (Feel free to leave a comment if you know of other similar solutions.) I've been wanting to use CVS for Netron's larger Flash projects, but never got around to it until now.

For my current project, we use CVS with the TortoiseCVS client, but I've also signed up for a Subversion account with CVSDude where we'll keep the internal Netron projects using Tortoise SVN. CVSDude is great not only for the Source Control, but also for the extras they offer. We've set up Trac, a system that is both a Wiki, bugtracker and a repository browser. The bugtracker is simplistic, but sufficient. Really nice to have all these functions in one single system.

Interesting thing to note when choosing between CVS and Subversion: setting up Subversion clients is way less "hackish" than CVS. Probably since Subversion originally was created to correct certain flaws in CVS. Now that I've used both for some time, I feel that Subversion is "the future" and CVS "the past". Many small snags with CVS and just one big that is easily avoidable with Subversion (Don't use the Berkley DB solution)

January 06, 2006

Control hardware using Flash

Want to make your own Flash-based access-control system using RF ID tags? How about a custom LCD display showing the state of your Flash-app? Found a cool link the other day to Phidgets, a company that makes a bunch of cool electronics that one can control via a webservice using Flash, Java, C++ or other programming languages. Slightly pricey, but looks like fun. Teleo is another contender in that market that David did a review of some time back.

December 16, 2005

Using JSON

Been using the actionscript JSON class from JSON.org and found a bug in the implementation. If you're getting exponential numbers from your JSON service, an error is thrown. Something like this will cause you grief:

{
"bigNumber":1.513e8
}

Found a way to bypass this, but using such numbers severely affects the stability of Flash 8. I've had Flash 8 disappear instantly after compiling code with such numbers. For some reason, this gets better after you save your file? No idea why, but it's a thing to look out for.

My rewite is really simple. On line 268 (number-function) I've added this:

while (this.next() && (ch>='0' && ch<='9') || ch=='E'  || ch=='e' || ch=='-' || ch=='+') {

November 18, 2005

Making Treeviews look good

Just adding the finishing touches to our Flash based CMS named FlashPublish. One of the most important components is a treeview allowing you to drag and drop documents to reorganize your website quickly. I first used the Macromedia Treeview Component, but that really lacks a lot of the features I need. I then turned to my favorite component set from Ghostwire. It has a treeview that is really easy to use, but it doesn't support drag and drop operations and it's AS1 only. Finally I bought the dndTreeview for $29. Concidering that fairly low price and the possibilities it offers, it's amazing.

As opposed to the Ghostwire components, the dndTreeview is just a class that extends the built in Treeview from Macromedia, adding all the stuff you'd need. The docs are a bit sketchy, but the email support is excellent. Just for future reference and for others to use. Here's some tricks learned when working with it.

Continue reading "Making Treeviews look good" »

November 03, 2005

See the future! Get Flash player 8.5 and Flex...

Andre Michelle has been busy playing with AS3 lately. Thousands of pixels swarming across the screen just like in a MP3 vizualizer and a really fast raycasting engine This is something totally different than the first Wolfenstein copy! I had 30fps+ at 1024x768 pixels resolution! That's speed!

I finally had an evening off from work (just crazy these days!) and installed the Flex 2 alpha along with the Flash 8.5 player. I didn't want to install alpha-software on my primary machine so I'm using my gaming PC for this. Will start browsing Franto's collection of AS3 samples next, but the speed of this alpha software is amazing! Andre's sample with 150 balls collision testing plays back at 65fps with less than 1% CPU usage. WOW!
(Might even get an hour or two to play with Flex tomorrow if I'm lucky. Really looking forward to it!)

October 31, 2005

Flashy Halloween!

pumpkin.jpgToday is Halloween. In case you didn't dress up and visit the neighbours, here's a treat for you: a very well done Interactive Pumpkin-thing.

I ran out of candy early this year. Seems there's more and more kids every year. Halloween is an american tradition but kids everywhere grab the opportunity to get some extra candy - also in Norway where I live :)

Just saw JD linking to this story at CNN. While I do understand President Hugo Chavez's concern, I must say that I feel that almost any excuse is a good one when it comes to candy (My fav movie this year by far).

October 25, 2005

Totally cracked me up!

Make sure you don't miss this one! Flash as a Superhero (nicknamed "Mesh"!). "They're not very computer savvy - they just want to see some video online" almost made me fall off my chair !
(Via ColdHardFlash - a brilliant place to stay updated on Flash Animation!)

October 11, 2005

Re-opening a treeview after refreshing it

Ever used a treeview-component for dynamic content? When the underlying data changes you send it off to the server and then update the tree with the result from the server. Problem is: all the nodes you opened are now collapsed... Wouldn't it be nice to have the tree open to the state it was before the refresh? Here's one way to solve it.

Continue reading "Re-opening a treeview after refreshing it" »

October 04, 2005

MAX is such a ripoff

I'm not talking about Macromedia MAX - the conference that is just two weeks away. That will probably be a brilliant venue! I'm talking about Microsoft MAX - a blatant ripoff from Apple's iPhoto. Having watched the Sparkle/Avalon presentation with Mano, I had really high hopes for the first publicly released (beta) software based on WinFX and the new architecture. I was SO disappointed!

Continue reading "MAX is such a ripoff" »

October 02, 2005

Testing Slideshow Pro

Testing the excellent SlideShow Pro component by Todd Dominey, using images from the Broken Saints DVD review I did some time ago:



Really easy to setup and use. Pretty flexible too. I'll be testing ImageVue by Karl Ward later as well.

September 29, 2005

Texfield Wrangling

Textfields in Flash are not all they could be to say the least. Today I spent 2 hrs trying to debug an application that does funky things to HTML in textfields. My conclusion this far: Flash is actually changing what I set the htmlText property to just as it pleases. No matter what SIZE I use in the FONT-tags, Flash will replace whatever my size with it's own number - 11.

I'm inputting this HTML:

<P ALIGN="LEFT">
<FONT FACE="Helvetica, Arial, sans-serif" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">
<B>dcfg fdsgfd sgfdsgf ds</B>
</FONT>
</P>

For some reason this turns into this:

<P ALIGN="LEFT">
<FONT FACE="Helvetica, Arial, sans-serif" SIZE="11" COLOR="#000000" LETTERSPACING="0" KERNING="0">
<B>dcfg fdsgfd sgfdsgf ds</B>
<FONT SIZE="18">
</FONT>
</FONT>
</P>

Notice the font-tag at the end. My size info moved there? Anybody ever experienced something similar?

PS: if you think the HTML look ugly (non standard), this is the only kind of HTML that Flash is using. Capital letters on all tags and less than standard sizing to say the least.

September 24, 2005

IKEA 360 Kitchen viewer

This new IKEA minisite takes an "old" idea from the Matrix movies and implements it in a beautiful way. It is in fact so beautiful that you instantly start exploring and playing with it. Brilliant use of Flash Video! It's very seldom I see something genuinely new like this in the field of advertising.

When I saw this ad I thought "Darn! I could have come up with such an idea if given the chance". Online advertising is in many ways the stepchild of the business. The success of an online campaign is much easier measured than other media and the media has a solid future ahead. I just read that a video on CNN is seen by about 150.000, but more than 3 million will see the same video on their website (via JD). If the shift in viewership is that dramatic, why doesen't the advertising business go after this crowd?

Continue reading "IKEA 360 Kitchen viewer" »

September 23, 2005

Garbage collection in Flash

(Yet another) Great post by Tinic Uro about the new garbage collection in Flash Player 8. I'll test this later today working on an app that has a memory leak, so I'm excited that this have been changed! Maybe the new method will prevent the leak? If you do Flash programming and haven't read Tinic's blog already, make sure you read some of the older posts too. Brilliant stuff that really explains the new features and the hurdles implementing them.

September 20, 2005

Get Opera free?

It's true. Just weeks after the 10 year anniversary giveaway, Opera has decided that "reach" is a good thing rather than pennies. Now they are giving away the ad-free version as well. Go grab one here.

September 14, 2005

Some nifty AS2 classes

Found a nice site with some nifty Open Source AS2 code. I especially like the Array2, MovieClip2 and TextField2 extensions. They add the features I often miss using these objects in Flash. The "JSFL Batch Image Quailty"-extension could have saved me some hours if I knew about it. Good stuff.

September 13, 2005

Flash 8 is out!

Now you can go to Macromedia and download! Flash 8, Dreamweaver 8 and Fireworks 8 is all available for download. If you want to buy, use this link to support Flashmagazine.

Since I am Press through my pet project Flashmagazine.com I've had Studio 8 for quite some time already. Unfortunatly I got a bad case of meningitis last month so I have not been able to play as much as I wanted. Still: this is by far the best version of Flash to work with ever! Macromedia have really listened to developers this time around - it's not just something they say. Just download and start working with it, and you'll see what I mean. THere is so many small and big things that makes the Flash 8 IDE so much better to work with. The Flash MX2004 IDE was actually so bad that it delayed AS2 takeup, at least on my part. Flash 8 just feels really solid :)

August 30, 2005

No more ads in Opera?

All the stuff I make, be it Flash or CSS, I always test it using IE, FireFox and Opera. Opera is by far the most standards-capable browser out there, but I've chosen FireFox for my daily browsing. As part of the 10-year online anniversary party, Opera Software is giving away licenses, but only today so hurry! Just visit this URL and register your Opera browser today and you'll never see an ad again...