People to avoid at Flex360

February 28th, 2007 . by polyGeek
Oz

If you run into the guy pictured here you might want to run screaming in the other direction. Okay, maybe politely avoid eye contact and wander off would be more appropriate.

If perchance you do get involved in a conversation with him here are the main topics to avoid:

  • Don’t bash Flash/Flex. This is a Flex conference so you’re probably not inclined to do so anyway but depending on his mood he may verbally eviscerate you for blasphemy against Adobe.
  • You should avoid bashing Microsoft as well but not for the reason above. If you do you’ll only encourage him to get on board that bandwagon and it’s hard to get him to shut up when he does.
  • His college background is Philosophy and History. I’ve talked to the guy and he doesn’t know his Nietzsche from his Descartes but stay off the topic of epistemology. There are two good reasons for avoiding the epistemology topic. First, you’ll be involved in a conversation that can can serve no useful purpose because really, how useful can it be to talk about justified true belief? Secondly, someone always falls into the trap of linking epistemology with The Matrix. When that happens you’ll definitely get him off the epistemology topic but at the expense of listening to him defend the brilliance of the Wachowski brothers and how Revolutions was completely misinterpreted. This would be a good time to start drinking to excess.
  • As for history topics: don’t talk about anything that has ever happened in the past. In particular try to avoid the Hellenistic period of ancient Greece, The Renaissance, The Enlightenment, Ancient Egypt, Roman Empire under Augustus, Fall of Constantinople, Colonial America, Revolutionary America, American Civil War, etc.
  • He very nearly finished a degree in Mathematics and Astronomy so guess what, stay away from those topics as well.
  • If you really love to talk about quantum mechanics then you might be able to tolerate a conversation with him for a few minutes. But be careful not to bring up Special Relativity. He used to teach it to high school students. You don’t want to get that lecture.
  • As for the topic of space travel: don’t go there either. He worked at the Space Academy in Huntsville, AL and at Kennedy Space Center. You don’t want to get him yacking about his experiences there and by all means don’t bring up Apollo 13 and/or Jim Lovell.
  • Lastly, don’t bring up anything to do with Science Fiction. Most importantly don’t talk about Battlestar Galactica, Star Wars, FireFly, X-Files, etc. And for the love of god’s don’t bring up The Hitchhikers Guide to the Galaxy. He has practically memorized those books.

He also has this amazingly annoying habit of responding to people with lines from movies. Like you’ll say, “Stop quoting movies and answer questions like a human.” And he’ll say, “I’m sorry. I can’t do that Dave.” While using his HAL voice. Dear god I hate it when he does that. I’m thinking about not even going to this conference just because I know I’ll end up in a conversation with him.

You’re best bet is to just talk about Flex and Actionscript. At least then all you’ll have to endure is his endless questions. At least it’s better than his endless blabbering.


Lynda.com : Flex 2 Essential Training video review

February 27th, 2007 . by polyGeek

The Lynda.com Flex 2 Essential Training - 4.5 hours of training - is a fine introduction to developing in Flex. I watched the series twice. The first time was a bit of a struggle because I didn’t have access to the training files. But, I talked work into buying the premium package so the second time I had the files to work with.

Here’s a quick breakdown of how Lynda works: you can get a month-to-month subscription for $25/month. That gives you access to all the videos on the site but you don’t get any of the files that they use. In the case of Flex that means a lot of pausing the video and typing code in and then playing a bit more of the video and repeating. That works pretty well for the Essential Training series. But there are a few times that they don’t show you all the code that a particular example is using so you’re pretty much on your own for that part. Plus, there is a bit that deals with connecting to a ColdFusion server. That’s not going to work without their files.

If you get the premium year membership - $375 - you get access to all the training files. It’s a much smoother experience to have the files beforehand and just watch the videos and make little edits here and there as you’re told from the video - or to experiment.

Of course $375 is a chunk of money to spend for watching training videos. They only have two series on Flex so you’ll probably want to see if they cover any other technologies that you might be interested in. If so then it might be worth the premium membership.

The second time through I had the files and had far fewer problems. I’m not a CF developer so I was pleased as punch that I could get the CFC files in the right place and working for the examples they had using ColdFusion and Flex together. I’ve had nothing but headaches in the past when someone supplies server side files for a tutorial. Most of the time there’s some setting that prevents them from working. Thankfully, that wasn’t the case in this instance and now I know that I have my CF server up and running correctly on my PC.

