Posts Tagged ‘flex’

Flex Quirks I Learned About Today

1) Class names in Flex “css” cannot have underscores.
2) backgroundSize is percentage-based, and is based on the size of the container, not the image. Handy! Inconsistent and weird, but handy.


May you be blessed by the deity of your choosing, Mr. Dah.

Tonight was going to be the big night for Hauler. I got a lot of visual content built and photographed in Second Life, and opened up Flex builder to finish up the game. Unfortunately, I ended up spending more than two and a half hours trying to overcome this error dialog:

“Flex Builder cannot locate the required version of Flash Player. You might need to install Flash Player 9 or reinstall Flex Builder.”

I noticed that this happened after I installed IE 8 (I still had IE 6 since I never use IE at home). So I guess Flex Builder lost the path to my debug version plugin when the old version of IE went away.

I tried uninstalling/reinstalling Flash a few times, and fiddled with the paths in Window–>Preferences–>Flex–>Profiler–>Player/Browser but this is NOT the place to do that!!! The correct place to fix this problem was in Window–>Preferences–>Web Browser. I found this tip in the Flex JIRA bug tracker posted by “bahiminin dah” about a year ago. Ya sure got me out of a hole, Mr. Dah. I just checked off Internet Explorer as the browser to open, and the problem went away. (I usually leave Firefox for browsing and IE solely for debugging my Flex junk.)

Here’s a little preview of the new content I’ll be tossing into Hauler this weekend:


Hauler .003

Another alpha release, this time with a functioning fuel consumption/purchasing system.  Fuel capacity is now shown, and can be increased by purchasing external fuel tanks.  I have also implemented turns, which are decremented (from 100) every time you jump to another location.  I do not yet, however, stop the game when the turns reach zero.

One major bug I have is that I’m recalculating prices for all of the items in the Trade and Shipyard views each time you switch to them.  I need to have those calculated only once per visit to a location.

Hauler .002

I’ve made another alpha release of Hauler, this one being .002. The Shipyard view is full of upgrades like cargo pods, etc. I’ve moved the view buttons and info panel up to the top, and I think that’s working out a lot better.

I haven’t quite finished implementing the upgrade system, so there are bugs such as the ability to remove cargo pods even if they drop your total cargo space below your inventory count!


Building yet another game…Hauler!

I’ve been working on a Flex/Flash-based space commerce game for the past few weeks. I’m taking an extended hiatus from WoW, so I have quite a bit more time to dedicate to living an actual life, and building my own games is part of that.

I’m keeping this one pretty simple. The concept is a tribute to classic commerce games like Dope Wars, Solar Wars, etc. – travel from place to place, buying and selling commodities. Make money, upgrade your vehicle, haul more cargo. Rinse and repeat. Every now and then an incident occurs at one of the locations that affects the prices of one or more commodities. There will also be occasional turn-based combat using extremely simplified stats and dice-rolls.

I had Solar Wars on my Palm Pilot years ago, and literally wore down a few spots on the screen from playing it so much. I hope to make Hauler visually appealing and just as addictive.

Once I finish it, I plan to port it to several different platforms including Silverlight, iPhone, and Android. Maybe I’ll even make a Palm Pre version…who can say? It would even be nice on a dumbphone like the one I carry.

I don’t have anything playable to show yet (it’s uuuuuugggleeeeee right now), but at this point I’m further along on this game than I have been on any game since I was a kid banging away at my TI-99/4A or C-64.

Flex 3 – Errors in the Problem Pane May Not Actually Be Where They Appear To Be

I just ran into a pretty weird problem during some Flex development that had me cursing and throwing things around the office…ok, not really, but it was still frustrating.

After getting the latest code from our source repository, I kept getting compile errors in Flex Builder but the line that had the error *didn’t even exist* in the file that was causing it to break.

Long story short: our designer had built various doodads in Flash to use as style components, then referred to those doodads in a stylesheet.  Any item in my Flex code that used those styles was breaking because Flex couldn’t find the object that the style was referring to.  But it gets even more interesting!

As you may be aware, when Flex Builder does a compile, it turns your nice, pretty declarative MXML tags into plain ‘ol nasty ActionScript before it does the actual compilation.  The *true* place in the code that was killing the compile was in fact in the generated ActionScript files.  And every place in those generated files where the Flash components were referenced was causing an error.

During the course of figuring this out, I checked the “save generated code” checkbox (it’s in the Project properties) which gave me a nice folder full of ActionScript files (generatedCode, i think it was called).  Guess what was in there?  The lines with errors.  Through those files I was able to figure out that the style stuff was causing the problem.

But if I got latest code, why wasn’t the CSS finding the nifty Flash doodads?  Great question.  It’s because I needed to add the SWF (or SWC, or whatever you use) as a library reference in my project.

Flash Builder Quirk #184912 – The Fake Compile

The other day I had to merge some code (we’re using SVN with Tortoise).  Sometimes that doesn’t work out too well.  This is especially true with Flex code, for some reason.  The merge left a few files conflicted and otherwise wonky, and after untangling that mess Flex Builder still wasn’t compiling the project.

Or should I say, Flex Builder wasn’t compiling it, but it appeared as though it was.  It turns out that there was a huge chunk of “<<<< mine” and “<<<< theirs” code sticking out of one of the files, but FB wasn’t reporting any compile errors.

Long story short: any time you suspect that FB isn’t really compiling the latest version of your code, try running the project straight out of the IDE (hit the big green Play button) instead of running it via your web page.  That should knock it in the head and let it show you the compile error.