Blog

  • Win a kid for a quarter!

    <a href=”http://www.chippewa.com/articles/2004/01/04/news/news3.txt”>7-year-old gets stuck in stuffed animal game machine</a>

    <a href=”http://www.chippewa.com/articles/2004/01/04/news/news3.txt”><img src=”http://www.chippewa.com/content/articles/2004/01/04/news/news3.jpg” border=”0″ /></a>

  • MovieClip._grandpa

    And to think, all you have to do nowadays to obtain Kudos from peeps is whip code out ye arse… rock on!

    Derived from <a href=”http://www.darronschall.com/weblog/archives/000081.cfm”>Darron’s _location</a>. Prototype ain’t dead, just under-used.

    Can you eat Kudos?

    Read on for code…

  • attachMovie doesn’t return a value… in the Twilight Zone

    Ok, it must be because I’m down to the wire on this project, but after the 2nd time of having attachMovie not return a value in one of my functions, I just couldn’t take it anymore, and had to solve it.

    And I did, MOFO!

    …I just don’t understand the results.

    My problem:
    – attachMovie was not returning a value
    – tracing the function call printed the movie clip path in the Output Window
    – tracing it with a string in the trace statement printed a NaN in the Output Window; trace(“ref_mc: ” + attachMovie(“MyComponent”, “my_mc”, 0));
    – utilizing typeof and instanceof showed undefined in the Output window
    – any return value showed undefined

    …uh, no, that’s not how attachMovie works. It doesn’t attach a component and then have that component magically work, but not return a value. If I accessed the movie clip, however, it worked. Now, a RAD type of developer would of moved on, simply replacing ref_mc with a pointer to the movie clip’s real name.

    Personally, I don’t like shiot breaking and not knowing why. So, after investigation, it turns out that placing a “stop();” in an AS2 constructor/init function will cause the return value to fail. this.stop, using a stop in AS1, or this.stop in AS1 are all fine.

    Uh, yeah…ok… sure, that makes tons of sense. :: dar dar dar :: * hits right wrist on chest heavily *

    This is important in designing AS2 components because you now place your component’s assets on frame 2 on a non-guided frame. You now have to add a stop to prevent your component from ever reaching that frame since it’s merely there to ensure your component includes all it needs in either travelling to another FLA’s library, or transforming into an SWC. You can place a “stop” command on the timeline on frame 1 if you wish, but most purists don’t believe in any timeline code if possible. Putting it on the constructor/init function is best.

  • Shared Libraries only work within same version SWF

    Ok, one thing to watch out for if your using Shared Libraries in Flash MX 2004 and exporting for 6. Shared SWF’s that are version 6 only work with version 6, and same with version 7 SWF’s only working with version 7 SWF’s. It’s pretty easy to get your wires crossed and wonder why the heck your stuff isn’t working. It’s a little disconcerting too as I’m still learning how the “Make Default” works in relation to Publish Settings.

    For example, in Flash MX, if you made some changes to the Publish Settings, clicked OK, and then did Control + J, and clicked “make default”, this would globally make all of your new FLA’s, even after rebooting Flash utilize those settings (pretty sure as I don’t have MX installed here). Used to wreak havoc on people would click “omit trace actions” and weeks later wonder why their SWF was tracing anything. It doesn’t work this way in Flash MX 2004 it seems.

    Anyway, just something to watch out for since a lot of us may be still exporting to 6, but Flash MX 2004 seems to default to publishing to 7.