You can check out the first chapter of the training without any membership. You won’t learn a lot but it’s enough to see if you think the rest might be worth it.

In my case I would say that it was worth the $25 to watch this series even if this is the only one you watch. I particularly learned a lot with chapter 5 on Programming with Events which I made a tutorial out of here on polyGeek.

I’m watching the second series on Flex now - Flex: Beyond the Basics - and I’ll review that when I’m done. Already I can tell that it would be a real headache to try to code along with them without the files. It’s probably best to just sit back and watch if you’re going for the month-to-month subscription.


Ryan Stewart’s lifting the fog of RIA: A list of Rich Internet Application Technologies for the Digg crowd

February 26th, 2007 . by polyGeek

Ryan helps clear the confusion surrounding the various RIA technologies. (But Ryan, why wasn’t Flex at the TOP of the list?)

After seeing a story about Flex on Digg, I decided to do a round up of the newer Rich Internet Application technologies including how you build with them, what they’re best suited for and where to find more information about them

read more | digg story


Using PXP2 to build a simple XML based app in Flash

February 26th, 2007 . by polyGeek

This is a short tutorial on creating a simple XML based app in Flash. How short? Try 9 lines of Actionscript, not including comments, in the abridged version. You could then use this approach to build much more extensive apps.

Download tutorial files
.

Most of the heavy lifting in this example is done with the PXP2 class: an XML-to-Object converter. The PXP2 class is included in the zip file. You don’t need to read the complete overview of PXP2 to do this tutorial.

If you’re unfamiliar with global classes then read the instructions here on how to add class files to your global path.

What we’ll build

You probably haven’t noticed but at the very bottom of every page on polyGeek.com is a randomly selected quote. It’s a very simple app that loads the quotes from an XML file and then randomly selects one of those quotes to display. Lets walk through how this works.

The 30,000 foot view

First the SWF loads a settings.xml file. That file has a list of files that contain the quotes. My thinking here was that I didn’t want to put all the quotes in one XML file just to pick one of them to display. Instead I can break the quotes up into as many files as I wish and refer to them in the settings.xml. It would also be easy enough to include data here on how to format the text, positions of the TextField, etc.

Once I have the settings.xml file loaded and parsed I can randomly select one of the quotes files to load. Then when the file with the quotes is loaded I randomly select one of the quotes and place the text in a TextField. That’s it.

The 10,000 foot view

The biggest headache in using XML files in Flash is the firstChild, nodeValue code that you have to wade through to get to your data. And then if for some reason you change the structure of the XML file then you have to edit your code. Not good.

The PXP2 class that I wrote takes care of all that for you. What you end up with is an Object that reflects the XML structure. All you really need to know about PXP2 is the signature.

With those two lines of code you have told the PXP2 class to load the XML file fileName.xml. It will then parse that XML and convert it into a usable object. When it’s all done it sends that Object to the function you specified with the second parameter - callBack. You end up in your callBack function with an Object that holds all the data from your XML. In this case it’s called “o” but you can make it anything you wish. I usually choose a variable name that reflects the rootNode of the XML file.

So if I have an XML file like such as this:

I would create an instance of PXP2() class like this:

And if I want to randomly select one of those files I would do this in the settingsCB function:

That says, take the length of the file array, multiply that by a random number, between 0 and 1, and then remove the decimal part. Since a random number is never 0 or 1 but always in between I’ll end up with a number that is between 0 and the length of the file array - 1.

The 10 foot view

The FLA is fully commented. Here’s the abridged version of the code, which is also included in the download.

The rndQuote.fla is also fully commented and deals with a few other details like adding the attribute/date, if they exist, to the quote. It also handles situations where there is only one quote file listed in the settings.xml.


The Web as Orchestra

February 23rd, 2007 . by polyGeek

I read a lot of technology news and blog sites. Most of these sites have comments enabled for users to chime in with their own observations and opinions. If you’ve read many of these comment threads then I’m sure you’ve noticed a great deal of vituperative statements regarding the merits of one technology or another. It’s amazing the ire that Flash and Flex draw from the Ajax crowd but it goes both ways. I have politely dissed Ajax a few times myself.

A few days ago I was reading a post at The Universal Desktop by Ryan Stewart where some of the comments were borderline rabid. I don’t get much of that sort of commentation here on polyGeek.com because it’s pretty much a Flash only site. But Ryan writes on a broader range for a popular site - ZDnet .com - so he gets readers from the full spectrum of developers.

