Blog

  • Tree Label Function, View Class View, & Sharing FLA’s

    Trying to illustrate to my fellow developers at work which view classes represent what part of the interface we’ve been given by the design team. Last time, I took screen caps, wrote just the classname itself at the top, and put them all in 1 big webpage. This was easy to check into Subversion, and you could use Control + F in Firefox or IE to quickly find a classname on the page to “see” what you were building. I’ve seen others actually screen cap the design, and bring that in as a guide layer on the component itself. This worked great in Flash MX, but with MX 2004 and classes maker a clearn seperation of code and GUI, it doesn’t work as well.

    We make decent use of Flash’ Project Panel here. It is merely for organization; you can clearly (sort of, it’s kind of cramped) see the entire project. All the AS files in their packages, the currently 3 FLA’s, the JSFL’s, and the includes. Since most of us Flash guyz use Flash to code in, it makes it really easy to open up a class file; you just double click it. It’s a pain to keep in sync with the folders, but I’ve sort of elected myself to ensure it’s in sync because I believe in it’s ability to keep us all on the same page.

    I combined both the Project panel and my viewing of the classes as interface screen captures. I load the Project’s FLP file into a Tree component, and since it inherits from List, I use a labelField function to return attributes.name instead since Tree’s expecting a label attribute. For folders, this works great; if the node has a path attribute it’s probably an AS file, so I just chop off the filepath, and show the file name.

    import mx.controls.Tree;
    createClassObject(Tree, "project_tree", 0);
    project_tree.labelFunction = onNodeLabel;
    function onNodeLabel(item)
    {
            if(item.attributes.path == null)
            {
                    return item.attributes.name;
            }
            else
            {
                    var a = item.attributes.path.split("/");
                    var str = a[a.length - 1];
                    return str;
            }
    }
    

    When you click on one of those class files, if it’s a View or Controller, it loads its equivalent JPG, located in the docs folder 1 level up, same classpath structure. This way, using the same project file, you can navigate to the fully qualified package path, and see the image the class represents.

    Finally, sharing FLA files amongst many developers sux. SharedLibrarise are a management nightmare, even with JSFL skillz, linking to symbols in other FLA’s using a main FLA makes your compile tmie skyrocket (and again, is a management nightmare since it’s now only a compile time deal). For now, since Subversion doesn’t support check out, we just constantly communicate. Flex, aside from it’s weird embedding of assets, would abate this problem.

    How are others handling it?

  • Spring Cleaning

    Rest in pieces...

    Rained this morning, but turned out to be partly sunny the rest of today (so far). Didn’t wash all the yellow death (pollen) away as you can see above, but that’s ok. My internet usage now is free from prejudice, albeit a lot less secure. Never again will I purchase a LinkSys product. After dealing with the hell of upgrading my firmware, no firmware matching the version I had on their FTP site, and no response from customer service via email, I put my foot down… literally. And then I put a brick down too, a few times just for good measure.

    Could I have called customer service? Sure… I guess so. But who’s got time for that after already sending an email? It’s a $99, year and a half old router, not something I can afford to spend an inordinate amount of time on.

    Just in case anyone’s in a similar situation, the weak spot is in the middle and near where the gray case connects to the blue stacking, front LED case; the case itself has amazing vertical strength, but it’s connection to the main case is pathetically weak, and one good stomp lights up everything as the router senses its own impending doom.

    …too bad you can’t do the same thing to software…

  • Learn From My Tax Mistakes

    The most glorious errors are typically what we learn most from. I learned a lot from doing my taxes myself this year rather than passing them off to someone else to “handle”. I’m rounding numbers, so they aren’t 100% exact for the purpose of this article (naturally, they were on my taxes, hehe!).

    I used H&R Block this year because her majesty had a good experience with them last year, and since we’re now married, filing jointly sometimes will give you benefits. Keyword, sometimes. Look at the fine print; it is not always beneficial to file jointly, do not assume it is. All in all, I learned a lot, and I felt it was good money spent not just on having someone doing my taxes, but on learning and piece of mind.

    I made roughly $10,000 in 2004 on contract work, up (from what I can remember) 95% of 2003. I managed to expense roughly $4000. Therefore, I had to pay taxes on roughly $6000. Suck. I should spent a lot of that (not all) on business related expenses, whether it be an additional laptop (since my mother took my other one for school), and all the wireless & accessories that typically make those purchases 150% more than they usually are, additional conferences, software, or office related supplies. The majority of my expenses were supplies (new computer, hardware), while the 2nd was advertising – in this case, personal branding. I could of spent more on supplies, but my advertising was about capped.

    As a result of our total income exceeding a certain amount, we could only expense a max of $4000 each on school. Therefore, anything above and beyond that… was taxable by the government, meaning it counted towards our income, raising our tax bracket, and thus being taxable income. We both spent almost twice that (differs between each of us). That’s almost $6000 that I’m using to better myself AND being taxed on. The majority of my free time was spent doing contract to cover the cost of school. I understand Uncle Sam needing to tax my contract income if it’s not a business related expense, but taxing my school costs? F’ing ridicolous. I should of put the majority of that money in a new Georgia based mutual fund (think it’s called a 1089?), made specifically for storing money used only for school. You can write checks against it for school supplies, and not be taxed on any of it. Since it’s a 401k, the government can’t touch it either, state or federal; except for a fee for setting it up, hehe (this info based on my research 3 years ago with Edward Jones). Additionally, I might of found a way to market it as a business expense, similiar to how companies force employees to take education for their job requirements, and thus the income spent wouldn’t be taxable. However, the fact that I was a full-time employee for the majority of last year, it’d be a serious stretch for the IRS to believe I needed a BA in Leadership & Management to continue to meet my job requirements as a programmer.

    So, seriously hard lessons learned about what part of your income is taxable, and what you can do about it. It was not a negative experience, per se, but a hard lesson in how lack of initiative in investing can bite you at tax time. Overall it was a positive learning experience. I plan on filing quaterly, and demanding W2’s (1099’s failing that) from all future employers/contract employers rather than taking what they give me. I already save all business related receipts.

    I know how to use 6k better than my government does… they’re spending $17 mil now up in New Jersey just to prove how ill-equipped our medical infrastructure is in its ability to respond to a biological terrorist attack. You think? Spending 6k investing in my business and/or myself for school (in a non-taxable MF) I believe is better for my country in the long run, since I hope to someday start my own business, and thus pour more money into the economy and create new jobs.

    To recap the lessons I learned:

    • look at fine print when filing jointly with spouse; sometimes worth it, sometimes not. Case in point, exceeding income gave us both a cap on our how much we could expense towards school
    • If in business for yourself, expense as much as possible back into your business. Not 100%, though, if you are a full-time employee elsewhere. I was told this makes it more “complicated” with the IRS by an ex-IRS employee.
    • if spending income on education, put into a state ordained 401k mutual fund, at least in Georgia, so you can not only gain interest on the money, use for it school expenses, and not be taxed on any of it
    • 1099 work orders suck… if an employer can treat you as a temporary employee and do a W2, do it. They’ll automatically take taxes out and everything else dealing with that; you just get paid with taxes already taken out and have the W2 form sent to you end of year… end of story. Easy, no hassle.

    I think our tax laws need to be modified; by being successful + getting married and filing together, I was put into a higher tax bracket, and thus penalized on income I used for school. That’s not right.

  • Flex Website: Pillar Data Systems

    I didn’t think to make an entire website in Flex. There are only a very few genres of websites that can pull off an entire site done in Flash and not have it adversly affect the user. For such sites, Flash is appropriate.

    Typically, a hybrid approach seems to work well, whether for rich advertising, or for useful widgets like in-page video players, real-time voting polls, or rss readers.

    So, to see an entire website built in Flex… well, my reflection on it is, the JSP guys I guess found their replacement for Spring, or whatever it was they were using.

    Although a few things were different, my initial reaction is it works and feels like a real website; real being I knew it was Flex because they told me it was before I saw it. I view Flex as an web application creation product, not a webpage/website creation product. I think it’s really nice.

    …then I seeked my budding Information Architect wife on it, who does usability and web design in her day to day job. Feedback like this only helps to improve Flex. Her comments with mine mixed in below:

    • inital loading time exceeds the 10 second rule. Subsequent loading times to do not. Perhaps Flex’ deferred instantiation could help this by loading in content as dynamic vs. embedded?
    • no cookie trail, or highlighted selection on navigation to let you know where you are once you navigate somewhere. Perhaps the link control can be upgraded/extended to a more web-esque, obeying how HTML links work with color & underline, highlight, and a change in color for visited.
    • boxes on the right do not indicate what they do; this is site specific, but because it uses SWF, there is a lot of flexbility & creativity one can implement here.
    • back and next buttons work; rock on. An enhancement would have them not have the same name in the history, but rather, have section specific names.
    • navigation disappears when you click it… why not keep where you are there and highlighted?
    • bookmarking a certain section does not take you to that section when you return to the bookmark; perhaps capture this via FlashVars to let your app know which section to initialize too?
    • the search field does not show the text cursor when you roll over it; set it manually via the CursorManager.
    • middle mouse does not scroll text boxes, nor does the cursor indicate it’s text, even though you can select it. Perhaps the app is stealing focus?

    Over all, awesome example of how Flex can be used as a front-end to backend services for use in creating a website. Curious how much is dynamic content, how much is static, and what were the reasons to use Flex instead of JSP and/or HTML alertnatives?

    Pillar Data Systems via James Ward.