Creating Transparent Native Windows with the mx:Window Class

Holy hell. I’ve been tearing my hair out all night trying to figure out how to make a fully transparent and chrome-less native window using the mx:Window class. Luckily, thanks to Bradical from this post, I found the solution. You just need to set showFlexChrome equal to False in your mx:Window component. So quick mini-tutorial for anyone doing custom chrome/transparent native windows:

If you’re looking at a lot of AIR documentation you’ll probably see references to a NativeWindow class and think that’s what you want to use to create a new native window. If you’re doing Flex work however, you won’t be able to add any components from the Flex Framework to that NativeWindow because NativeWindow is a Flash class and doesn’t include the Flex (mx) libraries. So what you’ll want to do instead is create a custom component that extends mx:Window:

<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" width="200" height="75"
	styleName="chromeless" layout="absolute" verticalAlign="middle"
	horizontalAlign="center">
	<mx:Style>
		.chromeless
		{
			showFlexChrome: false;
			background-image: "";
			background-color: "";
			padding: 0px;
		}
	</mx:Style>
	<mx:Image source="@Embed('assets/notifier.png')" id="background" />
	<mx:Label id="lbl" color="#ffffff" fontSize="20"
		textAlign="center" top="25" bottom="25" right="0" left="0" />
</mx:Window>

Notice I set up a style called chromeless, knocked out the background image/color and set the padding to zero like any other custom chrome application, but I’ve also set the showFlexChrome property to false. Now you’re good to go and you can start using all of the Flex Framework in your native window. In this case I’m setting the other native window chrome properties when I actually create the window (in my main Application file):

	public function createNewWindow() : void
	{
		var win : NotificationWindow = new NotificationWindow();
		win.systemChrome = NativeWindowSystemChrome.NONE;
		win.type = NativeWindowType.LIGHTWEIGHT;
		win.transparent = true;
		win.open(true);
         }

NotificationWindow is just the name of my MXML component (NotifyWindow.mxml) and I can set the system chrome options in that file directly, or on creation like I did above. If you’re going to be using the same chrome settings for your custom native window class, it’s probably easiest just to set the system chrome options inside your component.

Hope that helps other folks, and a huge thanks to Bradical, wherever you are!

Free Copy of Photoshop for Mac to the First Commentor

PhotoshopIf you’re reading my blog on a Saturday, I think that’s pretty cool, so if you’re a Mac user, I want to give you a free copy of Photoshop CS3. Adobe has a cool software program for employees and my brother wanted a copy of Photoshop. Unfortunately I ordered the Mac version instead of the Windows version that he needs. So I’ve got a Mac version of Photoshop lying around that I can’t use. So whoever gets the first comment gets it. I’ll email you to get your address.

Have a good weekend!

[tags]Photoshop, Giveaway[/tags]

Doh! No MAX For Me

It’s looking less and less likely that I’ll be able to go to MAX this year. It’s a great conference, and I’m kind of bummed about missing it (and reneging on my beer buying for listeners of the ColdFusion Podcast) but work is extremely crazy and the registration price tag (though worth it) is a lot to cover when all the costs are taken into account. Combine that with the fact that September is shaping up to be a heavy “professional soul searching” month for me and the price tag starts looking even higher when things may have totally changed on my side.

Luckily the Early Bird Pricing is available until September 2006, so things here may solidify and I may be able to go. I’ll keep you updated, but if you are definitely going, drop me a line via email (or comments). The social part is always the most fun and weighs heavily on the decision.

Partying with Flash in Seattle

The Tech Crunch party last night here in Seattle was awesome. Great, great time (John Cook of the Seattle P-I has a good write-up). Things I noticed in reverse order of importance:

- Chris Prillo is very, very small. I’m pretty short at 5’8″, so I kind of live in a glass house, but the guy is tiny.

- Michael Arrington is a really nice guy. Even at 10:00 after he’d been bombarded with startup after startup, he was going strong. He’s also got a pretty sharp wit. I wasn’t sure what to expect, but it was great to meet him. I hope he’s back in Seattle soon.

- I finally met Bryan Zug.