So why is it that, for instance, many Ajax developers will comment disparagingly about Flash when clearly they don’t know much about it besides that it’s used for web page adds. (I still have to grit my teeth every time I read that because most web adds are GIFs with annoying Javascript plopping them all over the page.) I’ve also seen .Net developers dump on Java developers, Apple zombies insulting PC abusers, iPod vs Zune, the list goes on and on and the insults go both ways. And of course the most obnoxious offenders of all are the Linux OpenSource preachers and the Web standards/accessibility evangelists. It doesn’t matter what tune you play, you just can’t please anyone in those two groups.

This got me to thinking, “Do other professions have the same sort of bickering that we do? Take music for instance, which is something I don’t know much about, but I just don’t see a bunch of violinists going to clarinet blogs and writing things like, “Clarinets are so music 1.0. I can’t believe they still teach people to play those outdated, unusable instruments…” Really, I’m sure this doesn’t happen. I’m sure that musicians are just as competitive as any other group. But I think music has been around long enough to mature to the point that musicians realize that a symphony requires an orchestra. And what’s important is how good they are at what they do. Not how another instrument works to play the same tune with a different sound.

The analogy between music and web programming is apt in another way. I doubt if many developers or designers think of it this way but code and pixels are a form of expression just as music is. I personally love Flash because as an instrument it has the functionality to allow me to express myself. Sure, there are things it won’t do. But a violin doesn’t sound like a drum either.

There are a lot of projects to do out there on the web - and soon the desktop. But there aren’t enough Flash developers in the world to keep up with the demand. Nor are there enough Ajax, WPF/E, PHP or anything else developers. My advise is to drop the my toy is better than your toy attitude and get busy pushing the envelope in whatever framework you choose.

We all have a lot of work to do and money to make. How does that sound?


Playing with your own tools

February 16th, 2007 . by polyGeek

Ryan Stewart comments about the Adobe and Photobucket collaboration, or whatever it is:

In the end, I worry how this affects the people building great applications on Adobe’s platform. Macromedia and Adobe have mostly stayed in the role of enabler, creating great tools and then letting their customers build with them. Adobe seems to be eating its own dogfood more and more by building competing applications on top of the platform.

I would certainly agree that this is dangerous ground for Adobe. On the one hand the more A+ web applications that are out there using Adobe technology will strengthen the image of the Flash platform and create more opportunities for us Flash Developers. The downside is that if they overdo it then they will scare away the money guys who might fear that Adobe will come in and do them one better.

The approach they are taking with the Apollo investment strategy might be the best way to go. When someone does build a quality product then partnering with Adobe will only bring in more credibility and lots of eyeballs. And it obviously provides incentive for the money guys to use the Flash platform if they think they might be able to get Adobe onboard and thus get an instant return on their investment.

The advice I would offer to Adobe is: Don’t be like Microsoft. I think that’s a legitimate concern after reading about the various undocumented APIs in the Flash player concerning VoIP. (Additional info from Om Malik and JD on EP.)

It’s pretty obvious where they’re going with that. I’m not sure I like the precedent they are setting. I would love it if Adobe would commit to documenting all of the APIs in the Flash player so that we all get to play with the same tools.

As Yoda said, “Don’t give into the quick and easy path. That is the path to the Dark Side.”

What, you thought I would get through a posting without a movie quote?


Technological tipping points

February 12th, 2007 . by polyGeek

In nature a population of organisms in an ecosystem compete over nutrients. Most of the time the ecosystem is in a state of predictable flux. But a newly introduced organism or a change in resources can throw everything into chaos. If the ecosystem passes a tipping point then a new state of predictable flux will be established.

It doesn’t take much of an imagination to see that the web is very much like an ecosystem of organisms and resources. The web ecosystem recently went through a tipping point. Web content had been relatively stable since the mid 90s. All hinged around text and graphics. Then broadband connections began to grow in number. That allowed a previously undernourished form of content to rapidly expand - video.

Initially there were a handful of competing video organisms trying to dominate the ecosystem. Then the most unlikely organism rose to dominate. And it regulated the others to limited and withering niches.

Video, video, everywhere

The BBC just admitted recently that the main reason they don’t use Flash video is timing: Flash video became the obvious answer after they had committed their resources to other formats. Do their users like it? No, and they have let the BBC know about it. But it isn’t going to change anytime soon. That’s because businesses rarely change unless there is a clear path to profits. In the BBC’s case they would have to buy lots of software, make changes to the servers, and retrain their engineers, who by now have automated and optimized their workflow so that they can spend most of the day checking youTube for broken links.

