Load Akamai plugin example using Static plugin loading method

Hi,
I want to load Akamai plugin example using Static plugin loading method. For that, I passed "com.akamai.osmf.AkamaiBasicStreamingPluginInfo" as a class defination, but I got error stating, ReferenceError: Error #1065: Variable AkamaiBasicStreamingPluginInfo is not defined.
Makjosh once sent a post that the title was "Getting an error while loading the plugin using static plugin load method". I then follow the solution. But how can I add the dependent project(Flex/AS Build Path -> Library Path -> Add Project). As a result, I do not find the AkamaiBasicStreamingPlugin project only having the NetMocker project and the StrobeUnit project in it.
So I try to link the AkamaiBasicStreamingPlugin project use the following method(project properties->Project References->select "AkamaiBasicStreamingPlugin"), it still causes the same error.
Please help me.
Thanks.

Hi,
A couple of things to look at:
1) Make sure you have the import statement in your project:
            import com.akamai.osmf.AkamaiBasicStreamingPluginInfo;
2) Make sure you add the AkamaiBasicStreamingPlugin folder to your Flex Build Path (right click project, select "properties", then "Flex Build Path", in "Source Path" you need to add the plugin folder).
3) If you are still getting Error #1065, you can try a trick where you force the swf compiler to pull in the class:
            private static const loadTestRef:AkamaiBasicStreamingPluginInfo = null;
Now you should be able to use getDefinitionByName to load the plugin:
                var pluginResource:IMediaResource;
                var pluginInfoRef:Class = flash.utils.getDefinitionByName(className) as Class;
                pluginResource = new PluginClassResource(pluginInfoRef);
                pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOADED, onPluginLoaded);
                pluginManager.addEventListener(PluginLoadEvent.PLUGIN_LOAD_FAILED, onPluginLoadFailed);
                pluginManager.loadPlugin(pluginResource);
Hope that helps,
- charles

