Wednesday, December 21, 2005

scrollRect : easy 'masking'

Before Flash 8, if you wanted to create a window with scrollable content, you'd have to mask the content. I always felt a little uncomfortable using this approach.
In Flash 8 you can use the new movieclip.scrollRect property.
There is an easy copy/paste example in the help files, but this is what it comes down to :

import flash.geom.Rectangle;
var container:MovieClip = mclip;
var window:Rectangle = new Rectangle(100, 0, 200, 40);
container.scrollRect = window;

mclip in this example is my 'content' movieclip in my scene. By using .scrollRect, mclip will be 'masked' according to the Rectangle properties.

Nice and clean...

Wednesday, December 14, 2005

Flash snow

I helped out a friend with her website, who wanted her site in a Christmas theme.
So i made some actionscript powered snow... i like the result very much.
Things like this are not so hard to make, but i guess it's the small details that make it nice.

Check it out here : http://www.gingerfantasies.nl/

Thursday, December 01, 2005

DateChooser as event Calendar

I was looking for a way to use an easy calendar in a project i'm working on.
I haven't found a direct way, but we do have the DateChooser available.

The DateChooser class allows you to specify "disabledRanges".
For normal use as a date chooser, this means the user cannot select a certain date or range of dates.
But if want to use this as an event calender, you can set all dates to disabled and only enable the event dates, resulting in a very acceptable event calendar!
When the user selects an enabled date (use a listener), you can display the events for that date.

Hope this little tip helps someone...

flash or no flash?

It's amazing, but i still hear the same arguments to not choose for flash when developing websites. The same arguments as i heard when we were at version 4 of the flash player!
Like these :

1. Backbutton functionality doesn't work.
2. You can't deeplink with a flash site.
3. You can't use the regular right mousebutton functionalities.
4. It's difficult to maintain.
5. Text looks like crap.
6. There is too much movement going on.
7. A plugin needs to be installed.
8. Google can't index you.
9. Scrollwheel functionality.
...

People who come with these arguments obviously are still in the previous century.

If you know what you're doing, you can develop a full flash site, with coverage of all of these arguments (except for the plugin requirement).

1. Backbutton.

Allthough still a little problematic, i got this to work just fine, using a simple script in javascript, combined with 4 lines of php.

2. Deeplinking.

Using anchor tags in your adress, with a little javascript, you can make deeplinking to work. I do have a problem with this in Firefox, where i have to disable the automatic changing of the browsers adress or the backbutton solution won't work. But i'm sure a solution will present itself. The underlying idea is solid.

3. Contect menu

From Flash player 7 and up you can change the contents of the right mouse button in flash to display any functionality you'd want to offer your users.

4. It's difficult to maintain.

Any site where you mix the presentation and data(information) layers, will become unmaintainable.
If you use xml for storing your data, or perhaps a combination php and mysql, you can seperate data from presentation, resulting in a very maintainable situation.

5 Text quality

One of my absolute favorite improvements of the new flash 8 player is it's quality of rendered text. I even prefer this quality over how my fonts look in Photoshop!
For me a reason to start developing for flash 8 immediatly!

6. There is too much movement going on.

This is such a strange argument. There is exactly as much movement as the developer has put in there! Maybe even by request of a client...
So it's up to yourself what you do and do not move! A good developer will try to find the right balance in this.

7. A plugin needs to be installed.

This one is true. But it doesn't seem to be that much of a problem. Since the flash 7 player pervasiveness got all the way up to 97 percent or so, we can use the flash 7 player to upgrade to the next version(s). Besides, most people know and trust Macromedia and will install the player.

8 Search engines.

If you seperate your content(data) from your presentation, by for instance using xml, you can make pages of this data that google can index. Then redirect users to your flash page, with the right deeplinking and voila! .........

9 Scrollwheel functionality.

For a while now you can monitor the mousewheel within flash. It's one line of javascript to communicate this activity to the browser.


I really felt like writing this down. Because if you do want to discredit my favorite technology, try to be up to date!
Flash for me is a lovely experience, not only with well designed sites, but for me personally also to develop in !

If you want to see some of these arguments discredited in an example, look at www.dylanfrancis.nl a flash 8 site with the backbutton functionality working, deeplinking working, etc... And just look at the quality of the fonts!