While nearly every new video based website coming online today uses Flash video CNN, MSNBC, BBC, NFL, and many others who were early adapters continue to use Windows Media/Real Player.

Go into the light

We all know that webTime moves very fast. Sometimes it seems that what’s popular now is yesterdays news tomorrow. I’m sure that many of the aforementioned sites would love it if they had the foresight to jump on the Flash bandwagon from the beginning. The trick is knowing where the spotlight is going to shine before the crowds arrive. Then you can just stand there and soak up the attention.

Okay, so where is the spotlight going to shine next?

Lets take a look at the web ecosystem and see if we can discover what the next tipping point might be so that we can predict where the spotlight is headed next.

One for you. Two for me.

Given that Windows makes up over 90% of the OS market ask yourself this: do you think that the Windows OS (Vista/XP) marketshare will grow at the expense of Apple and Linux?

No? I don’t think so either. It’s a given that the market will grow for Windows OS, because there are just more damn people in the world all the time, but the market share has reached its peak penetration.

Apple continues to erode into the Microsoft OS dominance. More than anything else the ability to run both Windows XP and OS-X on the same PC makes it easier to migrate over. You can dual boot both until the day you realize that you don’t want to use XP anymore. (Note: I work for Microsoft and haven’t used an Apple OS since the Apple IIe.)

Linux is bound to expand its marketshare. For one thing it’s very small right now - around 1-2% - so there’s nowhere to go but up. Plus, Linux is free, or nearly so which is attractive. Plus it is very stable, and fast. I like Neal Stephenson’s analogy, circa 1999: Windows is like the family station wagon that’s always breaking down and expensive as hell to fix. Apple OS is like an expensive European sports car, fast, and cool looking but a little finicky. And Linux is like a modern M1 Army tank that is faster and handles better than a European sports car while getting 100 MPG. And did I mention it’s free?

There are two main drawbacks to Linux: consistency between distros and lack of software, particularly hardware drivers.

Hopefully the newly formed Linux Foundation - HP, IBM, Intel and others - will help fix the consistency issue. They will also be able to pressure other hardware makers into providing Linux compatible drivers for their printers, video cards, cameras, etc.

As the market share for Apple and Linux continue to grow the demand for cross platform applications will grow. The more cross platform applications there are the easier it is for someone to switch from the Windows platform to Apple or Linux. That’s a feedback cycle.

This has happened before. Not too long ago a small company in the Seattle suburbs found itself on the positive end of a feedback cycle. Their OS was cheap and could be run on cheap computers. Businesses flocked to their platform. Their rapid rise was a boon for other software companies who could focus their products on just one platform and not bother with creating versions for two or more operating systems. That worked just fine until Microsoft added your application to their suit and then your business died. This is how Microsoft became king of the hill.

Today many software companies support only Windows XP. Especially if their software targets business users. And rightfully so. Why devote all the resources it takes to develop cross platform applications when you can focus on just one dominant platform. You shouldn’t. Not unless someone came up with a way to have one code base for your software that would work across platforms. Good luck with that because it’s been the holy grail of software development for decades.

Look at this shiny cup

There is a project out there code named Apollo from the good guys at Adobe. Apollo will enable developers to create software that can do nearly anything that any other application can do but with a twist. With one code base you can create an application that will run the same on Windows, Apple OS-X or Linux. And it’s a very fast development environment. Like how fast? How about creating a standards based web browser in 60 seconds? Or a file system explorer in 30 seconds? Those are projects that could take a team of developers months to create a few years ago. For Apollo that isn’t much more complex than creating the classic “Hello World”.

Is Apollo going to dominate the market from day one? No, certainly not. But it might be the resource the environment needs to reach a tipping point. There are already a handful of projects in the works and the product isn’t even in Beta yet. So look to see a splash in Summer’07 when Apollo goes 1.0.

Initially you’ll see a lot of today’s Web 2.0 Rich Internet Applications going to Apollo. That’s because many of these RIAs currently use Flex. Flex and Apollo use the same development environment so the transition from browser to desktop will be smooth in most cases. Plus AJAX applications will run on Apollo and give them access to the local file system. You’ll also see a cornucopia of desktop widgets created with Apollo coming out in Fall’07.

By this time next year you might see entire office suites created with Apollo. It has those capabilities. And of course there will be applications that have no real counterpart today because the world of web enabled applications is just starting.

Aziz. LIGHT!

Get ready to hear the terms like platform agnostic, platform independent, neutral platform, cross OS, etc. in every other tech article you read. It’s where the spotlight is headed.

