Friday, September 29, 2006

mouseChildren=false

if you're trying to make a label into a link in Flex 2 and want the hand cursor you might notice that just adding userHandCursor="true" and buttonMode="true" doesn't quite do the trick. A little searching on Google and I discovered that you'll also need to add mouseChildren="false" as well. I mentioned this to Simon Horwith and he was as puzzled as me. A label is non-selectable so why does it even have mouse children? Possibly something for Adobe to consider with Flex 3 :).

Compiling Flex applications with a Batch file and the Flex SDK

The situation was that I needed to compile a flex application on a server since it was going to be using a different services-config.xml than the instance on my laptop. Anyway, I got sick of typing the flex compile commands so I wrote a quick batchfile that you can modify. Just save it as CompileAppName.bat and click it from windows!
@echo off START C:\flexsdk\bin\mxmlc.exe -file-specs=E:\websites\yoursite\web\main.mxml -output=C:\websites\yoursite\web\main.swf -services=C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\flex\services-config.xml -show-binding-warnings=false EXIT
First use start to call the compiler (you will need to change this to wherever you put the Flex 2 SDK). -output is the command that specifies where to put the compiled swf. -services is the command that specifies where the services-config.xml file is on your jrun server (in my case to connect to ColdFusion). -show-binding-warning is because I'm bad and I have a binding warning in my code and I didn't want Flex to tell me about it. Exit simply closes the CMD prompt once it's run. Easy huh?

Tuesday, September 19, 2006

Love/Hate Adobe Flex 2

I love Flex 2, I really do. But as much as you'll see me raving about it I'm also quite frustrated by it at times. Yesterday I tried skinning my first app. I happily downloaded the template and started editing away in Flash 8. I was amazed at how easy it was to create the skin and embed it via my stylesheet. The problem is that it kept cutting off the bottom, top, or right-hand edges of my panels after a resize. I tried adjusting my border thickness, size of my template, and every other possible variable. I suspected that I had obviously just done something incorrectly in my template or my stylesheet so I switched back to the default Flex 2 template and that's when I noticed it was occurring there as well, it's just less noticeable. I'm only using a quick resize-effect on a viewStack with the resizeToContent property set to true. Hopefully if I set manual sizes or something I can get this to work. I'll let you know if I can get a workaround.

Tuesday, September 12, 2006

I am now valid

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.iprogramcomputers.com%2F. XHTML Strict, and with big thanks to my colleague Javier Julio who taught me the importance of separating your data layer from your display layer and having valid CSS and XHTML. But now I'd like to talk about my first impressions of Adobe Flex 2. I've been studying Flex 2 since its release and I've also had the opportunity to be one of the first students to take Adobe's Flex 2 class and the add-on data services class both taught by my other colleague Simon Horwith. Both classes were good but I especially liked the first 3 day intro class. It cleared up a lot of confusion I had about proper etiquette in Flex. Anyway, here's my list of things I've run into that have made me loose my way or get hung-up.

Me and Flex 2, the List

  • mx:Repeater objects don't work well in an environment with viewStates. Don't even bother using them because you can't remove them without getting into some tricky ActionScript. If someone knows a way, I'd love it if you let me know.
  • In a TitleWindow object created by a component, its parentDocument will be the main MXML file for your application, not the component. This makes it the same as parentApplication and this annoys the heck out of me.
  • RemoteCalls are rather easy to do using just ActionScript. Just import import mx.rpc.remoting.mxml.RemoteObject; then declare a remoting object, i.e. var remObject:RemoteObject = new RemoteObject. Set the source and destination (they are public properties of the class) and go ahead and do remObject[methodName].send(args...). Unlike I read in from Tien Nguyen's code posted in Jeff Taper's blog, you don't need to define an operation.
  • I'll add more as I come across them.

Monday, September 11, 2006

A first post

It was very difficult to choose a name for this blog. My quest began with nic-names which people had given me. Then I moved onto computer puns and finally I decided to be just blunt. I thought of stuff having to do with "CF" or "Flex" but I didn't want to limit myself to writing about one technology. This blog is here for me to share my knowledge on ColdFusion, Flex, SQL (all flavors!), IIS, Apache, Java, .Net, ActionScripting, etc. etc. etc... But I probably won't stop there, I'll probably post my hardware discoveries as well. Now I know using blogger might garner some disrespect from some of the hardcore CF people out there. "Why on earth wouldn't he use Blog CFC like a good little CF programmer? Is he too good for Ray?" No... I like Blog CFC but It's just that my personal blog is blogger. I'm used to it and I can share one account. It also posts static files meaning I don't have to have a DB set up but since I can post CFM files I can still have dynamic code. Plus, I often theorize that being in blogger gets you more quickly into Google seeing as how it is owned by Google. Oh yea, and the spell check which I so desperately need. Okay, long boring first post. I promise I'll post some code later I promise!

Feed (RSS/Atom)

Contact Me

Don't put anything here: