Blog

  • removeMovieClip vs. destroyObject

    What is the difference?

    In practice, they do the same, but are used differently. removeMovieClip can be used as a global method or local method (removeMovieClip ( someMC ) or someMC.removeMovieClip() ). destroyObject can only be used inside of a class that inherits from UIObject somewhere on the inheritance chain and takes the string name of the movie clip, not a movie clip path (destroyObject ( “someMC” ) ).

    Fundamentally, however, they are very different. removeMovieClip can only remove movie clips that are in positive depths, 0 included. Therefore, if you dragged a List component on the stage, removeMovieClip will not work on it unless you use the swapDepths command to bring the component to a positive depth (hopefully unoccupied) and then remove it. If the playhead leaves, however, the frame where the List component is, and then returns, the List too will re-appear.

    destroyObject does this for you automatically. Additionally, since movie clips/components in classes use member variables, it takes the liberty in deleting the component’s name; not the variable itself mind you, but the name nonetheless.

    Neither deal with pointers to the object you may have created elsewhere.

  • Web Apps vs. Windows Client Apps

    Read this article from the Community MX newsletter that pointed it out. Really, really cool and informative. One man’s opinion, but damn he’s smart… really good at articulating and not going on tangent trees that aren’t clearly traceable back to your original point. Dig his writing.

    Anyway, a few beef’s I had with the article, which I know he didn’t want, but too bad.

    He espoused the benefit of programming languages that manage memory for you as being more productive and quantified them into 3 points. However, 2 and 3 I tend to disagree with from the angle of Flash… still in limbo about it’s applicability to Director, but even before I start my upcoming email to Flashcoders to get some more info on a theory, he’s my frustrations. He says in the 2nd sidebar:

    “…2) Because you don’t have to spend any time writing code to free memory or tracking down memory leaks.
    3) Because you don’t have to carefully coordinate the exit points from your functions to make sure things are cleaned up properly.”

    #2 doesn’t apply to Flash, because yesterday I did just that. Return values from attachMovie, even if defined as a var, don’t die if they are objects. I thought their pointers did, but I was wrong. And, I know #3 is really for those who’ve come from a C background, but as far as I’m concerned, it’s much like #2.

    At any rate, I’m slowly changing my development methodology in Flash about utilizing return values from attachMovie/createClassObject methods. They return a reference to the component/movie clip created. I was using this for ease of typing, and flexible code, but now that I realize that I have very little control (still researching how much), and nothing short of nulling the reference at the end of the function, even though it is a local variable that’s supposed to die anyway, the mere fact that it doesn’t is just frightening. Not only that, but since AS2, it should be a class member anyway. Can you stop a web service connector created in this way? Nope. You need to clearly write out the web service’s movie clip path to remove the responder object, which you also need to keep around as a member variable to remove via removeEventListener.

    Semantics aside, delete (ref_mc) not working, but ref_mc = null deleting a local variable is just… wrong. Maybe not technically, but in providing an application for me to develop in with an easy way to be irresponsible; it’s just asking for trouble. This is compounded by the fact that no one can clearly document Flash’s activation object, but they know all about how to hack it to keep scope when defining anonymous function’s on objects.

    The point is, yes, I think it does increase productivity, but only if done right AND in a way that leaves little room for one to be irresponsible.

    He also made 6 points on what is wrong with application development on the web. I though #6 was kind of cool because Central aims to fix that one.

    “…6) Let people continue working when they are not connected to the Internet.”

    Anyway, good article, definately worth a read over coffee.

  • Why Vital Stream?

    Talking to a fellow contractor out in Cali, and he asked if there is any major benefit to Vital Stream. I, like many Flasher’s I’m sure, heard the press release but didn’t really bat much of an eye. I guess because we really didn’t see how it was applicable to what we do in our day to day work. Not all of us, sure, but most I would think.

    This was my first real reading of what it really “is” and through my reading, I somewhat quantified the why’s and hopefully some of the hows in my response. If I’m wrong or misguided, please clarify. My response below:

    *******

    I’d sum it up in one sentence as “Simplified and affordable Flash video deployment.”

    Typically, peeps in the pR0n industry will setup boxes at backbone hubs which are insanely fast, and have a plethora of bandwidth. Since they are physically right next to it, it’s cheap too. Since everyone doesn’t have such a luxury, you have to setup your site by renting one of these beasts. My guess that’s the first thing it accomplishes; Macromedia has a benchmark a vendor/ISP has to meet in order to “be on board as a provider”.

    Secondly, Flashcom administration is a royal pain in the ass. At least 40% of all questions on the Flashcom list over a year have been dealing with admin issues; from “why is the server choking a 2gig p4, 2gig RAM, RAID-array box?” or “How can I see what the user’s bandwidth is to charge them?” Stuff like that. My guess is, from Macromedia’s experience with Breeze, and using Flashcom in house to build their own product, they saw a need to make it easy for companies to deploy. So, they’ve probably updated their backend for ease of administration.

    Thirdly, Real & Quicktime have being doing this forever. They have proprietary, insanely expensive hardware/software solutions that do effectively the same thing and are advertised as “optimized for streaming Real video”. There is a market for companies who wish to deploy a LOT of video, both external and internal. Since Flash is so ubiquitious, it’s only a natural step. Superbowl.com and other sites who experience tons of video downloads/streaming I’m sure use systems like that.

    Finally, it’s merely furthering the Flash Player’s ubiquity. Since a lot of Macromedia’s business model is based around the Flash Player, this only furthers it’s spread now that servers are “optimized to deliver content for it”. People go, wow, let’s deploy some Flash.. hey, anyone know a Flash developer to build this shiot?” So, it’s good all around, bad for competitors, hehe.

    …it’s cool because it’s not just for computers, but for where the heck the Flash player goes; computer, PDA, laptop, Phone, set-top-box, etc.

    So, yeah, I think it’s got major benefit, but not mainly to small time developers, more so to companines that have video streaming needs that far exceed that average Joe. Both short term and long term.

  • Visual SourceSafe & Flash’ Project Panel

    I have just managed to get Visual SourceSafe and Flash’s project panel to work together. I checked out files, changed them, and checked them back in. It’s very fragile, but it works, and is kind of neat. We’re supposed to get CVS working in the future. For now, we’re using SourceSafe.

    Some things to keep in mind:
    – you need to check out your Project file (FLP) first before you check out the project in Flash. To be safe, check it out of SourceSafe, then open it up in the project panel in Flash.
    – when checking things back in, make sure the file is closed in Flash.
    – it’s slow, be patient. The dialogue may not refresh, but it usually is working. If your still paranoid, and you get a not not responding on PC, it might crash within a few seconds. Otherwise… it’s just slow.