Of course Microsoft isn’t going to sit idly by. They have their own initiatives such as Windows Live, whatever that is today, and WFP/e. Forget for a moment how good or bad these products might be. There is no way Microsoft is going to be able to compete in a cross OS space because that would be akin to chopping off one of their own legs - namely the Operating System division. No matter how much business since it might make from the standpoint of the Office team the company just can’t fully embrace platform independence.

What do you do if you drop your OS in a pool of molten Adobe?

According to all the press and pundits out there Google is the biggest threat to Microsoft. No doubt there will be some tug-o-war going on between the two companies over their overlapping territories. However, both companies should pay attention to the rumblings underfoot. They might find out that they are playing tug-o-war on a volcano made of Adobe. If you haven’t heard those rumblings sound like IPTV, P2P, VoIP, and FlashLight3 Video. And those are just the ones that are leaking out.

How do you know she is a witch?

Lets step back and think about what an OS is. My, possibly oversimplified, definition is: a place where your applications run or if it sounds better a runtime environment. No matter what Microsoft might say Internet Explorer is not a part of the Operating System. Certainly no more so than NotePad is. Neither are Windows Media Player, Windows Explorer or any of the other bundled apps who have their roots artificially entwined in the innards of the OS. That’s just what they are: bundled apps. And those apps run on Windows. Not in it.

Guess what. Apollo is just as much an Operating System as Windows Vista. Applications run on Apollo. Of course Apollo on a Windows PC is like an OS on top of an OS. That’s really overkill. It would be much better to use an OS under Apollo that is lightweight, fast and stable. Like, say Linux.

The typical business user needs: access to email - preferably on and off-line, a browser, wordprocessing, spreadsheets, slideshow, IM, and a media player. Each of those were killer apps when they happened on the scene but none of them are much of a challenge for a decent software company to create these days. In fact, you can get versions of every one of these apps for free. Oh, wait, you can even get the operating system for free.

Would this setup satisfy everyone? No, of course not. But enough will switch that might push the web ecosystem into a tipping point where Windows is no longer the king of the hill.

Here’s the real kicker: if this happens and Adobe Apollo ends up pushing Microsoft off the hill then the landscape will be radically altered. That’s because there won’t be a hill left to speak of. The Apollo run-time is going to be distributed for free. Linux is free. There will be no OS market to speak of.

Neal Stephenson said it himself in his book In the Beginning was the Command Line:

…it is the fate of operating systems to become free.

Adobe Software Australia Compare Adobe graphic software and buy from Australian stores


Dynamically changing text in a Static TextField

February 1st, 2007 . by polyGeek

I always thought that you couldn’t change the text value for a static TextField at runtime. I was wrong, again.

You probably know that any object on the stage that doesn’t have an instance name is given one automatically when published. That also applies to static TextFields. In my situation I have a MovieClip with multiple dynamic TextFields that were going to get their text values from XML data. There are other TextFields, that act as labels, have their type set to Static Text in the properties panel.

So far this is stuff that you and I have done countless times before. No problem.

At this point I got a little cute with the code. I’m accessing the text data from an object. So for a given index I can say something like this:

publisher.text = o.publisher
rating.text = o.rating
genre.text = o.genre
….

That works well enough but what if I add another TextField/data pair then I have to go back into my code and associate them. That’s just too much work.

I set this up from the beginning so that I could use a for-in loop to run through all the TextFields in the MovieClip that holds them. That way if I add another TextField to the MovieClip and the corresponding data to the XML I’m done. (Aside: for someone who loves to code I really like to find ways to not code. Go figure.)

So now we have something like this going on:



Great, but all my labels came up as undefined. WTF?

It didn’t take long to figure out that the code was trying to give mc.instance1.text = o.instance1. Fixing it only took checking to see if there was a corresponding value in the Object.

if(mc[p].text && o[p]) {….

It looks like Static TextFields and Dynamic TextFields are really the same thing. It’s just that the authoring tool doesn’t give you the ability to provide an instance name to the Static TextFields.

Update: You can read more from the comments but basically the text in a static TextField can only be changed if the font is set to _sans, _serif, _typewriter. That’s because even though you have the TextField set as static Flash still publishes them as dynamic because they are. Those TextFields get populated at runtime depending on the fonts available on the computer that the SWF is running on.

So while you can’t give a static TextField with it’s font set as a devise font an instance name it still gets one and can be accessed in the for-in-loop.