Blog

  • createLabel Part Deux

    Dude, figured out why createLabel makes your text field invisible. Check this comment in the mx.controls.SimpleButton class for the createChildren method (called by extendee’s of UIObject):

    create children objects. Components implement this method to create the subobjects in the component. Recommended way is to make text objects invisible and make them visible when the draw() method is called to avoid flicker on the screen.

    Well blow me down… is that even possible? Anyway, makes sense now. I like how ever time I learn something, all of my current components are now wrong, hehe. Maybe I should just remain ignorant, then my code would R0cK!!!

  • createLabel & HTML Text Format Bustin’

    If your component inherits from UIObject/UIComponent (one of the 2), and you utilize the createLabel command, the text field can then respond to style changes (CSS based).

    Since I use createTextField all over the place in my components, createLabel is nice. Basically, it’s the same as createTextField, but adds all the style info and power it needs to respond to setStyle changes (globally, class, or instance based). It’s kind of weird in that it immediately turns your text field’s _visible property to false, but other than that, it does all the CSS integration for you.

    One problem I just found, though, is if you stuff it full of HTML text after you create it (I believe a frame after), the HTML will overwrite the formatting since with html textfields you can format with HTML formatting (whoa…).

    Not sure the “correct” way to be formatting my HTML, I guess via getStyle, and dupe a stylesheet, and then apply it, but in the interim, I just immediately call setStyle after I set it’s htmlText property, and the formatting (font) is good again.

  • Customer Satisfaction Solutions: Car Repair & Tux Rental

    I’ve been told that a child coming from a family where they are the only offspring are all about themselves since they tend to have lavished attention upon them.

    The same reason I love sociology is the same reason I hate it. I dig the groupings to help understand where people are coming from, but I don’t dig the stereotypes.

    At any rate, if you can’t beat ’em, join ’em. I just spent part of my morning running errands, all of which are complicated by the slow motion of business satisfying me, their potential customer.

    I figure if these companies do x, then this will help them gain customer satisfaction, and thus improve their business. If that is not something they need to improve their margin, well fugg’em.

    Kaufman Tire & Other Car Repair Shops (non-body work)

    Take my cell# as well as my IM/ICQ/MSN screen name, and page me when my car:
    – is being serviced
    – is done being serviced
    – if you have a question
    – your closing, and where the keys are

    I understand you can’t drop everything and serve me. The last you can do, however, is give a time estimate, otherwise, keep me informed. I plan my day around you.

    After Hours Tux Rental

    Either give me the tracking # so I can utilize the existing plethora of web services from FedEx/UPS out there to track it myself, or do the above informing me:

    – when the truck has left the warehouse
    – when the tux has arrived and at what store location
    – when store hours are changing
    – when there is a problem, inform me with contact information to resolve

    *******

    Please note none of the above solutions require anything beyond a human pressing a button for each event; even a monkey could operate the solutions. If either of you companies need help implementing such technology solutions, let me know; here’s a royal coupon for free consulting. I don’t have time for this bs, I and I know your other customers don’t either.

  • 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.