Blog

  • Flex: Star Wars Galaxies Resource Viewer v3

    Built v3 of my SWG Resource Viewer in Flex (1st @ 2nd Central, 3rd Flex). It’s basically an application that shows you a list of recent resources, data being served from community driven swgcraft.com, that crafters in the Star Wars Galaxies MMORPG can utilize to filter the results and see what resources are available. Since resource quality, types, and locations change weekly, and some qualties/types don’t resurface for months at a time, crafters from Amorsmiths, Weaponsmiths, and even Chefs like to know what’s what, and where since some things in game can’t be made without certain ingredients.

    As such, I tried my best to implement 2 filtering mechnisms in the huge amount of data; quality range & profession type. Quality range is adjusted by averaging the current numbers displayed in the columns currently visible, and showing only what matches the range set on the dual-thumbed slider. The 2nd is using an XML file to only show resources a certain profession cares about. Currently only weaponsmith is implemented because her majesty has a weaponsmith for 1 of her characters, and thus asked me to implement it. I’ve already been asked for a plethora of minor feature requests mainly relating to usability (saving colums, saving DataGrid widths, filtering via other professions, etc.). Not that I don’t already have enough open source software projects to work on (CaptivatePlayer, AMFPHP examples, personally modded-ARP) in my free time.

    Anyway, app’s there with source. I used some of ARP in Flex (made my own Controller class instead of mapping commands directly). Commands rock! Also, since I ripped the SWF out and lost all JavaScript, I had to use PHP to automatically write FlashVars tags based on what you set in the URL for get vars (was using PHP anyway to get the gzipped XML feeds). Flex by default uses JavaScript to parse out the URL, and setup _root/mx.core.Application.application scoped vars that you can utilize to init your application.

    SWG Resource Viewer v3

  • Zinc Browser & Hacking Root: Part Deux

    Ok, callback had nothing to do with _root hacking; it had to do with the exe calling the SWF from a remote URL. Since the ActiveX is being used (thanks for the 411 Kenny), it’s still acting like a browser based SWF, and thus is restricted by the security sandbox. So, Zinc can’t call the onBrowserDocumentComplete event on _root… because it’s not allowed per Flash’s security sandbox.

    You package it internally vs. a remote SWF, and she works fine.

  • Xamlon MapServer, aka “Google Maps in C# + Flash”

    Wasn’t aware of this addition to the Google Maps I’m-insecure-with-SWF retaliations. Laughingly, I’ve seen Manish’s Flex version, and this Xamlon(C#-to-SWF) version… but no pure Flash one!? Hah hah!

    Since the open-source g33ks are pushing your buttons, I’ll do so too; can this not be done in pure Flash? :: maniacal laugh ::

    Via Darron Schall.

  • Zinc’s Browser & Hacking _root

    *** Updated 7.7.2005 ***

    Zinc allows you to have a browser appear over top of your Flash movie so you can make an interactive web browser. However, Zinc’s programming model assumes AS2 classes don’t exist and _root is… well, just like everyone views _root; as their playground, putting anything they want there and assuming it won’t change.

    What we do is something Darron Schall showed me, only a little different. It allows us to treat _root as a class, get syntax checking, and emulate what Flex does with “mx.core.Application”. We override _root’s __proto__ so it points to our Singleton class, call its constructor manually, and call onLoad if it hasn’t been called already. I had to put a conditional for onLoad because sometimes it gets called for you, and sometimes it doesn’t (like when you debug in Flash).

    Example

    // ensures Flash/MTASC compiles class
    import com.Application;
    var depend:Application;
    delete depend;
    
    // override _root's proto
    this.__proto__ = _global.com.com.Application.prototype;
    //call constructor
    _global.com.Application.apply(this, null);
    // call onLoad if it hasn't been called already
    if(this.calledOnLoad == false)
    {
            this.onLoad();
    }
    
    
    

    That, however, pisses Zinc off. We have do store a reference to the Browser’s class instance on _root (Application class) so it knows to forward events it gets such as when a webpage is done downloading in the browser(in this case, “onBrowserDocumentComplete”). However, after doing the above _root.__proto__ override, I no longer receive those events. It seems the _root Zinc thought was there is no longer there, even though I can clearly trace out the funciton it needs as there and available. Making it static doesn’t work either. However, putting this in the constructor does:

    this.onBrowserDocumentComplete = this.onBrowserDocumentComplete2;

    Where the “onBrowserDocumentComplete2” is the class method, and onBrowserDocumentComplete is merely a variable you define up top:

    public var onBrowserDocumentComplete:Function;

    Something about _root’s “instance” is what Zinc likes I guess. Anyway, I now get my _root events again from Zinc.