Accessing Class Member Vars From Flash?

Hi,
I'm writing an audio intensive application that requires a lot of data manipulation on the Alchemy side and I ran into a wall with my approach.
I'm using C++ to initialize a Class and populate its members in the "Alchemy-side" of the project. However, to keep things tidy and fast, I wish to write some audio data to a Float Array member of the class directly from Flash to avoid redundant copying.
If this seems strange, I have done it successfully for a Float Array defined in the main C (or C++) file and passed a pointer back to AS3 so that the "shared memory" could find the precise location in memory and read/write:
Setting up shared memory:
               var ns:Namespace = new Namespace("cmodule.cppPackage");     
               cRAM = (ns::gstate).ds;     
               libLoader = new CLibInit();
               lib = libLoader.init();     
where cRAM is a byteArray I used and is associated with the shared memory. cRam,position = DataPtr would get me access to the data I want
However, this approach hasn't proven fruitful for Data Arrays located within a class. Here is a quick look at my class implementation:
class AudioChannel {
private:
     int fs, frameSize;
     bool fftComputed;
public:
     float *audioFrame, *fftFrame;
     int *intArr;
     int stuff;
     AudioChannel();                                             //default constructor
     ~AudioChannel();
     void initChannel(int fSize, int sampleRate);     //initializes the paramters
     int getSampleRate();
     int getFrameSize();
the audioFrame array is allocated and initialized in the "intiChannel" method, and it has public access. From the main .cpp file I simply return &(ch.audioFrame), (ch is the object instance) as an AS3_Ptr so I can use that to find the data.
The way in which I attempt to access the values in AS3 is as follows:
               cRAM.position = chAudPtr;
               for(var i:int = 0; i < 25; i++ ) {
                    cRAM.position = chAudPtr + sizeofFloat*i;
                    var tempVal:int = cRAM.readFloat();
                    trace('the tempVal is : ' + tempVal);
The problem is, that the function returns the wrong values. chAudPtr is the address for the "audioFrame" member in the C++ class I defined earlier and the initChannelMethod initialized the first 25 values to 0 through 24. I confirmed this with trace statements in the C code. Furthermore, when I try to write to this memory, I receive:
RangeError: Error #1506: The specified range is invalid
Is this some sort of limitation of Alchemy with data structures (classes, structs, etc)?. The strange thing is I can read and write the primitive members of the class with no issues (i.e. "stuff, fs, frameSize") using the above methods. But I can't seem to get it to work right with arrays in the object.
Any tips are appreciated, I'm trying to create something really clean and self-contained.
Thanks.

sorry about the &nbsp. you can ignore that...some weird formatting thing for the code-style formatting....

Similar Messages

  • Creating a class member VI from a template locks the class library.

    I have a LabVIEW (8.6.1) class where I need to create a number of very similar member VI's.  In order to make this process more convenient, I created a couple of VI templates.  However, I've found that creating a new VI from the template always locks the class library.  The library then remains locked until I close and reopen the project.
    When I select "Why is library locked?" from the context menu, I'm told:
    "The library is locked because:  This LabVIEW class is loaded in multiple application instances.  Classes must be in only a single application instance to be edited.  The containing library is locked."
    I have the same problem if I create a new project (see attached ZIP file), add a class, and then add two templates.  Everything seems OK if I have only one template.
    Am I doing something wrong, is this a bug in LabVIEW, or do I misunderstand the expected/intended behavior of template VI's?  Is there a way to "unlock" the class library without closing and reopening the project?
    Thanks in advance,
    Mark Moss
    Attachments:
    Locked Class Library Problem.zip ‏17 KB

    Hello,
    >> Any good sample projects on this out there?
    Not suer if you are using C# as the develop language, if it is, i think you would find a lot of articles about this topic with your favorite search engine, here are some related links:
    COM Interop Part 1: C# Client Tutorial
    COM Interop Part 2: C# Server Tutorial
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Accessing the photoshop api from flash.. within a photoshop window?

    I should maybe ask this in scripting.. but it's some ways related to the SDK. I dont want to crosspost.. if the feature exist, it's very likely that SDK developpers are aware of this (ps: i havent downloaded the sdk since the beta)
    I had the opportunity to show a bit our project to Mike Downey from Adobe at FITC/Toronto as it's related in some way to Apollo. We use realbasic for this application (flash/html/css/javascript) and we also use Realbasic, even with all the imperfections the software has, to create visual tools to call some Applescript.
    That's how i implemented the fake palette i mentionned here or in scripting forum. To me, there was a huge benefit compared to implementing a dialog with the SDK (wich doesnt support developping a palette anyway).
    What i would be really happy to see is an integration like it has been done with jsfl in flash (extensibility). Kind of a way for us to really have a common language for intranet, production tools and final release (web or cd). (leverage the skills like Adobe say to sell Apollo)
    So in extensibility in case some of you are not aware of the feature, you can create a window that has a flash content in it and there is a mecanism to call the javascript api of flash (authoring environnement). By exemple, you can have a window in flash authoring environnement that behave like other windows (ie. dockable and all)... that has a flash interface and communicated with a database.. so you can have a script that connect to a database and then create shapes in the authoring environnement... It's a very great tool for integrated production environnement..
    So, Mike Downey mentionned to me that i was present in CS3!? (when i told him that i would have been great to have Apollo/Flash being able to access the Photoshop Api) Is it true? Where is it documented? I remember seing it mentioned in the SDK survey... Or maybe it's just possible to do it via external command..so it's not integrated in a window of photoshop)?
    Sorry if it's not clear... but i would be really happy to hear more about that... It would be great to have this even if it's not Applescript compatible (i could use xml tools in the api of flash)...

