Blog

  • Where in the world is UIComponentExtensions.as?

    I just had to blog this insanity. It’s about a week old, so time for some reflection.

    Intro

    It started off with our Human Factor’s guy going, “Can we edit this text’s font at a later date?”. I’m like, “Sure.” knowing that I can wire my component’s properties of text to the global styles that the new framework uses. I needed an excuse to learn them, and since I’ve got skinning mostly down, I figured, what the heck, how hard can it be?

    I then ran into a snag; my component (SWC) didn’t have it’s text change to bold when I did a setStyle. I received no compile errors, and all other functions of my component worked. Oddly, when I dragged a Button (mx.controls.Button) component onto the stage and then did a test movie again, both it and my component had it’s text turn bold when I did a setStyle. “Uh… hey thanks Button. Can I have what you have?”

    Digging in the SWC of Button, he had a crud load more classes than I did. So, I started digging into the base classes to see who instantiates setStyle. Well… no one. It’s defined as a function in UIObject.as, but it’s merely a dim/definition of a variable. Pretty goob-a-rific with the comment, too.

    Style Class Found – The Plot Thickens

    Turns out, CSSSetStyle.as (mx.styles.CSSSetStyle) is the homeskillet responsible for the method of style-powah. But, no one instantiates him. Frustrated, I called in the artillery. I had a co-worker use Visual Studio .NET to find in files (since SciteFlash wasn’t installed), and turns out some obscure class, UIComponentExtensions.as is the ONLY ONE who instantiates it. And get this, the method it calls, enableRunTimeCSS, is a static function that does Jack and shiot. It’s merely there, I think, to ensure CSSSetStyle actually gets exported with the framework upon making an SWC. :: takes a hit from the bong :: Ooook… makes sense.

    The Horrible Climax

    Next, the search was on for who instantiates UIComponentExtensions.as (mx.core.ext.UIComponentExtensions). I think it was only found in the comments of some class. I was flabbergasted. If no class instantiates it, how in the hell can it exist? I just assumed it was called via some function that only your mother can call, similiar to how the CSSSetStyle worked… but that wasn’t the case.

    At the end of my rope, I ventured a gander over to Flashcoders, and said a prayer my email wouldn’t get lost in the flood, and sent her off. I actually got an answer, and quickly too.

    The Aftermath

    At that point, Peter Hall’s response confirmed my anger as of this morning. What crackhead thought it was a good idea to revert to Flash MX tactics to create a coding framework should have his/her head examined. It’s already been established in Flash 5 that anything beyond a stop on the timeline is an unacceptable coding practice, and in MX, you merely dropped your assets to fit into the #initclip order sequence.

    Now, however, that’s taken care of for us. That is NOT an excuse, though, to utilize the timeline as a constructor call, thus instantiating an entire style setting system for components. Frankly, it’s bullshit.

    What’s worse is I don’t think it can be changed/modified without affecting backwards compatibility. The workaround is fine; I can definately live with dropping a component or 2 of a base class inside my SWC, no worries there. The methodology, however, in what I am doing is archaic.

    Techniques like this deplete my prozac supply in which I use to placate frustrated Java programmers. Help.

  • I spent $4 Bucks on iTunes

    I spent about $4 this week on iTunes; purchased my first song Monday (whoo… loud noises… cheers… bleh). So far, it’s a pretty neat little app. I dig the 1 click buying; easy as nuts to spend money, but also to get at my product too. I really really dig the sharing of music on a local network; that’s just phat at work.

    The only negative I have is the style of music I like, dance/electronic, is usually under smaller name labels, as my manager says. Therefore, it’ll be awhile as they are acrued in since the targets have been the big guys. Granted, there’s still some good stuff, but nothing like Kazaa has.

    I think I’ll ensure my new CD head unit for my car (or her majesty’s if I inherit it) has auxillery units so I can hook my new (not purchased yet) iPod into it to play my beats. We’ll see how it evolves over the course of the year.

  • LoadVars RAM Saver Trick

    To those of you that think memory management is old hat, more power to you. However, there are those of us who have never had the opportunity to worry about such things in the past. Who knows what is really happening behind the scenes, but I was trying to load 26 XML files. The process goes:

    – get xml filename
    – attach to existing LoadVars variable (not local)
    – do a POST to PHP script
    – PHP script uses the passed in filename, loads the gZipped XML file, and returns to the LoadVars callback as a variable “theXML”
    – LoadVars’ callback then throws that string to the xml object via owner.my_xml.parseXML(theXML)

    Now, each XML file, around 300k, was making the memory jump 20 megs every load. So, the 9th load would usually crash Flash. I thought it was the XML object, but turns out, it is the LoadVars object. Even though his “theXML” variable is reset each time, the string data in memory isn’t.

    To solve it, I added a “delete this.theXML;” after I passed the string data to the XML object to parse. This doesn’t entirely solve the problem, though. Even though I can see the RAM drop about 20 megs, she still climbs to a whopping 80megs when finished. I really don’t think my nested array/objects are what is causing the significant increase, and there aren’t many components on stage nor in use. At any rate, at least it doesn’t crash now!

  • Design Atrophy

    My team will complete Phase 0 of our app in a couple weeks. I wanted to help the human factors guy out and bring some funk to the table so our first deploy to QA and others would be mad-sexy. The whole hiring of graphic designers has been all over the map because of my seperation distance from the decision makers, which is fine. I just took it as an opportunity to do some design work for a change.

    I was surprised, while at SIS, that when spending about a week with a pad of paper, Fireworks, and After Effects, I got back into a design groove pretty easily. It wasn’t fantastic, but I definately felt I was earning my paycheck via design vs. programming. It was tough adjusting things to my manager’s suggestions, but I attribute 90% of that to the fact that I was in a development department vs. a design/creative/marketing one.

    I tried, twice, this week to get into the groove for laying some funk down for some designs to propose today to my team. Hit some major brick walls, though. I think the pressure of having a human factors guy here who’s so talented and knowledgable, submitted the first design in the first place, the imminent arrival of 1-3 graphic designers (maybe), and the target audience not necessarely digging my design style… it’s tough both mentally and in execution.

    Really, though, I’ve noticed that over the course of the past 4 years, while my eyes have learned to appreciate good and bad design, it hasn’t worked both ways. Flawless execution of an idea doesn’t just come from talent; part of the reason Flash development for me is so easy to talk about is the actual process of idea to workable prototype is extremely streamlined. Not only does the tool make it very easy to help bring my ideas to fruition very quickly, but my grasp of how to use it does what any good manager should: remove boundaries. I have none.

    You would think the same holds true on the design front, but that just isn’t the case. I think it comes down to what her majesty said about one of my designs: “It doesn’t look like you do it everyday.” I’m guessing the reverse holds true about my appz I develop (here’s to hoping anyway). There is a mountain of frustration I go through each time I start getting back into design mode. I’ll throw together a few layouts, and just as quickly toss them as they are repetitive styles, aren’t going anywhere, or don’t solve the problem I’m trying to solve. Eventually, I latch onto a theme and go with it. Same with trying to find an efficient tile based game approach in Flash. Requires an extensive amount of throw away code/FLA’s.

    Really, I’m attributing it to working out. I haven’t worked out since November. Once the house purchasing became quickly to the forefront, combined with school and contract, I really started to need every second I could get and bigger pecs wasn’t helping me keep tabs on everything. Now, I’m sure if I head to the gym, the first 2 weeks will hurt pretty bad, both physically and mentally because my body has suffered atrophy from lack of use. I know the benefits, so it’s worth it, but I can see how my design challenges relate. I have the will and the technical capability to utilize the tools (Fireworks/Photoshop/Paper/AfterEffects), but I think a couple things are lacking. First off, it is hard for me to see the benefits. I realize that there are more capable individuals to complete the design tasks we have. Second, it’ll take a few go arounds for me to again attain the level I want to be at. The latter won’t happen in the timeframe I want.

    Another interesting issue is the amount of work put into my design esque projects seem to generate little return. Not just monetarely, but emotionally. I think, too, it is because as a hobby, it is best done for myself vs. clients. However, coding has become both hobby and fulltime gig, so I’ve had little opportunity to really need a design for myself aside from the occasional icon. I wish there was some way to “work out”. I have some small side projects I need to finish for her majesty, so maybe that’ll help. Maybe I should just go mix audio this weekend… something.