- Flash is the king of Seattle. I was blown away, but everyone is using Flash and everyone loves it. Redfin and Farecast, two of the hosts, are big Flash users. I talked to the main developers for each of the apps and they have a ton of great ideas and enhancements coming down the pipeline. It’s going to be exciting to track these companies.

- Random people love Flex. Everyone is pumped about Flex 2. I was doubtful that Adobe had gotten the message out, but almost everyone I talked to knew about Flex 2, knew it was free, and most of them had taken time to play with it. If it’s possible, I’m even more excited about having Flex 2 released. Smart people are going to create some great applications. Combine that with Apollo……well that’s just too much excitement for one post.

The Downside of Professional Blogging

Blogging over at ZDNet has been a blast, and even though I’ve been neglecting this blog a bit, it’s allowed me to branch out a bit and take a look at a lot of different things. People tend to respond to my emails more now ;) . All in all, it’s been great, and I’m having a lot of fun with it. Today however, I got my first jolt of reality.

I want the innocent to remain nameless, but I emailed someone about talking with them about their project. It’s a pretty big deal, and I didn’t think I’d hear anything, but I wanted to see if they were free to talk over beers sometime. The person emailed me back and sounded happy to get together. We were in the process of setting up a time when I get this email:

Hey Ryan, I just found out that I cannot meet with you since you are “press”. I?m going to forward your mail on to our team?s PR contact. I?m sorry about this.

It’s difficult for me to think of myself as “press”. I’m just a guy who is really passionate about RIAs and is very enthusiastic about how they’re evolving. The person seemed genuinely disappointed, and the press person who contacted me was very nice, but it was still a bit of a shock. I suppose it’s something I’ll just have to get used to.

Skype is Awesome

Please don’t think less of me, but I just discovered Skype. I know, I know, some techie I am. I just haven’t ever really needed it. I carry my cell phone everywhere and have always had a ‘national’ plan so that I can call anyone for free anyway. However now I’m spending a lot more time in front of my laptop. Okay, I’m spending ALL of my time (minus sleeping) in front of my laptop and Skype is a pretty good solution. Now I just throw on the headset and can talk while I’m doing work, which is a huge plus.

If you need to get a hold of me, my Skype username is digitalbackcountry and I’m using the ryan at ryanstewart dot net email. As I said, I?m almost always at my laptop, so it?s probably a pretty efficient way to find me.

A Big Thanks From Me, and ZDNet Update

It looks like my blog over at ZDNet has been activated and all that’s missing is my mug shot on the blog page. You can check it out by visiting http://blogs.zdnet.com/Stewart/ or subscribe to the feed here. I’m hoping to get the feed added to MXNA (or AXNA?) so that you can follow it without too much extra effort.

I seeded the blog with some of my past posts, and I wanted to give a huge thank you to everyone who has read and commented on this blog. As I went through those posts I realized that I have a lot more comments than some bloggers and that the comments always created interesting conversations. Those conversations have been invaluable in helping me hash out my ideas. So again, a big thanks for reading and participating. Here’s to many more mind-expanding conversations.

Ryan Stewart, Professional Rich Internet Application Blogger

Things have been really slow this week on the blog because everywhere else in my life things have been very busy, but it’s been full of good stuff. The side project with my consulting company is going very well, my “day” job is awesome, and now I’m going to be blogging about Rich Internet Applications over at ZDNet.

The list of bloggers there is pretty impressive, and I’m looking forward to adding my voice and talking about something I’m passionate about. My official topic is Rich Internet Applications which will cover technologies like OpenLazslo, WinFX/Avalon and of course Flex 2. I want to focus on what separates Rich Internet Applications from other web apps and how developers can enhance the user experience by building RIAs. I plan to incorporate a lot of what Jakob Nielsen and Marc Canter talk about when it comes to usability and the “theory” of a richer internet.

While Macromedia first coined the phrase in 2002, there is a lot of room for these technologies to grow and the general dynamic of the internet is working in favor of greater adoption for RIAs. It’s a good feeling to see more and more people become interested in building a richer web, and I hope to keep increasing that number. When I have the link set up on ZDnet I’ll be sure to post it here. I want to thank everyone who has been supportive of me over the life of the blog and I assure you that I’ll continue to blog here about all things Flash.