Blog

  • Skinning in Beverly Hills

    On a Flex 2 project in Beverly Hills, California for the week with 3 others from my team at Universal Mind. It’s apparently a long term project (as most Flex ones are compared to most Flash ones). I’ve fallen into the role of skinning; basically what I didn’t seem to effectively convey at MAX.

    I take a Phothoshop comp, flatten the effect layers and render the text ones. I then import it into Fireworks, and rip out the good assets, and save as individual PNGs. Those that are better as vector, I rebuild (yes, RE-build) in Flash, and export out as SWFs. I then either embed them in Flex’ CSS to button skins, embed the images in the MXML, or extend one of the Programatic skins.

    Nahuel Foronda, my co-worker and one of the winnners of the Flex Derby for his Real-estate App, found a way to get bitmaps into Programmatic skin classes. I always thought you couldn’t because they all extend Shape, and thus only allow dynamically drawn vector content, but flash.display.Graphics DOES have the beginBitmapFill method, so you CAN blit bitmap content very nicely. It’s very cool for some of the bitmap designs that cannot be scale 9’d, but can be tiled. He also found a better way to scale some our dynamically created content. While a Repeater thrown in a VBox could work, it didn’t in Flex 1.5, and the drag and drop capabilities of the List are easier to code. Basically, a Canvas in a Canvas. The inner canvas holds your content. Eloquent!

    I’m constantly put on projects where the designers have no idea the capability of the platform they are designing for, mainly Flash & Flex projects. The bigger the scope, the less communication there is beteween the 2 teams. A lot of these projects on the Flex side are your cliche “database driven” project, but more and more are incorporating a lot of design, so much so one could argue they ARE design driven. The problem is, I’m still not seeing information architects in any official capicity, and on the Flash side, the Creative Directors seem to not participate.

    In short, we have a long way to go to improve these processes, ecspecially in Flex & Flash projects.

    For example, not every skin I’ve implemented was 1 line of CSS. Some required a significant amount of programming effort. Thus, we’ll have multiple “programmers” on the project, some even guys n’ gals doing both back-end and front end development at the same time. Me? Yeah, I’m coding, but I’m merely incorporating design elements. The other co-worker here did a really good job at putting the interface together, so I already have all the plumbing there; I can basically paint my way to making the app look good. It’s an interesting role. Even more interesting is that I STILL cannot get away from using Flash on these projects. There is always some need on a Flex project for it I’m finding. It’s not a bad thing, or a good thing, just an observation. Unfortunately, “Flash” the IDE in any capacity makes the traditional developers nervous for maintainability reasons, but I usually pawn it off to designers to maintain the FLA. Doesn’t always work, hehe!

    I think one thing that would help designers is to open up the Aeon FLA that comes with the Flex 2 framework, and see what’s capable. For example, I’m constantly getting designs with no over or down states. Those I do are still only 3 states. Most designers I’ve worked with don’t know a Flex Button has 6 states with a total of 9 different skins. On the Flash projects, they get free reign since the timeline obeys the designers whims, and I’m expected to code it. Regardless, I think it’d be easier for the entire project and cheaper for the client if the designers would design the Flex interface in Flash in the first place. This would make it easier for a production artist like me to put their design into Flex without ruining their original design in the process. A lot, though, have no idea what platform they are desining for, nor it’s capabilities. This is fine, but it’s pretty easily solved; get a Flex developer in the meeting where they are making design decisions.

    In the end, it’s all about communication. So, if ya got silo’s, well, that never is conducive. If you emailed me in the past week, sorry I haven’t responeded, really busy here. Mail & Gmail are filled with unread emails.

  • Flex Panel Expose Attempt

    Rather than let the code rot on my harddrive, figured I’d put it up here at least. Trying to emulate in Flex what Expose does on the Mac. You can hit F9, and all open windows will shrink so they fit on your desktop. You can then choose which one to bring in front. It’s really nice because of instead of going “elsewhere” to get to the window you want, you can just click it. Helpful for drag and drop stuff too.

    The window placing algorithm was frikin hard, and I never got window selection working. The cover shows up automatically instead of showing up when you hover over the window. Tons of things wrong and unfinished, but only messed with this for a couple of hours. Anyway, first time I’ve done state & transitions this heavy in code. Gotta say, it sucks. Love using Design View much better. Regardless, would of loved to have this code style years ago in Flash, that’s for sure.

    Using Zinc, you can have it work on your desktop. It’s not as good as my old stuff, but just bored on a Tuesday night and this is what I ended up with after a couple of hours of playing around. To preview it in the browser, click the button first to give Flex focus, and then press F9.

    Flex Panel Expose – Preview on Desktop | View in Browser | Source | ZIP

  • Using setCredentials in Flex 2 via Renaun’s RemoteObjectAMF0 in AMFPHP 1.2.5

    To skip rant and see solution, scroll to bottom.

    This crap was too frikin’ hard to find in Google. After spending 3 hours debugging, I figured out a solution, but not the source of the problem. Following the authentication example at amfphp.org, it just wans’t working. I kept getting an error about the user not having access to the method I was calling, in this case doLogin. Props to Patrick btw for giving us such informative and useful error messages we can catch in our fault handlers.

    This, however, didn’t go away when I put in the correct credentials. Credentials are basically the username and password added as a header to the remoting call so the server can authenticate you. This method is on NetConnection, but in ActionScript 2, you’d access it via:

    serviceInstance.connection.setCredentials ( "username" , "password" )

    and in AS1 via:

    serviceInstance.setCredentials ( "username" , "password" )

    The AS2 way is the same way it was in Flex 1.5 I think.

    Now, the proxying in Abstract service is working. Although the class is dynamic, and I think uses a __resolve like mechnism (returning a make-shift function if that function doesn’t exist on the class instance you are calling ), you can clearly see by ServiceCapture & TamperData that it only makes the 1 remoting call. However, both TamperData and ServiceCapture don’t show the damn headers. I couldn’t figure out how to do traces in AMFPHP to see what the headers were, and I can’t find a NetConnection swf anywhere on my hard drive to use the old NetDebug.trace way.

    Now, mx.rpc.AbstractService isn’t included in the Flex source. I put up with this no source bullshit back in Flex 1.5 and was hoping it wouldn’t negatively affect me in Flex 2, but apparently not. GIVE ME THE F’ING CODE, ADOBE! That said, you CAN at least set a breakpoint. Oddly, it was creating a credential variable and I think like using a “:” colon as a seperator; the var was called “cred”. I was wondering if maybe AMFPHP was hardcoded to look for a specific header called “Credentials”, what it was called in Flex 1.5 & Flash 8 on down, and this perhaps changed in Flex 2. Or, maybe the actual names changed to username vs. userid, which was what it was in ActionScript 2. :: shrugs ::

    Google didn’t turn up anything (first 10 results anyway), but Renauns blog had a comment with a guy with a similiar problem. He posted his solution. I had problems understanding it, though, because my copies of Cairngorm 2 and 2.1 don’t have the getRPCService, so that through me for a loop, but I saw what he was doing; he was basically manually adding the header. I didn’t want to mess with Renaun’s class, so I did it manually.

    It didn’t work. Kept bitching about a null reference. Digging in Renaun’s code, the connection “gateway_conn” is instantiated via lazy loading. In Flex 1.5 & Flash 8 & 7, this was done in the constructor. Renaun’s, however, does it on the first remoting call you make.

    if( gateway_conn == null )
    	gateway_conn = new RemotingConnection( endpoint );

    So, I first did a call to ping which sets the connection, and then added the header to the connection, THEN called doLogin.

    my_ro.ping();
    my_ro.gateway_conn.addHeader("Credentials", false, {userid: "admin", password: "myPassword"});

    She worked.

    SON OF A LAKSJDROItuioqasdf… :: whips out MG42 :: :: lights up office, flooding neihborhood with bullets ::

    Speaking of hellfire, my site now works in IE7; I’m not finished, but at least you can read the text. I hope IE burns for all eternity. While I do dig their implementation of RSS, if that is their best attempt at making RSS friendly to users… well.. um… we have a loooooooong way to go. Installing it didn’t fix that dang IE script pop-up error I get in Flex Builder 2 either. Weeeeeeeeeee!!!!!!!!

  • Net Neutrality & Mobile Gaming Parallels

    Lawrence Lessig links to a RampRate market commentary about how Net Neutrality” will seriously hurt online gaming. Like global warming, with Net Neutrality I’ve had a bunch of articles shoved in my face and expected to take them as fact and act upon them vs. discussion, research into the facts, and a clear, widely accepted tangible solution. So, while I get the general idea and thus threat of Net Neutrality I’m still extremely skeptical. Congress is 1 for 1 for me on the with regards to the internet. Their prevention of online taxes for so long is perceived for me as awesome to spur growth. Ted Steven’s rant about tubes, while not a neccessarey true representation of the tech knowledge of my Senate, still doesn’t seem to bode well. I’m indifferent about online gambling.

    In short, not sure what to think.

    For the sake of disscussion, let’s assume Network Neutrality truly means speed prioritization of internet service based on paying a higher fee to Internet Service Providers. The article makes a really good comparison to Mobile based on this assumption in the ” Parallels with Mobile” section, specifically mobile gaming. I think this could apply to any mobile software service, though, since they have the same distribution mechinism. Their bullet points pretty much summarzie my attitude as a developer towards Flash Lite, at least as a USA developer. Mainly being forced to assume insane business risk with weird revenue sharing, no easy access to the direct consumer, and having success held on the thread of being “chosen” by the operator to be put on the phone if they “feel like it”.

    I know of one guy in the US here in Atlanta doing work for oversea’s mobile clients. That’s just one guy, and yet, any Flash Developer is hard to judge “the rest of the market” by because we are so small in number compared to other software programmer industries.

    Anyway, this paragraph summarized it for me; the whole bloody section hit home:

    In short, when the network controlled the content, developers could not effectively iterate towards improvement or be fairly rewarded for their accomplishments. Their businesses and products suffered, which in turn severely retarded market development. Mobile gaming today is probably better on an original GameBoy than on the latest smartphone. And for all the limitless possibilities of using unique portability and location features to create new gaming communities, there is no World of Warcraft or Everquest or Second Life on mobile. If IP networks become akin to mobile networks in their restrictiveness, we may all find out why billion dollar revenue generators such as these die off.

    That “Parallels with Mobile” section is to me an accurate assessment of the mobile industry as perceived by a wanna-be Flash Lite developer right now. As such, if that accurate assessment is also an accurate assessment of Network Neutrality with regards to online gaming, yeah, major suck ahead, hard to port! The #1 problem with online gaming is lag, and if Network Neutrality increases ping time vs. the trend that has continued for years in ping time being LOWERED, then well… bummer.

    I’m not saying my life would be a different place if her majesty had said “lol” 8 seconds later vs. 1 second… I just wonder if it would of even happened online in the first place had Network Neutrality actually come to fruition when Star Wars Galaxies first started. Scary thought.