Welcome to my website. I am always posting links to photo albums, art, technology and other creations. Everything that you will see on my numerous personal sites is powered by the formVistaTM Website Management Engine.

icon.linkedin.jpgicon.twitter.jpg

  • Open Source Flash Charting Package: Open Flash Chart
    10/02/2009 10:58AM

    ofc_logo.pngWe have a client that is in need of some dynamic Flash charts.? After some googling I came accross the Open Flash Chart project.? It seems to be an active project with a decent following.? Moreover, there are a number of other commercial products out there that are using the LGPL licensed code.

    It looks to be a fairly mature code base that provides an enormous amount of customization without editing any ActionScript code or recompiling any .swf files.? Right now, I'm just struggling with the lack of documentation and it's just taking a while to figure out the syntax of the php front-end that is provided; through which you can generate the JSON data set that the Open Flash Chart swf reads.

    Here are links to the docs and resources that I have found:

  • getURL() in a Projector Firefox Bug and Solution
    10/24/2008 11:06AM
    If you have ever tried to do a simple getURL() command in Flash from an .exe projector you'll notice that it fails when Firefox is your default browser.

    Following is the solution to the problem in both AS 2.0 and AS 3.0
    Here's the code for the fix in AS 2.0:

    // code on a keyframe on the main timeline

    var swfUrl:String = _root._url;
    var lastSlashIndex:Number = swfUrl.lastIndexOf("/");
    var pipeIndex:Number = swfUrl.indexOf("|");
    var baseUrl:String;
    if (pipeIndex >= 0)
    {
    baseUrl = swfUrl.substring(0, pipeIndex);
    baseUrl += ":";
    }
    else
    {
    baseUrl = "";
    }
    baseUrl += swfUrl.substring(pipeIndex + 1, lastSlashIndex + 1);

    myButton.onRelease = function()
    {
    var targetUrl:String = baseUrl + "test.html";
    getURL(targetUrl, "_blank");
    };


    Here's the code for the fix in AS 3.0:

    // code on a keyframe on the main timeline

    import flash.events.MouseEvent;
    import flash.net.*;

    output_txt.text = this.loaderInfo.url;

    var swfUrl:String = this.root.loaderInfo.url;
    var lastSlashIndex:Number = swfUrl.lastIndexOf("/");
    var pipeIndex:Number = swfUrl.indexOf("|");
    var baseUrl:String;
    if (pipeIndex >= 0)
    {
    baseUrl = swfUrl.substring(0, pipeIndex);
    baseUrl += ":";
    }
    else
    {
    baseUrl = "";
    }
    baseUrl += swfUrl.substring(pipeIndex + 1, lastSlashIndex + 1);

    function gotoTestHtml(event:MouseEvent):void
    {
    var targetUrl:URLRequest = new URLRequest(baseUrl + "test.html");
    navigateToURL(targetUrl, "_blank");
    }

    myButton.addEventListener(MouseEvent.CLICK, gotoTestHtml);


    Here is a link to the original article where I found this with the full explanation and fix.
Advanced Search

Categories

Archives