Blog

  • PopUpManager & loadMovie

    This is the 2nd time this year I’ve been burned by PopUpManager and loadMovie. I’ve had to read the code in PopUpManager.as about 3 times to get an inkling of wtf is going on, but basically, it finds the “true root” of your movie.

    While you can hide _root’s hardcoded timeline by using _lockroot, _root still has one way to get around it, and that’s that it is really a MovieClip which has a _parent property. So, _root has a _parent if he’s loaded into another movie. PopUpManager apparently knows this, and can dig his way up to find the true _root which is, as we all know, _level0. But, he uses elaborate recursion instead of writing _level0… whatever.

    Bottom line, this forces you to keep copies of component assets in the movie loading you if you wish to utilize PopUpManager. This defeats the whole purpose of loadMovie’s flexiblity in loading in any SWF into any container and/or circumstance.

    If I were using a modal dialogue, I’d think it’d be excluded from the rules of true modality because you cannot control “who is loading you“. While I appreciate the resourcefulness of PopUpManager’s attempt, it’s fatal flaw is assuming that movie loading it knows what assets are in the SWF it’s loading, and thus has exact copies to load.

    As far as I can see, 3 solutions, all of which suck:

    1. Keep assets in the SWF that’s loading the other SWF in. Already explained why this sucks.
    2. Utilize SharedLibraries to lessen the damage. So, if you are loading a “LoadingWindow” component, put it in a SharedLibrary, and have both the SWF that’s the container, and the SWF that’s being loaded both use the LoadingWindow as a shared asset. More to manage.
    3. Don’t use PopUpManager. Replace with attaching a component to _root since that can be abstracted away. However, you lose the modality aspect.

    This is why I don’t use loaded movies in my development. Flash & Flex, at least with the current component framework, does not facilitate it. I do not think an improved framework would work either because you’d need something player bound to allow easier asset sharing between SWF’s, otherwise you’re just relaying on an implicit contract. “Dude, can you give me like 2 methods in your SWF? I’ll then call them.” It’s the same thing you do when writing encapsulated classes, so hopefully Macromedia Flash Player engineers will see the parellels, and someday implement this ability to treat a loaded SWF just as an SWC treats it; a component.

    …anyway, real world solutions I’ve used: The first time, we just copied those assets needed (Window and Alert) in the main movie. The second time, I just said heck with it, and made the entire application an SWC and said here you go.

  • VGMap = Google Maps + Flash + JavaScript

    Caught this while trolling MXNA from injun #576871. Basically, they utilize Flash for what it does best and show additional graphics, mainly runtime, vector drawn plots/lines/graphics over top of Google Maps. The example includes a New York City Subway example. When compared to it’s boring forebear, you can see why someone would want to utilize this technology.

    I downloaded the beta code (assuming beta b/c of the b) they have available, and was very impressed. Nicely commented JavaDoc style, and even includes a build of the JavaScript Kit, which is used to allow JavaScript and Flash to speak to eachother easily. A little light on a glorified API wrapper, though.

    I will say this. This is a glaring example of what paying attention to women and beer vs. Trig in high school will do in the long run… either that, or I am just not a map geek. There is some SERIOUS math stuff going in there, mainly in the Flash side, which is really nice. I’ve used a lot of that abstracted stuff in the past, and man does it help. You know the result you want, and the code helps you get there without having to worry about how it really works.

    All I’d ask for is further abstraction in terms of methods via a wrapper class. While x, y, latitude, and longitude getter/setters are great, so to are “moveMapToHere”, and events for “map latitude and longitude changed”. Overall, great effort, and nice to see how Flash can compliment an existing technology by what it does best.

    Nat’s got some additional coverage over at O’Reilly Radar, although his title is backwards.

  • Flash Developers, Witness The Future

    What’s it like to be a “Flex Developer”? Check out Mike Chamber’s taping of Kevin Lynch showing the lucky attendees’ of Web 2.0 the 411 on Flex Builder 2 (running in Flash Player 8.5 utilizing the Flex Framework 2). Acknowledge those who have confirmed that Flex 0W|\|z jU (me, Ted, JD, Darron, Mike C), and develop RIA’s the fun way! If your so inclined, add Flash to spice it up, capitalize on exclusive features, get another opinion and contemplate your place in the future that is more power, bequeathed to the rich media masses.

    POWER UP!!!

  • Low Down on AS3, Flash Player 8.5, and the Flex Product Line

    Trolling the blogs & email lists. This is the best, non-marketing laced, and most straight forward description of everything involed dealing with ActionScript 3, Flash Player 8.5, Flex Builder 2, Flex Framework 2, and the Flex Enterprise Services 2. Cutting through the hype directly from the source, check out Mark Ander’s entry.