Similar Messages

  • Is is better to use static variables?

    Hi,
    Does anyone know if it's better to use static variables or to use normal variables?
    Concerning the size of the code, it seems that declaring a variable as static is more consuming (for example plus 6 bytes for an object reference).
    So this could mean that declaring variables as static should be avoided, but what about the execution time?
    Some years ago, some javacard gurus were claiming that it's was better to use static variables (less processing required by the JVM to resolve adresses of static variables), but is it still the case?

    Hi Lexdabear,
    Thanks for the answer.
    I did the test (I converted my all code to use static variables and methods as much as possible), and did a bench before and after, on a JCOP31 card.
    The conclusion is that today JVMs and processors are much powerful than 5 years ago, and that the difference is really difficult to measure, which anyway is a good thing for us ;-)

  • [svn:osmf:] 10587: Modified the Akamai Plugin Sample app: 1) Added the new MAST plugin; 2) Added support to load the plugins as static or dynamic

    Revision: 10587
    Author:   [email protected]
    Date:     2009-09-24 18:42:35 -0700 (Thu, 24 Sep 2009)
    Log Message:
    Modified the Akamai Plugin Sample app: 1) Added the new MAST plugin; 2) Added support to load the plugins as static or dynamic
    Modified Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.actionScriptProperties
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.project
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.css
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.mxml

    Revision: 10587
    Author:   [email protected]
    Date:     2009-09-24 18:42:35 -0700 (Thu, 24 Sep 2009)
    Log Message:
    Modified the Akamai Plugin Sample app: 1) Added the new MAST plugin; 2) Added support to load the plugins as static or dynamic
    Modified Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.actionScriptProperties
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.project
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.css
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.mxml

  • [svn:osmf:] 11414: Modified Akamai plugin sample app to load MAST plugin from Akamai network.

    Revision: 11414
    Author:   [email protected]
    Date:     2009-11-03 12:31:51 -0800 (Tue, 03 Nov 2009)
    Log Message:
    Modified Akamai plugin sample app to load MAST plugin from Akamai network.  Also added missing readme.txt for the sample app. 
    Modified Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.project
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.mxml
        osmf/trunk/plugins/MASTPluginIntegrationTest/.project
    Added Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/readme.txt

    Revision: 11414
    Author:   [email protected]
    Date:     2009-11-03 12:31:51 -0800 (Tue, 03 Nov 2009)
    Log Message:
    Modified Akamai plugin sample app to load MAST plugin from Akamai network.  Also added missing readme.txt for the sample app. 
    Modified Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/.project
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.mxml
        osmf/trunk/plugins/MASTPluginIntegrationTest/.project
    Added Paths:
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/readme.txt

  • Help! Trial version for AFX won't Download (akami plugin? Vista?)

    I am on windows Vista home premium, and I can't download the trial version for AFX, anyone have any ideas I'd truly appreciate it.
    Using Mozilla firefox v 3 10, i have allowed pop-ups at adobe.com and content.  I select the trial version of Adobe AFX for Windows (english), I am able to get as far as to the Akami download manager (a window that pops up with that title) but nothing happens, the window that appears is empty.  It just says "done" instantly.
    In other words, nothing downloads. No indication of anything being blocked from my firewall, or the web browser.
    I CAN download other adobe programs from adobe.com that do not require the akami plugin (such as acrobat professional), also i can download programs from other websites, so i'm thinking, it's either a Vista firewall issue (which does not make sense), an Akami/Vista compatibility issue or a server issue (adobe side), the latter 2 seem the most likely possibilities. 
    I've followed the instructions (I think) accurately on possible trouble shooting for this and to no avail. The link for the instruction book for the akami plugin brings up a 404 file not found too
    Any ideas? or confirmations please. (is Firefox and IE explorer interconnected in some fashion? thus, would any settings in IE affect firefox?)

    Thanks Mylenium, I truly appreciate your response and time/energy.
    I did allow noscript to pass, and it was a brand new installation from Sun Java and brand new install of Firefox, was in fact why I installed both specifically for the trial because it wasn't working in Opera or IE.  =/     Hence is why i think it's Vista related or server side.
    I will try looking closer at Java related issues again like you suggest, another browser or try it from another computer.  Hopefully post an update if I figure it out lol.
    Thanks agin.
    jon

  • In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File

    Post Author: bhaveshbusa
    CA Forum: Crystal Reports
    In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File. When the application calls ReportDocument.Load(reportFileName). This
    tries to connect to the database using the connection information embedded in
    the "reportFileName". This was only realised on checking the ODBC Trace
    Log. The connection itself is not a problem. The problem is that the embedded
    connection information is related to OLD production system. And failed
    connections had raised some concerns.
    Note: I am using
    SetDataSource to populate the data for the report. So I don't need the
    connection.
    Is there any way I
    can disable this auto-connect?
    Thanks and
    regards,
    Bhavesh

    960738 wrote:
    I need a help in answering one of the issue encountered last week.
    I have created a database link and tried to access the information from a table using the program written in another language. The password provided was incorrect for that user while creating database link. So we expected that,while retrieving the data, Database connection has to be errored out as password provided is incorrrect.
    But unfortunately, user account was locked out. When i checked with DBAs they mentioned that it tries to connect 16 ports with in a min of time.we were shocked as it STOPS another scheduled jobs with that user. and affects production badly.
    As per the program, it has to connect only one time and yesterday we tried to execute the program in DBAs observation and it errored out as expected. Didn't tried for multiple ports.
    Now the question is, WHY the database connection established 16 times last week and caused user account locked. DBAs are unable to answer it. Any EXPERTs opinion on this would greatly appreciated.
    I have verified managing ports in oracle documentation, it was mentioned that if one port is busy it will try to connect to another port in the range of ports mentioned during the installtion. DBAs verified ports related file and it was blank. and they are not agreeing with this reason. Please HELP me in finding the correct REASON for this.
    is it a NETWORK issue or issue with DATABASE SERVER only?
    Thanks
    SSP
    Edited by: 960738 on Sep 22, 2012 9:13 PMDBLINK is 100% oblivious to the fact any port exists.
    DBLINK only contains username, password & TNS Alias.
    can you post actual SQL & results?

  • Change position of SWF using load method

    Hello,
    I'm a new Flash user, so I apologize in advance if this is a
    dumb question. I'm trying use the load method to load an external
    SWF, which I've done. However, the SWF loads in the upper-left
    corner. How can I manipulate its position?
    (I want to position it more in the center?)
    Thanks

    you must have loaded it into a holder movie clip correct? you
    can use the x and y properties of the holder movie clip to
    manipulate the position. The SWF must be loaded first before those
    properties are available. It is best to use the MovieClipLoader
    class to load the SWF so you can use the onLoadInit event to
    manipulate the properties.

  • Why not to use static methods - with example

    Hi Everyone,
    I'd like to continue the below thread about "why not to use static methods"
    Why not to use static methods
    with a concrete example.
    In my small application I need to be able to send keystrokes. (java.awt.Robot class is used for this)
    I created the following class for these "operations" with static methods:
    public class KeyboardInput {
         private static Robot r;
         static {
              try {
                   r = new Robot();
              } catch (AWTException e) {
                   throw new RuntimeException(e + "Robot couldn't be initialized.");
         public static void wait(int millis){
              r.delay(millis);
         public static void copy() {
              r.keyPress(KeyEvent.VK_CONTROL);
              r.keyPress(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_C);
              r.keyRelease(KeyEvent.VK_CONTROL);
         public static void altTab() {
              r.keyPress(KeyEvent.VK_ALT);
              r.keyPress(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_TAB);
              r.keyRelease(KeyEvent.VK_ALT);
                   // more methods like  paste(), tab(), shiftTab(), rightArrow()
    }Do you thinks it is a good solution? How could it be improved? I've seen something about Singleton vs. static methods somewhere. Would it be better to use Singleton?
    Thanks for any comments in advance,
    lemonboston

    maheshguruswamy wrote:
    lemonboston wrote:
    maheshguruswamy wrote:
    I think a singleton might be a better approach for you. Just kill the public constructor and provide a getInstance method to provide lazy initialization.Thanks maheshguruswamy for advising on the steps to create a singleton from this class.
    Could you maybe advise also about why do you say that it would be better to use singleton? What's behind it? Thanks!In short, it seems to me that a single instance of your class will be able to coordinate actions across your entire application. So a singleton should be enough.But that doesn't answer why he should prefer a singleton instead over a bunch of static methods. Functionally the two are almost identical. In both cases there's only one "thing" on which to call methods--either a single instance of the class, or the class itself.
    To answer the question, the main reason to use a Singleton over a classful of static methods is the same reason the drives a lot of non-static vs. static decisions: Polymorphism.
    If you use a Singleton (and and interface), you can do something like this:
    KeyboardInput kbi = get_some_instance_of_some_class_that_implements_KeyboardInput_somehow_maybe_from_a_factory();And then whatever is calling KBI's public methods only has to know that it has an implementor of that interface, without caring which concrete class it is, and you can substitute whatever implementation is appropriate in a given context. If you don't need to do that, then the static method approach is probably sufficient.
    There are other reasons that may suggest a Singleton--serialization, persistence, use as a JavaBean pop to mind--but they're less common and less compelling in my experience.
    And finally, if this thing maintains any state between method calls, although you can handle that with static member variables, it's more in keeping with the OO paradigm to make them non-static fields of an instance of that class.

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

  • [svn:osmf:] 12773: Update Akamai plugin to remove unneeded constructor param.

    Revision: 12773
    Revision: 12773
    Author:   [email protected]
    Date:     2009-12-09 22:45:24 -0800 (Wed, 09 Dec 2009)
    Log Message:
    Update Akamai plugin to remove unneeded constructor param.
    Modified Paths:
        osmf/trunk/plugins/akamai/AkamaiBasicStreamingPlugin/com/akamai/osmf/net/AkamaiNetConnect ionFactory.as

    I am getting this same issue. Did you ever find a fix for this?

  • [svn:osmf:] 14272: Integrate Akamai plugin with latest changes.

    Revision: 14272
    Revision: 14272
    Author:   [email protected]
    Date:     2010-02-18 22:14:21 -0800 (Thu, 18 Feb 2010)
    Log Message:
    Integrate Akamai plugin with latest changes.
    Modified Paths:
        osmf/trunk/plugins/akamai/AkamaiBasicStreamingPlugin/com/akamai/osmf/net/AkamaiNetLoader. as
        osmf/trunk/plugins/akamai/AkamaiBasicStreamingPlugin/com/akamai/osmf/net/AkamaiNetStream. as

    Hi Geoff,
    you run into a known bug:
    https://bugs.adobe.com/jira/browse/ST-271
    You can track it to see when it will get fixed (I don't have a time frame for that).
    S.

  • Can't get networkmanager working with openvpn (using static key)

    I'm trying to configure networkmanager to open up my VPN connection - using the static/preshared key method - but no dice.  (Although I'm able to connect just fine using openvpn from the command line)  Anyone been able to get this to work and/or have some suggestions?
    I've installed the packages networkmanager, networkmanager-openvpn, and nm-applet.  I run nm-applet, and configure the connection, but when I try to launch the connection, it fails.  Log file reads as follows:
    Oct 28 16:43:56 daroselin NetworkManager: <info> Starting VPN service 'org.freedesktop.NetworkManager.openvpn'...
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN service 'org.freedesktop.NetworkManager.openvpn' started (org.freedesktop.NetworkManager.openvpn), PID 19131
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN service 'org.freedesktop.NetworkManager.openvpn' just appeared, activating connections
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin state changed: 1
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin state changed: 3
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: OpenVPN 2.1_rc20 x86_64-unknown-linux-gnu [SSL] [LZO2] [EPOLL] built on Oct 18 2009
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: LZO compression initialized
    Oct 28 16:43:56 daroselin kernel: tun0: Disabled Privacy Extensions
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: TUN/TAP device tun0 opened
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: /sbin/ifconfig tun0 10.1.0.2 pointopoint 10.1.0.1 mtu 1500
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN connection 'DARSYS VPN' (Connect) reply received.
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin failed: 2
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: /usr/libexec/nm-openvpn-service-openvpn-helper tun0 1500 1545 10.1.0.2 10.1.0.1 init
    Oct 28 16:43:56 daroselin nm-openvpn[19133]: Exiting
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin failed: 1
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin state changed: 6
    Oct 28 16:43:56 daroselin NetworkManager: <info> VPN plugin state change reason: 0
    Oct 28 16:43:56 daroselin NetworkManager: <WARN> connection_state_changed(): Could not process the request because no VPN connection was active.
    Oct 28 16:43:56 daroselin NetworkManager: <info> Policy set 'Auto eth0' (eth0) as default for routing and DNS.
    Suspiciously, it never seems to try to open a connection to the gateway.  (Note that the gateway's IP address never appears in the log entries.)
    I've configured the connection in nm-applet as follows:
    Gateway:  <internet IP address of the gateway/server I'm trying to VPN into>
    Type:  Static Key
    Static Key:  <the static key file>
    Key direction:  none
    Remote IP address:  10.1.0.1
    Local IP address:  10.1.0.2
    When I launch openvpn from the command line, the conf file reads as follows:
    [darose@daroselin ca]$ cat /etc/openvpn/static-client.conf
    # Sample OpenVPN configuration file for
    # office using a pre-shared static key.
    # '#' or ';' may be used to delimit comments.
    # Use a dynamic tun device.
    # For Linux 2.2 or non-Linux OSes,
    # you may want to use an explicit
    # unit number such as "tun1".
    # OpenVPN also supports virtual
    # ethernet "tap" devices.
    dev tun
    remote <internet IP address of the gateway/server I'm trying to VPN into>
    # 10.1.0.1 is our local VPN endpoint (office).
    # 10.1.0.2 is our remote VPN endpoint (home).
    ifconfig 10.1.0.2 10.1.0.1
    # Our up script will establish routes
    # once the VPN is alive.
    ; up ./office.up
    #up ./client.up
    route 10.0.0.0 255.255.255.0 10.1.0.1
    # Our pre-shared static key
    secret static.key
    # OpenVPN 2.0 uses UDP port 1194 by default
    # (official port assignment by iana.org 11/04).
    # OpenVPN 1.x uses UDP port 5000 by default.
    # Each OpenVPN tunnel must use
    # a different port number.
    # lport or rport can be used
    # to denote different ports
    # for local and remote.
    ; port 1194
    # Downgrade UID and GID to
    # "nobody" after initialization
    # for extra security.
    #user nobody
    #group nobody
    # If you built OpenVPN with
    # LZO compression, uncomment
    # out the following line.
    comp-lzo
    # Send a UDP ping to remote once
    # every 15 seconds to keep
    # stateful firewall connection
    # alive. Uncomment this
    # out if you are using a stateful
    # firewall.
    ; ping 15
    # Uncomment this section for a more reliable detection when a system
    # loses its connection. For example, dial-ups or laptops that
    # travel to other locations.
    ; ping 15
    ping 10
    ; ping-restart 45
    ping-restart 120
    ;keepalive 10 60
    ping-timer-rem
    persist-tun
    persist-key
    # Verbosity level.
    # 0 -- quiet except for fatal errors.
    # 1 -- mostly quiet, but display non-fatal network errors.
    # 3 -- medium output, good for normal operation.
    # 9 -- verbose, good for troubleshooting
    verb 3
    #verb 9
    Anyone have any idea what the problem might be here?

    If anyone's curious, I opened an upstream bug about this:
    https://bugzilla.gnome.org/show_bug.cgi?id=606998

  • OLAP ... Adobe example used; need help fixing a bug (clearing variables on error)

    Okay ...
    So I used one of the Adobe examples except now it's part of a container and it's using a datasource instead of the flatfile the example uses.  Also, for some reason I need to create a button instead of using the creationComplete to get it to work.  My problem is if the button is clicked to fast while it's loading the data (since another part of the application has a dropdown menu so you can requery information) you get an error and for some reason, you'll still get the same error even if the data is fully loaded and even if you change the parameter to reload the data.  My feeling is that the variables are not getting cleared out after it throws the error.
    So my question is what is the best way to clear out the variables (and how) when it throws an error.  The code for the page is below.
    Joe
    <?xml version="1.0" encoding="utf-8"?>
    <v:MaxRestorePanel xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:v="views.*"
        layout="vertical"
        creationComplete="creationCompleteHandler3();">
        <mx:Script>
          <![CDATA[
            import mx.collections.ICollectionView;
            import mx.rpc.AsyncResponder;
            import mx.rpc.AsyncToken;
            import mx.olap.OLAPQuery;
            import mx.olap.OLAPSet;
            import mx.olap.IOLAPQuery;
            import mx.olap.IOLAPQueryAxis;
            import mx.olap.IOLAPCube;
            import mx.olap.OLAPResult;
            import mx.events.CubeEvent;
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            [Bindable]
            public var dp:ICollectionView = null;
            // Format of Objects in the ArrayCollection:
            //  data:Object = {
            //    customer:"AAA",
            //    product:"ColdFusion",
            //    quarter:"Q1"
            //    revenue: "100.00"
            private function creationCompleteHandler3():void {
                // You must initialize the cube before you
                // can execute a query on it.
                myMXMLCube3.refresh();
            // Create the OLAP query.
            private function getQuery(cube:IOLAPCube):IOLAPQuery {
                // Create an instance of OLAPQuery to represent the query.
                var query:OLAPQuery = new OLAPQuery;
                // Get the row axis from the query instance.
                var rowQueryAxis:IOLAPQueryAxis =
                    query.getAxis(OLAPQuery.ROW_AXIS);
                // Create an OLAPSet instance to configure the axis.
                var productSet:OLAPSet = new OLAPSet;
                // Add the Product to the row to aggregate data
                // by the Product dimension.
                productSet.addElements(
                    cube.findDimension("ProductDim").findAttribute("Product").children);
                // Add the OLAPSet instance to the axis.
                rowQueryAxis.addSet(productSet);
                // Get the column axis from the query instance, and configure it
                // to aggregate the columns by the Quarter dimension.
                var colQueryAxis:IOLAPQueryAxis =
                    query.getAxis(OLAPQuery.COLUMN_AXIS);        
                var quarterSet:OLAPSet= new OLAPSet;
                quarterSet.addElements(
                    cube.findDimension("QuarterDim").findAttribute("HLMC").children);
                colQueryAxis.addSet(quarterSet);
                return query;      
            // Event handler to execute the OLAP query
            // after the cube completes initialization.
            private function runQuery(event:CubeEvent):void {
                // Get cube.
                var cube:IOLAPCube = IOLAPCube(event.currentTarget);
                // Create a query instance.
                var query:IOLAPQuery = getQuery(cube);
                // Execute the query.
                var token:AsyncToken = cube.execute(query);
                // Setup handlers for the query results.
                token.addResponder(new AsyncResponder(showResult, showFault));
            // Handle a query fault.
            private function showFault(result:Object, token:Object):void {
                Alert.show("Error in query.");
            // Handle a successful query by passing the query results to
            // the OLAPDataGrid control..
            private function showResult(result:Object, token:Object):void {
                if (!result) {
                    Alert.show("No results from query.");
                    return;
                myOLAPDG3.dataProvider= result as OLAPResult;           
          ]]>
        </mx:Script>
        <mx:OLAPCube name="FlatSchemaCube" dataProvider="{dp}" id="myMXMLCube3" complete="runQuery(event);">
            <mx:OLAPDimension name="CustomerDim">
                <mx:OLAPAttribute name="Customer" dataField="TITLE_NAME"/>
                <mx:OLAPHierarchy name="CustomerHier" hasAll="true">
                    <mx:OLAPLevel attributeName="Customer"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPDimension name="ProductDim">
                <mx:OLAPAttribute name="Product" dataField="CORP_SITE"/>
                <mx:OLAPHierarchy name="ProductHier" hasAll="true">
                    <mx:OLAPLevel attributeName="Product"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPDimension name="QuarterDim">
                <mx:OLAPAttribute name="HLMC" dataField="HLMC"/>
                <mx:OLAPHierarchy name="QuarterHier" hasAll="true">
                    <mx:OLAPLevel attributeName="HLMC"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPMeasure name="Revenue"
                dataField="CUR_YR_1"
                aggregator="SUM"/>
        </mx:OLAPCube>
             <mx:OLAPDataGrid id="myOLAPDG3" defaultCellString="-" textAlign="right" color="0x323232" width="100%" height="100%"/>
            <mx:ControlBar id="controls">       
            <mx:Button label="Pull Details" click="creationCompleteHandler3();"/>
            </mx:ControlBar>
    </v:MaxRestorePanel>

    Okay ...
    So I used one of the Adobe examples except now it's part of a container and it's using a datasource instead of the flatfile the example uses.  Also, for some reason I need to create a button instead of using the creationComplete to get it to work.  My problem is if the button is clicked to fast while it's loading the data (since another part of the application has a dropdown menu so you can requery information) you get an error and for some reason, you'll still get the same error even if the data is fully loaded and even if you change the parameter to reload the data.  My feeling is that the variables are not getting cleared out after it throws the error.
    So my question is what is the best way to clear out the variables (and how) when it throws an error.  The code for the page is below.
    Joe
    <?xml version="1.0" encoding="utf-8"?>
    <v:MaxRestorePanel xmlns:mx="http://www.adobe.com/2006/mxml"
        xmlns:v="views.*"
        layout="vertical"
        creationComplete="creationCompleteHandler3();">
        <mx:Script>
          <![CDATA[
            import mx.collections.ICollectionView;
            import mx.rpc.AsyncResponder;
            import mx.rpc.AsyncToken;
            import mx.olap.OLAPQuery;
            import mx.olap.OLAPSet;
            import mx.olap.IOLAPQuery;
            import mx.olap.IOLAPQueryAxis;
            import mx.olap.IOLAPCube;
            import mx.olap.OLAPResult;
            import mx.events.CubeEvent;
            import mx.controls.Alert;
            import mx.collections.ArrayCollection;
            [Bindable]
            public var dp:ICollectionView = null;
            // Format of Objects in the ArrayCollection:
            //  data:Object = {
            //    customer:"AAA",
            //    product:"ColdFusion",
            //    quarter:"Q1"
            //    revenue: "100.00"
            private function creationCompleteHandler3():void {
                // You must initialize the cube before you
                // can execute a query on it.
                myMXMLCube3.refresh();
            // Create the OLAP query.
            private function getQuery(cube:IOLAPCube):IOLAPQuery {
                // Create an instance of OLAPQuery to represent the query.
                var query:OLAPQuery = new OLAPQuery;
                // Get the row axis from the query instance.
                var rowQueryAxis:IOLAPQueryAxis =
                    query.getAxis(OLAPQuery.ROW_AXIS);
                // Create an OLAPSet instance to configure the axis.
                var productSet:OLAPSet = new OLAPSet;
                // Add the Product to the row to aggregate data
                // by the Product dimension.
                productSet.addElements(
                    cube.findDimension("ProductDim").findAttribute("Product").children);
                // Add the OLAPSet instance to the axis.
                rowQueryAxis.addSet(productSet);
                // Get the column axis from the query instance, and configure it
                // to aggregate the columns by the Quarter dimension.
                var colQueryAxis:IOLAPQueryAxis =
                    query.getAxis(OLAPQuery.COLUMN_AXIS);        
                var quarterSet:OLAPSet= new OLAPSet;
                quarterSet.addElements(
                    cube.findDimension("QuarterDim").findAttribute("HLMC").children);
                colQueryAxis.addSet(quarterSet);
                return query;      
            // Event handler to execute the OLAP query
            // after the cube completes initialization.
            private function runQuery(event:CubeEvent):void {
                // Get cube.
                var cube:IOLAPCube = IOLAPCube(event.currentTarget);
                // Create a query instance.
                var query:IOLAPQuery = getQuery(cube);
                // Execute the query.
                var token:AsyncToken = cube.execute(query);
                // Setup handlers for the query results.
                token.addResponder(new AsyncResponder(showResult, showFault));
            // Handle a query fault.
            private function showFault(result:Object, token:Object):void {
                Alert.show("Error in query.");
            // Handle a successful query by passing the query results to
            // the OLAPDataGrid control..
            private function showResult(result:Object, token:Object):void {
                if (!result) {
                    Alert.show("No results from query.");
                    return;
                myOLAPDG3.dataProvider= result as OLAPResult;           
          ]]>
        </mx:Script>
        <mx:OLAPCube name="FlatSchemaCube" dataProvider="{dp}" id="myMXMLCube3" complete="runQuery(event);">
            <mx:OLAPDimension name="CustomerDim">
                <mx:OLAPAttribute name="Customer" dataField="TITLE_NAME"/>
                <mx:OLAPHierarchy name="CustomerHier" hasAll="true">
                    <mx:OLAPLevel attributeName="Customer"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPDimension name="ProductDim">
                <mx:OLAPAttribute name="Product" dataField="CORP_SITE"/>
                <mx:OLAPHierarchy name="ProductHier" hasAll="true">
                    <mx:OLAPLevel attributeName="Product"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPDimension name="QuarterDim">
                <mx:OLAPAttribute name="HLMC" dataField="HLMC"/>
                <mx:OLAPHierarchy name="QuarterHier" hasAll="true">
                    <mx:OLAPLevel attributeName="HLMC"/>
                </mx:OLAPHierarchy>
            </mx:OLAPDimension>
            <mx:OLAPMeasure name="Revenue"
                dataField="CUR_YR_1"
                aggregator="SUM"/>
        </mx:OLAPCube>
             <mx:OLAPDataGrid id="myOLAPDG3" defaultCellString="-" textAlign="right" color="0x323232" width="100%" height="100%"/>
            <mx:ControlBar id="controls">       
            <mx:Button label="Pull Details" click="creationCompleteHandler3();"/>
            </mx:ControlBar>
    </v:MaxRestorePanel>

  • Using static VI references in an application

    Hello all you helpful forum-goers!
    I am using 4 different static VI references hooked directly to "Run VI" invoke nodes, with the "Wait Until Done" and "Auto Dispose Ref" parameters both False, to run four VIs dynamically, each of which does nothing except call my re-entrant serial port input/output VI with a different COM port index number.  Overall this is working pretty well.  However, I have a couple questions about improving my setup.
    1) Is it possible to somehow set an input parameter to the re-entrant serial port VI, and thereby be able to Invoke it directly four times in a for loop, each with a different input value?  I'm not sure how I would do that, except that I've heard that you can set the value of a control of a VI using a reference to it.  I also worry that using the same static VI reference to Invoke the VI 4 times would somehow re-start the same dynamic VI instance 4 times, instead of spawning 4 copies of it.  However, this solution would allow me to delete the 4 VIs which do nothing except call the re-entrant VI, and my code would be simpler and more expandable (e.g. making it easy to interact with 8 serial ports in the future just by increasing the number of for loop iterations).
    2) It seems to be required for me to add the 4 VIs which I Invoke dynamically to my lvproj file, and then add to the "Always Included" section of my application build properties in order for them to be included in my application executable.  This was what I had to do in previous versions of my code when I referenced the VIs via a path name, but now that I changed to using static VI references, I thought they would be included automatically.  LabVIEW already knows to automatically load them in memory (e.g. when I do a search it searches them even when they are not open), and they are included in the Dependencies list in my LabVIEW project, so why would they not be built in to my executable?  I'd prefer not to have to add them explicitly, as it is just one more thing to forget if I change it in the future.  Is there a setting or something somewhere which I can change so that they will be included in the executable automatically?
    Thank you very much for your time and assistance, as always!
    -Joe
    Solved!
    Go to Solution.

    Nope.  If you look at the Help for the "Run VI" method, you find the following information for "Auto Dispose Ref":
    "If TRUE, the target VI detaches the reference from the main VI.  When the target VI finishes executing, LabVIEW automatically disposes of the reference, along with the parallel data space.  If FALSE, the main VI retains control of the target VI."
    So by setting "Auto dispose" to T, you pass control of the reference to the subVI itself, and LabVIEW will dispose of the reference when the subVI finishes running.
    I will second Jeff and urge you to get rid of the global variable!  I haven't used a global variable in something like 14 years.  I haven't needed to.  Myself, I love a good notifier and would urge you to use a notifier instead of a queue if you're going to be spawning VIs.  Why?  Because the first instance of your spawned VI to receive the "stop" message from the queue will remove that message from the queue, thus preventing the other instances from receiving the message.  So you'll have to send the message repeatedly and hope that everyone eventually receives it.  If you use a notifier, anything that contains a "Wait on Notification" with that notifier reference will receive the message.  I think you want multiple listeners here, right?
    Ok, this afternoon I'll try to write some dummy code with a statically called VI in it, compile it into an exe, and see if I can duplicate your problem...
    One question, were you just using the static VI reference by itself to call your VI, or were you using it the same way I showed in my earlier post, with "Open VI reference"?  I'm just trying to look for differences between what I've done in the past which has worked, and what you're doing now which isn't working...
    Jeff, what say you?

  • Report Document.Load Method Hangs

    The following code is an exceprt from an asp.net web application we developed.  The report file (TestReport.rpt) file was designed using a 'manually' created schema (xsd) that mirrors the structure of pApptDT. The .xsd file has no DB connection info stored in it.  NOTE: the DBServiceORA and Registrations are base and middle tier classes respectively that do the heavy lifting.
    protected void Page_Load(object sender, EventArgs e)
        mDBService = (DBServiceORA)Session["DBService"];
        this.BuildReport();
    protected void BuildReport()
        ReportDocument pReport = new ReportDocument();
        try
            DataTable pApptDT = Registrations.GetApptSmry (mDBService);
            string pReportFile = Server.MapPath(Global.WEB_ROOT + @"/Reports_Appointment/TestReport.rpt");
            pReport.Load(pReportFile);
            pReport.SetDataSource(pApptDT);
            MemoryStream pStream = (MemoryStream)pReport.ExportToStream(ExportFormatType.PortableDocFormat);
            HttpContext.Current.Response.Clear();
            HttpContext.Current.Response.ContentType = "application/pdf";
            HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=Report.pdf");
            HttpContext.Current.Response.BinaryWrite(pStream.ToArray());
        catch (Exception ex)
            Response.Write("<p>" + ex.Message + "</p><p>" + ex.StackTrace + "</p>");
        finally
            pReport.Close();
            pReport.Dispose();
    This code has worked for over a year in our VS2008 development environment.  We use IIS, .Net 3.5, and ODP.Net with an Oracle 10g DB.  In our development environment we use IIS (not the built-in web server) which uses Windows integrated security.   My company recently pushed down new global policies to all desktops.  These new ploicies affected Local Security Policies and permissions on some files in the \windows\system32 directory.  When stepping through the code with the debugger, the application now hangs on the pReport.Load method.
    I need help in understanding the internals of the CR ReportDocument.Load method. We think the problem is somehow associated with CR trying to connect to a non-existent DB using some protocol that got affected by the policy changes. Can anyone shed some light on our problem, in particular what's happening inside the Load method.
    Thanks
    Dan

    Tried several options.
    OPTION 1:
    Created new VS2008 "Crystal Reports Application".
    'Manually' created schema (Activity.xsd) containing no DB connection information.
    Created Activity.rpt (that referenced the above Activity.xsd file).
    Created our 'normal' aspx page with code as follows:.
    DataTable pActivityDT = mDBService.GetDataTable("select * from E_ACT;");
    string pReportFile = Server.MapPath(@"/CRTestApp1/Activity.rpt");
    pReport.Load(pReportFile);
    pReport.SetDataSource(pActivityDT);
    MemoryStream pStream = (MemoryStream)pReport.ExportToStream(ExportFormatType.PortableDocFormat);
    HttpContext.Current.Response.Clear();
    HttpContext.Current.Response.ContentType = "application/pdf";
    HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=Report.pdf");
    HttpContext.Current.Response.BinaryWrite(pStream.ToArray());
    First attempt at displaying the above page results in making it past the pReport.Load but hung on the pReport.SetDataSource.  All subsequent attempts hung on the pReport.Load method. (?????)
    OPTION 2:
    Usng the VS-generated Default page (which included the CR Viewer) the ReportSource was set declaratively as follows:
    <form id="form1" runat="server">
        <div>
            <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
                Height="1039px" ReportSourceID="CrystalReportSource1" Width="901px" />
            <CR:CrystalReportSource ID="CrystalReportSource1" runat="server">
                <Report FileName="Activity.rpt">
                </Report>
            </CR:CrystalReportSource>
        </div>
    </form>
    Attempting to display the above page results in the application hanging.  I also tried setting the source to a non-existant file just to see if an exception would be thrown.  I got the expected 'Load report Failed' message followed by parital rendering of the CR viewer.
    OPTION 3:
    The report displays as expected when a new connection (pproviding the DB login credentials) is created in the CR Database Expert dialog screens and the Activity (E_ACT) table is selected and used as the datasource for the report.  With this option, the designer displays data from the Activity table in the Main Report Preview screen.  When running the application the CR Viewer prompts for DB login credentails.
    Hope this  sheds some light on the issue we're having.
    Dan
    Edited by: Dan Cannon on Dec 10, 2009 7:23 PM

Maybe you are looking for