Blog

  • MUD Hyperlink Engine & XML Creator

    Another one of my failed experiments. Assuming some of the code is salvageable or perhaps one can learn something.

    Attempting to build a piece of a bigger game, and this started as a MUD engine of sorts where it’ll read an XML file, and you’ll interact with speakers. They’ll say something to you, and you can respond by clicking the hyperlink of what you want to say, in effect, having a limited interactive dialogue. The XML format was complicated, so I attempted to build a tool to easily create the XML files vs. writing some cryptic XML format in Dreamweaver all day. After a week, I’ve lost interest. Too much trouble for what I want to do. Back to the drawing board.

    D&D Simple Game: MUD Engine & XML Creator – ZIP

  • Draw Lines with Undo

    Question on Flashn00bz mailing list stuck with me today. A bloke wanted to draw some lines, one at a time, and then have an undo that you could actually see. I figured the command pattern was where it was at.

    Upon getting home, I tried working on a side project, but couldn’t concentrate (lot on my mind), so I fiddled with this. Was a lot easier than using that bloody pattern. It has undo as well as undo all, and you can see them undo. Draw on the gray square via clicking and holding, drag your mouse, and let go of left mouse click.

    Drawing Lines with Undo – HTML | ZIP

  • XUL Controls Inaccessible via JSFL

    …but not the other way around. Co-jacked, I know.

    Check it:
    – save the JSFL file wherever you want.
    – save the XML file wherever you want.
    – open Flash, make sure you have a fresh FLA open, go to Commands, and choose “Run Command…”.
    – select the JSFL file and click open
    – select the XML file and click open

    Notice that the button you click runs a JSFL function, but the function itself cannot call any native XUL methods on the control.

    The JSFL

    var fileURL = fl.browseForFileURL("open", "Select file");
    var propertySettings = fl.getDocumentDOM().xmlPanel(fileURL);

    The XML

    <dialog id="sample" title="Sample" buttons="accept,cancel">
    <script>
    function test()
    {
    alert("Ok, JSFL Launched this, but I can’t access the same button that launched this code…!");
    some_btn.label = "I wish this worked…";
    }
    </script>
    <label value="Click the button called ‘some_btn’" />
    <button id="some_btn" label="Click Me" oncommand="test();" />
    </dialog>

    I found out yesterday that Mozilla, and I think Firefox too, support this via getObjectById, or whatever. Basically you pass the object’s string name, and it’ll return the form control, just like accessing it via documents.all or however one does in IE.

    …this doesn’t work in Flash, though.

    Frankly, I think this is the last, important step that needs to be done to truly have JSFL make Flash extensible. A lot of custom form applications cannot be done using XML and JSFL alone… merely because the forms are only there for data holding; period. You cannot actually populate data into them in an interactive, and meaningful way. They are nice for simple text fields… but that’s it.

    In the meantime, I’ll just use the Flash tag, and write a form SWF to run in a panel, but it’s still lame. After messing with XUL in Mozilla last week, it’s pretty quick compared to Flash in forms creation in my opinion. If your trying to do quick utilities, XUL is where it’s at. I hope Macromedia finishes the implementation; it’d make Flash more rockin’ than it is now.

  • My Dad Starting Halloween Decorating Early

    This is in my dad’s front yard in Ocean City, Maryland, USA.

    Mooning Pumpkin Scarecrow

    Larger Version