    Well.. i finally have found the feature in the sample folder of javascript scripting of cs3. You really can have a flash interface to call you scripts.
    That will be a HUGE improvement for javascript scripter and i would not be surprised that it will encourage people to develop more tools.
    The big minus for me, unless it's something i havent found yet, it looks like the dialog is only available from calling the script.. so the dialog is modal... really not as cool as Flash extensibility integration, but that's a start. :(
    I repost this on Scripting forum as i now know it's related to scripting...
    I still have hope for something more advanced... the "KnowHow" thing (wich i havent tried yet) http://labs.adobe.com/technologies/knowhow/) is really a good exemple of palette/feature integration that i wish was possible in photoshop...

  • Accessing cgi env vars from within html db

    Hello all
    Please can you tell me how to access the variables that are exported to the cgi environment of the apache webserver from within an html db application.
    Specifically, I have server ssl enabled on the apache server and want to display one of the exported variables:"SSL_SERVER_S_DN_CN" (=some.server.name) from within my html db application.
    Thank you.

    "423104",
    You can use the OWA_UTIL function to fetch values of CGI environment variables:
    select owa_util.get_cgi_env('SSL_SERVER_S_DN_CN') from dual
    Thanks,
    - Scott -

  • Accessing Var from main Nib/Class - [global variables]

    I'm sure this is a simple solution and the problem is I'm just not thinking right. I just started programming in Objective C but have come a long way in the past 2 weeks. Pretty extensive knowledge in C# and some java.
    Anyways, I've been creating an app and have streams working, CFNetwork working, network services discovery working and a tab bar with a custom View controller linking to one of the tab-bar buttons.
    So when you click on one of the tab bar items it opens a new nib file. That nib loads a table view. When nib loads it hits a method which starts looking for network services and updates the table when it finds some.
    Now the idea is is to have a selector on the cell and when you choose the service it adds same variable info, ip and port, back to a global variable which can be used through the entire app and all extra loaded nib files.
    Out of all this, I don't know how to access global variables....prob should be the simplest thing to do out of all I've done. I have ideas of how it should be done but don't know how to access it.
    Idea would be:
    MainWindowNib has NSString var that is public with a getter setter. But how can I access that MainWindowNib var from a SecondView.nib file/class. There a way to get the parent of the secondView.Nib? I have no clue.
    Any help would be great!
    Thanks!

    I'm still a bit confused how you access that method.
    Main.nib class : UIApplication
    NSString *port
    SetupView.nib : NSViewController
    view
    -TableView added to view
    -Seperate NSObject for TableViewDelegates
    -When item selcted, pass NSString to [main port]
    How do I get a pointer to port. I don't really understand how to do this with objective C.
    In C# I would be something like: [Not exact syntax but u get the idea]
    public Main : Form
    public string port{get;set;}
    Main()
    sView SeconddForm = new SecondForm(this);
    public SecondForm : Form
    SecondView(Main main)
    main.Port = "8080";
    Message was edited by: Clarke76
    Message was edited by: Clarke76

  • Is there any way at all of accessing captivate variables from flash?

    Hi,
    I would be grateful for any help on this one.  I have been working in flash and I wanted to know whether there is any way at all of calling/accessing captivate 4 variables from flash (I'm working in flash Cs4 Actionscript 3.0 and I'm trialling Captivate 4, but I just want to know whether there is any way/method of communicating between a flash file and a captivate 4 file, and if so, can this be done with an embedded captivate 4 file/swf).  Surely there must be a way of communicating between the two - they are both Adobe products!
    Thanks for any help, pointers, advice, tips in advance.

    Hi Louon,
    Don't know if this would help you.
    http://blogs.adobe.com/captivate/2009/09/captivate_variables_-_how_to_a.html
    We have many experts here who could give more precise answers.
    Cheers.
    Miguel

  • Can access c++ library from flash action script by using SWC lib?

    We want to develope a Flash application based on Windows CE 6.0 R3. The application aims to communicate with middleware libraries written in C/C++. Is it possible to create SWC file using the c++ library file so that we can load this as a component in fla project for accessing the library functions from flash action script 3.0? OR Is there any simple way to access c++ library from action script?
    Thanks,
    Saumini

    I don't think Alchemy will help you.  The reason is Alchemy does not give socket capabilities beyond what Flash provides.

  • Grab var from email flash/asp

    hey,
    got an small flash application that will send all my vars
    from flash(8) to
    an ASP script for both inserting into a database and also,
    emailing a http
    result to a remote client machine.
    The http email also has a different embeded flash app that
    should be looking
    for the
    value of a hidden field within the html email.
    I am using loadvariables in a frame loop until the asp vars
    have been loaded
    (last var from the asp= true) which is all fine and dandy.!
    What i cant get is the value of the hidden field from the
    html email brought
    into the ASP script which is being called from the embeded
    flash app which
    supposedly looks for the appropriate ID value from the
    database to populate
    other values within the flash app'
    I hope i have explained this clearly and concisely as
    possible so as someone
    may know of a solution that i can use or a work around...
    Thanks!
    R

    your my hero dude!
    why the hell didn't i think of that........ duh!
    CHEERS!!
    "blemmo" <[email protected]> wrote in
    message
    news:ec2ng2$7cg$[email protected]..
    > Hi,
    >
    > so you can't get the hidden value from Flash? Can't help
    you with that,
    > but
    > what about passing the value directly to Flash? You can
    add variables
    > after the
    > filename in the embed and object tags, very much like in
    a http GET
    > string:
    >
    > <embed src="movie.swf?hiddenval=secret">
    >
    > Inside Flash, 'hiddenval' is available just like any
    other variable,
    > located
    > in _level0. See here for more:
    >
    http://livedocs.macromedia.com/flash/8/main/00001205.html.
    >
    > This way you don't need to hide the value in the html.
    >
    > hth,
    > blemmo
    >

  • Accessing class var from main timeline

    Hi all! Well I've been working on this for a couple of days
    now and just can't seem to get it to work right...... I'm still
    getting my feet wet with as3 and like it more and more everytime I
    use it.... almost.
    Anyways, here's where I'm running into trouble.
    Here's a dumbed down version of my project with all the other
    usless drivel excluded. Basically what I'm trying to do is declare
    a var and give it a value in my class. Then I want to be able to
    display that value on the stage and use it in the main timeline.
    Seems simple enough....
    I need to be able to pass the var from the class to the main
    timeline for use.... Any help on this would be GREATLY appreciated.
    Thanks.

    kglad, worked like a charm in my short test file... however
    in my real world flash file the class takes a short time to
    actually compute the value of the variable. If I fire the trace
    from the main timeline it will display NaN b/c at the moment it
    fires the value of the var doesn't exist b/c it has yet to be
    calculated......
    I don't really know the best way to delay this... would the
    best way be to somehow add an event listener to listen to the var
    to see when it is assigned a value?.... I'm open to suggestions.
    btw, good catch on the assignment of a string value!!
    Thanks!

  • Access movieclip on stage from class?

    Hi all,
    Is it possible to access a movieclip which has been dragged onto the main stage in my FLA from an external class that i've written? Can i create a variable that refers to the object on the stage? Or does it have to be added dynamically to be accessible?
    Many Thanks
    Matt

    Hi Ned, i'm not instantiating it as such i'm just using it to store quite a large method which is being called from the document class.
    I'm trying to break all my code down into chuncks stored in .as files so that i dont have 2,000 lines of code all in frame one of the main timeline : S
    So this is my document class:
    package  {
              import flash.display.MovieClip;
              import loadXML;
              public class mainClass extends MovieClip {
                        public function mainClass () {
                              loadXML.importXML();
    then this is the class being called from the mainClass:
    package  {
              import flash.display.Stage;
              import flash.net.*;
              import flash.events.ProgressEvent
              import flash.events.Event;
              import flash.text.*;
              public class loadXML {
                        private static var myXML:XML;
                        private static var myLoader:URLLoader = new URLLoader();
                        public function loadXML() {
                        public static function importXML():void{
                                       myLoader.load(new URLRequest("pipeLineData.xml"));
                                       myLoader.addEventListener(Event.COMPLETE, processXML);
                        private static function processXML(e:Event):void {
                                       myXML = new XML(e.target.data);
                                       objectOnStage.text = myXML.TEXT[0];
                                       //etc...
                                       //etc...
    Many thanks
    Matt

  • Accessing an Array List from another class

    Hi, I was a member on here before, but I forgot my password and my security question is wrong.
    My question is how do I access a private arraylist from a different class in the same package?
    What I am trying to do is the following (hard to explain).
    Make a picking client for a shop, so that when an order is recieved, the picker can click on the orders button, and view all of the current orders that have not been completed. This Pick client has its own user interface, in a seperate class from where the BoughtList array is created, in the cashier client. The boughtlist is created when the cashier puts in the product number into the cashier client and clicks buy. I seem to be having trouble accessing the list from another class. Once the order is completed the cashier clicks bought and the list is reset. There is another class in a different pagage that processes some of the functions of the order, eg newOrder().
    Yes it is for Uni so I dont need / want the full answers, jist something to get started. Also please dont flame me, I have done many other parts of this project, just having trouble getting started on this one.
    Here is the code for the cashier client. The code for the Pick client is almost the same, I just need to make the code that displays the orders.
    package Clients;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.text.NumberFormat;
    import java.util.Locale;
    import Catalogue.*;
    import DBAccess.*;
    import Processing.*;
    import Middle.*;
    class CashierGUI 
      class STATE                             // Cashier states
        public static final int PROCESS  = 0;
        public static final int CHECKED  = 1;
      class NAME                             // Names of buttons
        public static final String CHECK  = "Check";
        public static final String BUY    = "Buy";
        public static final String CANCEL = "Cancel";
        public static final String BOUGHT = "Bought";
      private static final int H = 300;       // Height of window pixels
      private static final int W = 400;       // Width  of window pixels
      private JLabel      theAction  = new JLabel();
      private JTextField  theInput   = new JTextField();
      private JTextArea   theOutput  = new JTextArea();
      private JScrollPane theSP      = new JScrollPane();
      private JButton     theBtCheck = new JButton( NAME.CHECK );
      private JButton     theBtBuy   = new JButton( NAME.BUY );
      private JButton     theBtCancel= new JButton( NAME.CANCEL );
      private JButton     theBtBought= new JButton( NAME.BOUGHT );
      private int         theState   = STATE.PROCESS;   // Current state
      private Product     theProduct = null;            // Current product
      private BoughtList  theBought  = null;            // Bought items
      private Transaction     theCB        = new Transaction();
      private StockReadWriter theStock     = null;
      private OrderProcessing theOrder     = null;
      private NumberFormat theMoney  =
              NumberFormat.getCurrencyInstance( Locale.UK );
      public CashierGUI(  RootPaneContainer rpc, MiddleFactory mf  )
        try                                             //
          theStock = mf.getNewStockReadWriter();        // DataBase access
          theOrder = mf.getNewOrderProcessing();        // Process order
        } catch ( Exception e )
          System.out.println("Exception: " + e.getMessage() );
        Container cp         = rpc.getContentPane();    // Content Pane
        Container rootWindow = (Container) rpc;         // Root Window
        cp.setLayout(null);                             // No layout manager
        rootWindow.setSize( W, H );                     // Size of Window
        Font f = new Font("Monospaced",Font.PLAIN,12);  // Font f is
        theBtCheck.setBounds( 16, 25+60*0, 80, 40 );    // Check Button
        theBtCheck.addActionListener( theCB );          // Listener
        cp.add( theBtCheck );                           //  Add to canvas
        theBtBuy.setBounds( 16, 25+60*1, 80, 40 );      // Buy button
        theBtBuy.addActionListener( theCB );            //  Listener
        cp.add( theBtBuy );                             //  Add to canvas
        theBtCancel.setBounds( 16, 25+60*2, 80, 40 );   // Cancel Button
        theBtCancel.addActionListener( theCB );         //  Listener
        cp.add( theBtCancel );                          //  Add to canvas
        theBtBought.setBounds( 16, 25+60*3, 80, 40 );   // Clear Button
        theBtBought.addActionListener( theCB );         //  Listener
        cp.add( theBtBought );                          //  Add to canvas
        theAction.setBounds( 110, 25 , 270, 20 );       // Message area
        theAction.setText( "" );                        // Blank
        cp.add( theAction );                            //  Add to canvas
        theInput.setBounds( 110, 50, 270, 40 );         // Input Area
        theInput.setText("");                           // Blank
        cp.add( theInput );                             //  Add to canvas
        theSP.setBounds( 110, 100, 270, 160 );          // Scrolling pane
        theOutput.setText( "" );                        //  Blank
        theOutput.setFont( f );                         //  Uses font 
        cp.add( theSP );                                //  Add to canvas
        theSP.getViewport().add( theOutput );           //  In TextArea
        rootWindow.setVisible( true );                  // Make visible
      class Transaction implements ActionListener       // Listener
        public void actionPerformed( ActionEvent ae )   // Interaction
          if ( theStock == null )
            theAction.setText("No conection");
            return;                                     // No connection
          String actionIs = ae.getActionCommand();      // Button
          try
            if ( theBought == null )
              int on    = theOrder.uniqueNumber();      // Unique order no.
              theBought = new BoughtList( on );         //  Bought list
            if ( actionIs.equals( NAME.CHECK ) )        // Button CHECK
              theState  = STATE.PROCESS;                // State process
              String pn  = theInput.getText().trim();   // Product no.
              int    amount  = 1;                       //  & quantity
              if ( theStock.exists( pn ) )              // Stock Exists?
              {                                         // T
                Product pr = theStock.getDetails(pn);   //  Get details
                if ( pr.getQuantity() >= amount )       //  In stock?
                {                                       //  T
                  theAction.setText(                    //   Display
                    pr.getDescription() + " : " +       //    description
                    theMoney.format(pr.getPrice()) +    //    price
                    " (" + pr.getQuantity() + ")"       //    quantity
                  );                                    //   of product
                  theProduct = pr;                      //   Remember prod.
                  theProduct.setQuantity( amount );     //    & quantity
                  theState = STATE.CHECKED;             //   OK await BUY
                } else {                                //  F
                  theAction.setText(                    //   Not in Stock
                    pr.getDescription() +" not in stock"
              } else {                                  // F Stock exists
                theAction.setText(                      //  Unknown
                  "Unknown product number " + pn        //  product no.
            if ( actionIs.equals( NAME.BUY ) )          // Button BUY
              if ( theState != STATE.CHECKED )          // Not checked
              {                                         //  with customer
                theAction.setText("Check if OK with customer first");
                return;
              boolean stockBought =                      // Buy
                theStock.buyStock(                       //  however
                  theProduct.getProductNo(),             //  may fail             
                  theProduct.getQuantity() );            //
              if ( stockBought )                         // Stock bought
              {                                          // T
                theBought.add( theProduct );             //  Add to bought
                theOutput.setText( "" );                 //  clear
                theOutput.append( theBought.details());  //  Display
                theAction.setText("Purchased " +         //    details
                           theProduct.getDescription()); //
    //          theInput.setText( "" );
              } else {                                   // F
                theAction.setText("!!! Not in stock");   //  Now no stock
              theState = STATE.PROCESS;                  // All Done
            if ( actionIs.equals( NAME.CANCEL ) )        // Button CANCEL
              if ( theBought.number() >= 1 )             // item to cancel
              {                                          // T
                Product dt =  theBought.remove();        //  Remove from list
                theStock.addStock( dt.getProductNo(),    //  Re-stock
                                   dt.getQuantity()  );  //   as not sold
                theAction.setText("");                   //
                theOutput.setText(theBought.details());  //  display sales
              } else {                                   // F
                theOutput.setText( "" );                 //  Clear
              theState = STATE.PROCESS;
            if ( actionIs.equals( NAME.BOUGHT ) )        // Button Bought
              if ( theBought.number() >= 1 )             // items > 1
              {                                          // T
                theOrder.newOrder( theBought );          //  Process order
                theBought = null;                        //  reset
              theOutput.setText( "" );                   // Clear
              theInput.setText( "" );                    //
              theAction.setText( "Next customer" );      // New Customer
              theState = STATE.PROCESS;                  // All Done
            theInput.requestFocus();                     // theInput has Focus
          catch ( StockException e )                     // Error
          {                                              //  Of course
            theOutput.append( "Fail Stock access:" +     //   Should not
                                e.getMessage() + "\n" ); //  happen
          catch ( OrderException e )                     // Error
          {                                              //  Of course
            theOutput.append( "Fail Order process:" +    //   Should not
                                e.getMessage() + "\n" ); //  happen
    }

    (disclaimer: I did not read through your Swing code, as I find that painful)
    My question is how do I access a private arraylist from a different class in the same
    package?Provide a public accessor method (getMyPrivateArrayList())

  • Reflection problem: can not access a member of class java.lang.IllegalAcces

    package org.struts.ets.utility;
    import java.lang.reflect.Constructor;
    import java.lang.reflect.Field;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import org.struts.bean.FieldTrouble;
    import org.struts.bean.GenericDAOBean;
    public class DynamicObjectCreation
         public static void main(String... args)
              FieldTrouble ft = new FieldTrouble();
              try
                   Class<?> c = ft.getClass();
                   //Class<?> c = FieldTrouble.class;
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
                   Field f = c.getDeclaredField("var1");
                   //f.setInt(ft, 42); // IllegalArgumentException
                   f.set(ft, new String("A"));
                   System.out.println(ft.getVar1());
                   // production code should handle these exceptions more gracefully
              } catch (NoSuchFieldException x)
                   x.printStackTrace();
              } catch (IllegalAccessException x)
                   x.printStackTrace();
    }// If I put FieldTrouble.java in any other package than the current package I am running this code from. I get the following error:
    java.lang.IllegalAccessException: Class org.struts.ets.utility.DynamicObjectCreation can not access a member of class org.struts.bean.FieldTrouble with modifiers ""
         at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
         at java.lang.reflect.Field.doSecurityCheck(Unknown Source)
         at java.lang.reflect.Field.getFieldAccessor(Unknown Source)
         at java.lang.reflect.Field.set(Unknown Source)
         at org.struts.ets.utility.DynamicObjectCreation.main(DynamicObjectCreation.java:35)
    I tried all possible ways of creating class as:
    Class<?> c = ft.getClass(); OR
    Class<?> c = FieldTrouble.class; OR
                   /*Class<?> c = null;
                   try
                        c = Class.forName("org.struts.bean.FieldTrouble");
                   } catch (ClassNotFoundException e)
                        e.printStackTrace();
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM
    Edited by: ..-__Kris__-.. on Feb 21, 2008 10:26 AM

    Any hidden performance or memory issue here?
    Let us consider an object:
    public class SomeObject
         private String fieldA;
         private String fieldB;
         private String fieldC;
         private String fieldD;
         private String fieldE;
         //... say 50 declared fields....
         public SomeObject()
         public SomeObject(String fieldA, String fieldB)
              this.fieldA = fieldA;
              this.fieldB = fieldB;
    // getters and setters..     
    }When I create an object using the constructor with only two fields initialized such as the following code above, and look at what is happening to other fields as shown in the code below, I see that they are also AVAILABLE, now this is important, but they are set to null. What I wanted to know was, if I created an object with many fields, as many as 50 (getDeclaredFields = 50), and used a constructor with only two input fields to initialize an object, I still have 48 other fields available but set as NULL's. When I create more than 100,000 of these objects in a list and send to a .jsp page, I am unable to understand if this has more memory load than when you use a list of another object which has actually has only two declared fields in it. Each of this new object will have only two declared fields, when I say getDeclaredFields() it would return 2.
    This is where I am unable to figure out if this has anything to do with performance or memory, rather, what is the difference between the many possible ways you can initialize an object when there are too many fields which you probably won't use? Either create a new constructor with only two input arguments OR a generic constructor with all fields as input arguments but all those fields which you won't use assigned NULL's OR create another new object with only two declared fields
    SomeObject someObj = new SomeObject("abcd","cdef");
              Field[] fields = someObj.getClass().getDeclaredFields();
              System.out.println("Number of available fields: " + fields.length);
              for(int i = 0 ; i < fields.length ; i++)
                   try
                        fields.setAccessible(true);
                        System.out.println("Field " + i + ", with value: " + fields[i].get(someObj));
                        fields[i].get(someObj);
                   } catch (IllegalArgumentException e)
                        e.printStackTrace();
                   } catch (IllegalAccessException e)
                        e.printStackTrace();
              }Edited by: ..-__Kris__-.. on Mar 23, 2008 5:04 PM
    Edited by: ..-__Kris__-.. on Mar 23, 2008 5:05 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • "no access to the digital certificate" - Trying to export my first iOS app from Flash - Help please

    Hello
    I'm trying to export my first iOS app from flash to my desktop / on the device (Flash Pro CC, Iphone5)
    I followed the instructions on the adobe website to build an air app for iOS but on the last step it
    doesn't export the app.
    What I've done so far:
    - Apple developer account
    - creating the certificate + convert it to .p12
    - app ID / Name etc.
    - creating the provisioning profile from apple
    - iOS Air app in flash (Only Text "Hello world" with a tween)
    Now i have to load the certificates into Flash & enter a password (is it the password that
    i entered in the certificate or from my developer account/ Apple ID password? Both didn't work at the end)
    When i klick on publish in the last step than it loads a while but then i get the Error:
    "no access to the digital certificate"
    What is wrong? Can you help me please.

    Also, I should say, when I go into my phone on the computer and try to install an app, I get this message:
    Unable to start operation. Installer is already in use.
    Any ideas

  • Access class' properties (in _root) from movieclip timeline?

    I'm trying to follow the advice "class properties are better
    then _global variables", but how could I access a class' properties
    (imported in the main timeline) from a movie Clip timeline?
    this code in the main timeline works (and trace the value of
    lang):
    import scripts.StartupSettings
    trace (StartupSettings.lang);
    but if I try to access the lang property from a movie clip
    timeline, with the same:
    trace (StartupSettings.lang);
    I get traced "undefined".
    The only workaround I have found is to import again the class
    inside the clip, but I would like to avoid it in order to keep
    dimensions small.
    Any idea? thanks

    The import statement doesn't really import anything. It's
    used to not have to call a method using the fully qualified class
    name. So, don't worry about 'dimensions'. And, the import statement
    is only 'valid' on the frame it is defined on. On another frame,
    you have to use the import statement again.

  • How to access AM/VO instance from a Java Service class

    Hi,
    I have a Java service class that is loaded by Java ServiceLoader (http://download.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) at run time, and I need to access database tables inside that service class. So is there any way that I can access AM/VO instances from that Java class in order to read database table? Thanks.
    Regards,
    K Hein

    You can access an application module with the the two methods below:
        YOURAppModule mAM;
        public void setUpAM()
            throws NamingException
            try
                String AMDefName = "YOUR_APP_DEF_NAME";
                Hashtable env = new Hashtable(2);
                env.put(JboContext.INITIAL_CONTEXT_FACTORY, JboContext.JBO_CONTEXT_FACTORY);
                env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
                ApplicationModule am = null;
                InitialContext ic = new InitialContext(env);
                ApplicationModuleHome home = (ApplicationModuleHome) ic.lookup(AMDefName);
                am = home.create();
                // Connect the AM to a database connection
                String jndiDB = "jdbc/HRDS";
                am.getTransaction().connectToDataSource(null, jndiDB, false);
                boolean connected = am.getTransaction().isConnected();
                mAM = (YOURAppModule) am;
            catch (NamingException nex)
                // do some error processing
                throw nex;
            catch (Exception eee)
                // do some error processing
                throw eee;
        public void tearDownAM()
            if (mAM != null)
                if (mAM .getTransaction().isConnected())
                    mAM .getTransaction().disconnect();
                    mAM .remove();
        }You find the YOUR_APP_DEF_NAME in your application module under 'Configurations' -> AppModuleJndiName.
    Make sure you tear down each AM you set up. Otherwise you are running out of resources pretty fast.
    Timo

Maybe you are looking for

  • BPM 's Web Service Layer

    Hi all, I had a question on Process As a Web Service. We build this web-service in BPM and the WSDL is auto-generated in BPM. But what is the underlying method that BPM uses to convert usual Java or Fuego Data Types to SOAP i.e. to XSD? Is it using E

  • Error-Include report 'LZ1QTT01O' not found.

    Hi all, I am putting validations in table mainyainance generator. For that am editing FunctionPool of table maintainance. I uncommented  User-defined Include-files for adding my code for validation but while activating the function-pool i get error m

  • "My Alerts" quicklink missing (9.0.1)

    Upgraded to 9, then immediately to 9.0.1. Love the new layout, but can't find "My Alerts" or "Complete My Album" quick links. I've quit iTunes & restarted the Mac. Nothing. Jumped around the various store sections. Nothing. Searched the forum I found

  • How do I Isolate an object  and remove it's background?

    I'm curious to ask if it's possible to isolate an object in a photo and remove it's background so that I can put the object somewhere else eg a web page. Can aperture 3 do it or do I need to buy a plug in? Any suggestions are appreciated - thanks!

  • How to manage iTunes files.

    I uploaded music from a hard drive borrowed from a friend.  At first all was well.  Now I have music in personal iTunes files that I did not put there and certain music files in the main file cannot be accessed because the file is not complete.  This