February 2004 Archives

MXDU, Sydney... farewell!

| 3 Comments

What an amazing experience this week has turned out to be. I didn't get a chance to record as much of the conference on here as I would've liked, but I blame that on flaky dial up connections and being absorbed into the "see as much as possible before you leave" mindframe. Sean did a much better job than I.

The conference itself was spectacular. There were a lot of great presentations and much was shared about Flex, Breeze, CF BlackStone, and of course Central. Flash was not left out, being as it's the technology that really ties everything else together and every application seems to touch.

As a speaker, the most enjoyable part of the conference for me was socializing at the bloggers dinner and then the speaker's barbeque the following night at Daemon. It's great to finally be able to put names to faces, though I think I spent a little too much time with Peter and Guy. There were a few times where I caught myself talking with a hint of a British accent, and I even let "bloody" slip in as an adjective. I thought for sure I would've used "crikey" first...

All in all, Sydney was an amazing experience. I leave tomorrow, so I have another night yet to enjoy my time down under. I'll probably be creating a photo gallery at some point - I have something like 400 photos, but most of them are "tourist" things and not really of the conference. I'm not sure many people would be interested in my random pictures throughout Sydney, but there are definitely a few that I want to share.

Next week, it's back to ActionScript 24/7, but this vacation was enjoyable and the time off was very refreshing.

Did I mention I'm working on an ActionScript -> bytecode compiler? I've spoken to a few people about it at the conference.. everyone seems to be pretty excited about it. I'll post more about that when I get back home. My language of choice for the project is Java -- I want to be able to compile ActionScript under Linux so I can stop using Windows for good.

A special thanks goes out to Geoff and the entire Daemon crew. You all rock. Thanks for inviting me down to participate. It's been really great, though I never did find Nemo...

G'day mates

| 5 Comments

Today MXDU is on in full force. It's lunch time right now, and I'm not entirely sure what I'm eating, but whatever it is, it's really good! I think I can really get used to Australian food.. There's also wireless access at the Star City Hotel, which is enabling me to enter this quick update.

I just finished giving my presentation before lunch, and I think it went rather well. The problem with OOP is that there's just so much to cover. It's hard to fit all of the concepts into a single hour session. I did my best, though I think I talked a little fast and skipped around a bit at the end. I didn't get to show as many examples as I would've liked, but after the conference is over I have a lot of example files to share with everyone to help them in understanding the information.

Branden's presentation this morning on being a pragmatic ActionScripter was great, as always. He talked a lot about using all of the tools you have available and picking the best tool for the job. In the end, you get paid when it works and the project is complete, so use what you have at your disposal to make development as easy as possible for you. Re-use code where you can as well.

Well, that's it for now.. I have to finish lunch and get to another session. If you see me, say hi! I'll try and post some pictures tonight when I get to my hotel room...

It is time...

| 6 Comments

P. Sherman, 42 Wallaby Way, Sydney... I'm coming to find you Nemo!

Like some others, I'll be keeping track of my adventures at MXDU. The conference is on Tuesday and Wednesday, but I'll be spending the entire week in Sydney taking a bit of a vacation as well and trying to see everything I can see on the other side of the world.

My session is on Tuesday at 12:00pm, right before lunch. Branden is going to be a tough act to follow, but I'll do my best! My session is on Obect Oriented Programming with ActionScript 2.0. It's meant to be an introduction to OOP using some of the new language elements of ActionScript 2.0.

I hope to see a lot of people there, and I'm looking forward to the trip. It should be a great conference! Stay tuned for some pictures and various updates throughout next week...

ActionScript 2 Class Library

| 4 Comments

I just came across this the other day - an ActionScript 2 class library. Most of the classes in there are math related, but it looks like there are ADT's and other good stuff. I'm almost ashamed that I didn't know about this sooner...

To see how to use a class, click on it's "view" link in the datagrid. Clicking on the class name will allow you to download the .as file. The buttons at the bottom will let you download the packages in a .zip file.

Also, the width in the object/embed tags is listed as 70 and everything is a little hard to read in Mozilla-based browsers. When I used IE, it was easier to navigate around.

You can check it out here.

Flash Player 8 wishlist

| 22 Comments

With Charlie announcing his break up with Flash and Aral commenting on the seriousness of it, I thought it would be a good time to mention a few things that I would like to see in the next iteration of Flash to prevent this from happening in the future.

As a developer dealing with Flash on a consistent basis, there are some things that I feel Macromedia can improve upon in the next version. I only have a few things on my list, but I'm hoping other people from the community will chime in and add to it. Come to think of it, Ted mentioned something as well that is also #1 on my list.

Here goes!

  1. A Threading engine. This can be as simple as just having a separate Data thread, but something needs to be done about the 15-second timeout besides just increasing the length of it. Whenever you deal with large amounts of data you get the nasty side effect of having your entire UI become unresponsive. For an application, response times are critical. If Flash is looking for more and continued success in the RIA market, there needs to be a way to keep the UI responsive at all times and avoid script timeouts when dealing with large amounts of data or doing intensive processing. Having to create "safe loops" is a workaround that should not be necessary.
  2. UI Components/HTML support. I'd love to have the ability to create native OS widgets inside of Flash, eliminating the current v2 component set almost completely. By native, I'm thinking of Java SWT but I think that's a little unrealistic for the Flash Player. However, if you need to create an input field wouldn't it be nice if it was as simple as using the input tag? The TextInput component weighs in at 24k, and that’s a little hard to swallow - especially since Forms was a big buzzword for MX 2004 and you create those input forms with a handful of the v2 components... Also, do I even need to mention support for HTML tags like sub and sup?
  3. Synchronous calls for fscommand and remoting/webservices. Rather than having to deal with callbacks, it would be nice to have the option to specify execution mode (I'm thinking C# here). I would like the choice of either making a synchronous call to a remote server and have Flash block until a result is returned, or making an asynchronous call and be notified of the result via a callback. Dealing with a lot of callbacks can be cumbersome.
  4. Operator overloading. This is an enhancement to the ActionScript compiler, and is somewhat linked to method overloading. I would like to have the ability to define a method such as operator+, and have that called implicity whenever Flash came upon code like "classA + classB." If used correctly, the readability benefits are wonderful. Of course, I come from a C++ background, so I'm used to having this functionality available.

These are just a few things I'm thinking about . Some of what I'd like to see is a little ambitious, but I'm hoping this will at least spark some discussion.

I'm also not sure that I understand Macromedia's vision with Central, but I'll save that for another day...

Design Tweakage

| 8 Comments

I finally got fed up with using a default style from movable type. Over the weekend I found took some time and created a new design. I hope you like how things have changed around here!

I'm not very much of a designer - my skills in coding far outweigh my design skills, but I wanted to create something simple and a little nicer on the eyes. The default template was alright, but a lot of people were using it and I didn't want my weblog to get confused with anyone else's. Hopefully I've succeeded in creating a smooth template... although the white text in the header may be a little hard to read.

I haven't done extensive browser testing with the new design. It looks right in Mozilla and IE 6 on my PC. However, IE 6 doesn't always render the border element correctly on the individual archive and monthly archive pages. If you scroll the page down, and then scroll back up, the border magically appears. I'd report it as a bug, but I doubt they'd ever fix it.

I believe the site looks alright on IE 5.2 on the Mac, but I haven't tested that completely. If you see anything out of whack, please let me know so I can tweak the CSS a bit. I'm concerned about the display of my code blocks the most.

I also used the Monotype Corsiva font for the date text. I don't believe this font is available for the Mac, so at some point I'll be embedding the font in a Flash movie, and using that to display the text.

In theory, I can embed the font outlines in a dynamic text field and then pass in the text to display as a flashVar in the object/embed tags. I'm not quite sure how that will work with the CSS support and if it will display like I want it to... I'll probably just resort to picking a more common font, but I liked the "elegance" of the cursive writing.

So what do you think? Be gentle, I'm not a designer. :-)

Tweening got you down?

| 4 Comments

Just in case you missed the thread on FlashCoders... Ladislav Zigo has compiled an excellent page that you need to visit if you've ever wanted to tween with ActionScript - Tweening classes and prototypes benchmarked.

The page allows you to see the various tween engines in action, and offers the source code fo download as well. Each tween test offers an avarage frames per second calculation when the test is complete for comparison purposes. The difference between some of the engines is pretty astounding.

While you're at it, also check out the Custom Easing function generator Ladislav made as well. It's a great way to visually create your tween to get exactly the effect that you're looking for.

Excellent work Ladislav!

Context Menus are great, but...

| 13 Comments

One of the coolest new features in Flash Player 7 is the support for context menus. With most of the buzz centered around the new and improved version of ActionScript, this little nugget could easily slip through the cracks. However, the user experience that it brings to RIA's is too important not to elaborate on.

As a Windows user, I'm used to right-clicking on everything. It's great to see this functionality finally available to Flash developers as well. Now the RIA experience can more closely mimic that of the desktop environment.

For example, I just built an application centered around the data grid. Users familiar with a similar desktop application had the opportunity to right-click on a row and select properties, or delete the row entirely. I was able to mimic this functionality in Flash almost exactly.. but I ran into two limitations of context menus.

  • Context menus cannot be specified for clips not directly on the stage. This is kind of a bummer as you can't specify a context menu for a nested MovieClip.
  • Context menus cannot have "Delete" as a menu item. You can add "Delete" as an item, however, it won't display in the menu. I thought this was a little strange and that maybe it was related to delete being a reserved word. After some testing ("class", "interface", etc), it looks like the other reserved words can be used just fine as menu items. Interesting... I changed "Delete" to "Delete Item" and the code worked fine. EDIT: Thanks to Erik Bianchi for pointing out that delete is a built in item, and you can't duplicate built-in items.

In Windows, when you right click on a row in a grid, that row becomes the selected row. In Flash, this wasn't the case. I had to use a little bit of coding magic to get roughly the same effect. Here goes!

// on stage: info_dg - datagrid,  status_txt - dynamic text

// create a context menu
var cm:ContextMenu = new ContextMenu();
cm.hideBuiltInItems();
// add "delete item" to the menu - "delete" won't work as a label
cm.customItems.push(new ContextMenuItem("Delete Item", onDeleteSelected));

// called when "Delete Item" is selected in the data grid
function onDeleteSelected() {
	// trick the datagrid into thinking the mouse was released so that
	// moving the mouse doesn't scroll the grid
	info_dg.onMouseUp();
	
	// display a message
	status_txt.text = "You chose to delete:" + info_dg.selectedItem.item;
}

// called before the context menu is first displayed
cm.onSelect = function(info_dg) {
	// select the "lastOver" row when we right-click, but only
	// if it is not already selected
	if (info_dg.selectedIndex - info_dg.vPosition != info_dg.lastOver) {
		info_dg.onRowPress(info_dg.lastOver);
	}
}

// called when a row is rolled over
itemRollOver = change = function(eventObj) {
	// get the index of rolled over row, and adjust for scroll position
	// if the datagrid was scrolled vertically.  store it in a "lastOver" 
	// variable

	// change uses selectedIndex, itemRollOver uses index
	var tmpIndex;
	if (eventObj.type == "change") {
		tmpIndex = eventObj.target.selectedIndex;
	} else {
		tmpIndex = eventObj.index;
	}
	eventObj.target.lastOver = tmpIndex - eventObj.target.vPosition;
}

// update the lastOver row when the selected row changes or when
// a row is rolled over
info_dg.addEventListener("change", this);
info_dg.addEventListener("itemRollOver", this);

// add some data
office_items = ["Stapler", "Rubber Band", "Thumb Tack", "Notebook", "Pen", "Pencil", "Phone"];
my_dp = new Array();
for (var i = 0; i < office_items.length; i++) {
	my_dp.push({item:office_items[i]});
}
info_dg.dataProvider = my_dp;

// set up the context menu
info_dg["menu"] = cm;

The final product looks like this:


Sorry I can't offer a .fla for this one - the Data Grid is for Flash Professional only, and I don't have the ability to distribute it.

Enjoy!

Flex.org - The Directory for Flex

Archives