Actionscript clas to MXML class error!

Thank you for your help.  This problem has plagued me for hours.  I have an Actionscript class which I receive data from an SQLite database.  When I receive the data I call a method from my custom MXML s:BorderContainer class.  The MXML class is supposed to take the data and place markers on a Google Map.
     When I try to call any of my components (Buttons, Map, anything not written inside the fx:script of the MXML class it throws the one of two errors or alters nothing on the screen.  I understand this means I'm trying to play with the component before a certain process has completed (I'm a bit shaky at what point the MXML class needs to be in order for the components to be usable, if thats after initialization, creationComplete or if I need to use addChild or addElement somewhere per component for them to be usable).
     I've tried in the Actionscript class to create a new instance of the MXML class then call the method.  Inside the MXML class when I try to access a button component it throws the Error #1009: Cannot access a property or method of a null object reference.  Inside Actionscript after the new instance I used the .initialize() call to try and fix this and although it seemed to stop the null error, then I noticed it would do one of two things, it would either throw an Object not initialized error with some playing around (addElement calls, creationComplete call) or it simply would not display anything on screen.  If the code all worked I made sure it had made it to the method of the MXML class just fine and all the code had been used, however, no changes or new creations were shown on screen.
     I placed some simple code below to give a better visual of what I'm describing.  Any and all help is appreciated and thanks again.
// The Actionscript class is named ConnectDatabase
private var test2:MainContainer;
test2 = new MainContainer();
test2.initialize();
// After the data is received from the SQLite database I call the MXML class (MainContainer) function with the following:
test2.connectionReadyMethod();
// Inside the MXML class named MainContainer
- I've tried different addElement statements, but I'm open to any advice as I'm problem doing them wrong.
- This is where I receive the nothing, the Error #1009: Cannot access a property or method of a null object reference, or the Object not Initialized errors.

A couple of things come to mind.
The first is where is the MXML component and when is it instantiated? If it is in the 2nd, 3rd, etc. view of a navigator container, and creationPolicy for the container is not set to "all" (and it should not be set to "all" in some cases), then this error can occur.
If the MXML component is created based on the data returned, is it being created either in the data service result handler or at least in a method called from the result handler? Flex data calls are in general asynchronous, so you can't issue a data call send() and assume the data has been received and execute something after the send() that depends on the data.
Not sure if this helps, but this is what comes to mind.
If this post answers your question or helps, please mark it as such. Thanks!
http://www.chikaradev.com
Adobe Flex Development and Support Services

Similar Messages

  • Pure Actionscript vs. MXML

    I understand that the answer to this question may be mostly
    subjective to some, but I'm trying to zero in on the objective
    part. In developing my apps, I am finding a regular tension between
    having my Flex components developed in MXML vs. Actionscript. I
    wanted to ask a general question, and again, trying to be objective
    as possible, is it better to develop Flex components in MXML or in
    pure Actionscript?
    While MXML of course let's you perform WYSIWYG development in
    Flex Builder's GUI editor, I have run into things that can't be
    done very gracefully in MXML, reuse of MXML components can become
    cumbersome, and there's a lack of control of loading and unloading
    of components in MXML, which you can accomplish in Actionscript
    much better.
    I have noticed that what I have seen of the Flex API is pure
    Actionscript, which would indicate a lean toward Actionscript, but
    then I've seen code snippets for components in various places on
    the web posted in MXML.
    So to try to get down to the crux of the matter -- is it
    inherently better to develop Flex components in pure Actionscript
    or in MXML, and why?
    Thanks -- I'm curious as to community responses....
    B

    Tankman,
    I'll take one last stab here.
    quote:
    Wait, you've completely lost me- you're saying that MXML
    isn't declarative because it can include Actionscript?
    You said previously that "the Flex documentation explicitly
    states that MXML is declarative, and therefore limited". I replied
    with "MXML isn't completely declarative, it allows embedded
    Actionscript." In other words, while MXML components are
    declarative, they aren't 100% declarative. An MXML component is
    both declarative and includes embedded Actionscript. The intent of
    the original question was to compare writing components in MXML
    (which includes embedded Actionscript), versus writing components
    exclusively in Actionscript. Never at any time was there any
    intention to be discussing writing components in MXML while
    prohibiting any use of embedded Actionscript, like virtually all
    tutorials and samples from Adobe do. The thrust is to determine if
    going in either direction (MXML, which again includes embedded
    Actionscript, vs. pure Actionscript) either provides or removes any
    features / functionality that the other has access to.
    quote:
    By that logic, no, there are no limitations to MXML. Since it
    has actionscript in it.
    Now you've answered the question. In your opinion, writing a
    component using MXML (once again, which includes embedded
    Actionscript) has no limitations.
    quote:
    By your classification system, I could just make my entire
    application one MXML file, with 9000 lines of actionscript in it,
    doing all the work, and that would count as "MXML".
    Yes, this is true. But the question wasn't an architectural
    design one of how the app should be broken into subcomponents, the
    question was about the merits of building your components in MXML
    vs. pure Actionscript. Your scenario has nothing to do with using
    MXML vs. pure Actionscript -- that is merely a design choice with
    whichever one you choose. One could just as easily write 9000 lines
    of Actionscript in a single monolithic Actionscript class.
    Based on your answer above, about there being no limitations
    of MXML when you include Actionscript, if that is true, then I
    believe one has to conclude that writing MXML components is
    superior to Actionscript, based on the fact that Actionscript
    components cannot be rendered and modified in the designer. Now,
    whether MXML has limitations was the question posed in this mail
    thread, and that answer still remains to be seen. But if your
    answer is true, then MXML is clearly superior, based on avaiable
    tooling, to Actionscript.

  • Listening CustomEvents (Generated by Actionsctip Class) in MXML Classes

    Hello Guys
    I have some custom events, When i dispatch them from mxml classes (visually included in application), i can listen them.
    But when i dispatch them some actionscript classes, i cant listen them, Any help?
    Actually i have a custom class which loads the xml and after loading dispatch an event like "loading complete"
    Any help?
    Thanks

    have you specified in the AS file that it dispatches your event???
    [Event(name="loadingComplete", type="com.your.package.LoadingCompleteEvent")]

  • Plug-in load class error while running portalapp.xml file in NWDS7.0

    hi,
    im facing a problem in NWDS7.0 while running portalapp.xml file im getting error realted some plug-in load class error.
    Even 3 times i have re-installed but still getting same error.
    Please help me how to over come this. This is error im getting :
    Please open this link with Firefox so that you can able to see error.
    http://www.imageurlhost.com/images/jri5lj7lpftu23ejyye0_Error.jpg
    Regards,
    prasad.

    Dear Prasad
    Please right click on portalapp.xml > open with > check all the available editors.
    Also restore default edition in NWDS. Go to windows > preference > Workbench OR Web editors > click on restore default and Apply and then Ok.
    then close the NWDS and open it.
    Hope it will helps
    Best Regards
    Arun Jaiswal

  • Import and recognize class error

    The following is a simple welcome.jsp file that I am trying to run on a local J2EE sever. As you can see it tries to import classes one being the FaqCategories.class which is located in the folder Ch03 of the WEB-INF directory. When I call the page up on the browser It gives me that it does not recognize the FaqCategories faqs = new FaqCategories; class error. I am wondering why(Is the import statement wrong? Did I put the class in the wrong directory? Etc... I followed everything the book told me to a que and I still received an error.
    <&@ page errorPage="/WEB-INF/errorPage.jsp"
             import="java.util.Iterator,Ch03.FaqCategories" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
         <title>Java FAQ Welcome Page</title>
       </head>
       <body>
         <h1>Java FAQ Welcome Page</h1>
         Welcome to the Java FAQ
      <%! FaqCategories faqs = new FaqCategories(); %>
      Click a link below for answers to the given topic.
      <%
        Iterator categories = faqs.getAllCategories();
        while(categories.hasNext()) {
           String category = (String) categories.next();
       %>
          <p><a href="<%= replaceUnderscore(category) %>.jsp"><%= category
       %></a></p>
       <%
        %>
       <%@ include file="/WEB-INF/footer.jspf" %>
          </body>
         </html>
          <%!
           public String replaceUnderscore(String s) {
             return s.replace(' ','_');
           %>

    Originally posted by: nadeem.aboobaker.bea.com
    "Walter Harley" <[email protected]> wrote in message
    news:f2jet7$na1$[email protected]..
    > "Nadeem Aboobaker" <[email protected]> wrote in message
    > news:f2j2au$fi6$[email protected]..
    >> Hello all,
    >>
    >> I am having issues creating a plugin as a JAR file, where the plugin
    >> contains a nested JAR file.
    >
    >
    > Hey, Nadeem.
    >
    > Yes, there are a lot of problems with trying to use nested jars in (and
    > out of) Eclipse. You can look at
    > https://bugs.eclipse.org/bugs/show_bug.cgi?id=145001 as a sort of
    > "umbrella" bug report that mentions some of the issues and refers to other
    > bugs. There is more than one limitation at work, so describing the issues
    > succinctly is difficult. As you noticed in the posting from a year ago,
    > the only way to make it work really smoothly is to get rid of the nested
    > jars by expanding them (and even then, there are issues with nested .class
    > files!).
    >
    > If it is at all possible to convert the nested .jar into a separate
    > plug-in (by adding an OSGi-compliant MANIFEST.MF) and make your primary
    > plug-in depend on it, instead of trying to nest the jar within your
    > primary plug-in, that will be your best and most "Eclipse-friendly"
    > answer.
    >
    > Feel free to contact me offline or here on the newsgroup if needed.
    >
    > -walter
    Walter, thanks for the reply. Converting the nested .jar into a sepearate
    plug-in isn't possible for my case. I checked out the Bug report, and also
    the referenced bugs and Wiki page, it was interesting to read all the
    issues. :) In any case, I know that deploying the plugin as a directory
    instead of a jar works, so I will just go with that approach.
    - Nadeem

  • Org.apache.jasper.JasperException Ambigous Class Error

    I included two classes:
    <% @page import = "com.myco.ejb.ThisBean" %>
    <% @page import = "com.myco.ejb.session.ThisBean" %>
    and received an org.apache.jasper.JasperException Ambigous Class Error on the second import. One is a cmp bean, the other is a session bean. I thought Sun wanted us to name our packages like this to aid in the prevention of duplicate class names (i.e., Windoz DLLitus). Shouldn't these classes be unique by the package name?

    No, that's not redundancy. Are you using the fully qualified class name in your jsp:usebean tags?
    like:
    classname="com.mypackage.mybeans.MyBean"
    And are you using the package statement properly in your source?
    In the case that you are using two classes of the same name in one file the compiler has to have a means of distinguishing between the two. The only way for it to do so is to use the fully qualified name of the class in each case in which it is referenced. This means either in the jsp:usebean tag as shown above, or in such a case as:
    com.mypackage.myclasses.MyClass theOb=new com.mypackage.myclasses.MyClass();
    Awkward yes, but ambiguous No.
    In the case where you are using only one class of a given name the import statement will be sufficient for the compiler to know that it is that which you fully qualify in the import statement.
    Remember, all that the import statement does is provide the convenience of pre-clarifying exactly which class you'll be referring to when using the abbreviated class name only. Importing two classes of the same name defeats the purpose.
    Good luck,
    Brad

  • Retriving com class error in add-on client machine

    Dear all,
    i got error com class error when i start the add-on. The add-on working good all  systems except two client system.
    Thanks & Regards
    B.Lakshmi narayanan

    hi you  checked..
    Check it search .
    May be the problem in X86  platform..
    Retrieving the COM class factory for component with CLSID

  • Missing Class error from handler class - urgent question!

    Hi,
    I am getting an "Missing Class" error when running a web service. The web service was generated from a Java class via the "create J2EE web service" option.
    The web service has a JAX-RPC handler class added, which belongs to the same package as a logging class. The logging class is used to write to a file for debug purposes. A "missing class" error is being generated whenever I attempt to invoke the web service (via the enterprise manager test util), the error refers to the logging class which is used by the main handler class. The JAX-RPC handler works fine by itself, the error is only seen when I attempt to use the logging class.
    I have re-built, re-deployed from scratch again, but still get the same error! Am I missing something simple here?
    thanks for any advice

    Hello,
    I have posted something similar, but I am not sure how to get over this issue. I am not sure if this is a code issue, I have scanned both EJB 2.0 and 2.1 specifications, but nothing caught my eye.
    Here is the error I am getting starting this in JDeveloper 1013 :
    Apr 11, 2006 12:17:49 AM com.evermind.server.Application setConfig
    WARNING: Application: current-workspace-app is in failed state as initialization failedjava.lang.InstantiationException: Error initializing ejb-modules: [current-workspace-app:CNSI-JDev-7_Exp-7_0:DbUtilWrapper] - Unable to load ejb-class com.my.common.database.ejb.DbUtilWrapperBean, see section 23.2 of the EJB 2.1 specificationjava.lang.ExceptionInInitializerError: java.lang.NullPointerException
    Here is the ejb-jar.xml :
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>DbUtilWrapper</display-name>
    <ejb-name>DbUtilWrapper</ejb-name>
    <home>com.my.common.database.ejb.DbUtilWrapperHome</home>
    <remote>com.my.common.database.ejb.DbUtilWrapper</remote>
    <local-home>com.my.common.database.ejb.DbUtilWrapperLocalHome</local-home>
    <local>com.my.common.database.ejb.DbUtilWrapperLocal</local>
    <ejb-class>com.my.common.database.ejb.DbUtilWrapperBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    I am not sure if this should be in the assembly-descriptor, in ejb-jar.xml or orion-ejb-jar.xml :
    <method-permission>
    <unchecked/>
    <method>
    <ejb-name>DBUtilWrapper</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    Any ideas ?
    Thanks

  • Go to Java Class Error

    When I highlight a keyword or class and right click to
    'Go to Declaration' or 'Browse Javadoc' I get:
    Go to Java Class Error
    Unable to determine browse target.
    Help
    Thanks

    Hi! Welcome to the forums.
    Try reading this post.
    http://supportforums.blackberry.com/t5/BlackBerry-World/solution-on-isssues-with-Facebook-for-BlackB...
    Cheers!
    Click " Like " if you want to Thank someone. If Problem is resolved accept it as a "Solution ", so that others can make use of it.
    Click if you want to Thank someone. If Problem is resolved, so that others can make use of it.

  • "Missing Class" error when running web service

    Hi,
    I am getting an "Missing Class" error when running a web service. The web service was generated from a Java class via the "create J2EE web service" option.
    The web service has a JAX-RPC handler class added, which belongs to the same package as a logging class. The logging class is used to write to a file for debug purposes. A "missing class" error is being generated whenever I attempt to invoke the web service (via the enterprise manager test util), the error refers to the logging class which is used by the main handler class. The JAX-RPC handler works fine by itself, the error is only seen when I attempt to use the logging class.
    I have re-built, re-deployed from scratch again, but still get the same error! Am I missing something simple here?
    thanks for any advice

    Cant you paste some of your code, formatted in code tags? It looks like there is a problem passing some of the XMl response, it doesnt like a tag html.
    If you post some code somebody might actually be able to help you.

  • Invalid change to class error when deploying EJB

    We have EJBs that were built by Webgain Visual Cafe and successfully deploy
    to WLS 5.1. We then use the WLE EJB Deployer Tool to build WLE container
    classes and deploy the same EJBs in WLE 5.1.
    One EJB does not deploy in WLE. The ULOG error message is:
    133929.EA-LAWSTUC!JavaServer.517: main: IJENGINE_CAT:150: ERROR: Invalid
    change to class service.Request
    133929.EA-LAWSTUC!JavaServer.517: main: EJB_CAT:29: ERROR: While deploying
    jar ServiceEJB : com.beasys.weblogic.classloader.RedeploymentException:
    ERROR: Invalid change to class service.Request
    133929.EA-LAWSTUC!JavaServer.517: Finalizer: IJENGINE_CAT:152: INFO: Closing
    jar C:\aj\ServiceEJB_WLE.jar
    Does anyone know what can cause an "invalid change to class" error when
    deploying to WLE 5.1? Especially since the EJB deploys successfully in
    WLS.
    Carl Lawstuen

    Reason: database keeps a reference of the class in JAVA$CLASS$MD5$TABLE table. This table keeps a refrence to all java classes loaded in database, and is present in each schema you deploy classes. That's the reason why if you change the application module name, you can load this classes. It instead keeps a reference if you use DROP JAVA CLASS command to drop a java class from de database. Use DROP JAVA command to clear the reference of the dropped classes when dropping it.
    You can see this table as a class dictionary of the database, and you don't have to handle this records manually.

  • Class error message

    I get an error message when I boot up Livetype:
    An unexpected error occured. (*class error for 'ProSystemStore;' class not loaded)
    When I hit continue on the error message Livetype opens but when I select "New" under File the app quits. Any ideas other than reloading the app?
    thanks,
    Rob
    G5 Mac   Mac OS X (10.4.5)  

    sorry, I can't duplicate your duplicative post. the error appears ot be a unix command or a Java thingy but I cannot find any such item on my system. I can finds tons of "class" files and several with "pros" in the filoename but none with "prosystem"
    Hope you get better advice.
    bogiesan

  • How to set the scope for Mxml classes?

    Hi,
    i want to create the mxml class but with internal (package)
    scope (for example).
    Is it possible? (for AS classes yes)

    Don't think you can control scope like this in MXML.

  • .class error

    Hi,
    I am trying to make a simple code where a main program calls a method in a class so that the total sum of all elements of an array is calculated. Here is my code:
    public class playingwithArrays
            static void sumArray(int [] arr){
                int sum = 0;
                    for(int i = 0; i<arr.length; i++){
                        sum+= arr;
    System.out.println ("Total sum of array is" + sum);
    This is the class where there is the method i want to access
    The class below is the main class:public class Start
    public static void main (STring[] args){
    int [] arr = new int [10];
    for (int i; i<arr.length; i++){
    arr[i] = (i+1);
    playingwithArrays summation = new playingwithArrays ();
    summation.sumArray(int arr[]);
    Where there is bold the compiler is giving me a .class error. Please can you help me as I am a beginner and I am trying to learn java!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    It's a good idea to follow standard conventions about nAmEs. PlayingWithArrays, not playingwithArrays.
    You define sumArray() as a static method. That means that it will not be associated with a particular instance of the PlayingWithArrays class. And so you can access it without having to create a new instance of the class.
    It's not actually wrong to say summation.sumArray(...), it's just that it looks odd. It would better be PlayingWithArrays.sumArray(...).
    The actual error is what you are passing as the argument. This method expects an array of int and that's what you should pass it. You don't need the int and [] business that goes into the declaration of a method, just use the variable.
    PlayingWithArrays.sumArray(arr);This will use a static method of the PlayingWithArrays class to print out the sum of the array elements.

  • Duplicate class error message

    Hi,
    Does anyone know what a duplicate class error message means and how to resolve it?
    It just does not make any sense to me as there is only one instance of the class yet the compiler is throwing out a duplicate class error message.

    I copied your experiment and had no trouble compiling the four classes (A, B, C, and Test). One thing to note is that Test.class shows up in the root destination directory (above a.b.c) because Test.java is missing the package statement. Perhaps, as mentioned earlier in the thread, the missing package statement is causing the problem with your compiler.
    I compiled them with ant using the following build.xml code:
    <?xml version="1.0" encoding="UTF-8"?>
    <project basedir="." default="compile" name="PackageTest">
         <property name="build.dir" location="build"/>
         <property name="dist.dir" location="dist"/>
         <target name="init">
              <mkdir dir="${build.dir}/classes"/>
              <mkdir dir="${dist.dir}"/>
         </target>
         <target name="compile"
                   depends="init"
                   description="Compile Source Code">
              <javac srcdir="."
                   destdir="${build.dir}/classes"/>
         </target>
    </project>

Maybe you are looking for

  • Why is some mail going to bulk folder?

    I have an ATT mail account (Yahoo account too.)  I started to become concerned about email that I wasn't receiving (folks swore they sent it.)  I noticed my iPhone has bulk mail folder (Mac and iPad do not) and lo and behold, tons of email that I hav

  • Cannot Print InDesign from Windows 7 OS

    Hi all, I am hoping someone might be able to suggest something that can fix this issue. I just got a new machine with Windows 7 as the OS. This is a brand new machine. I've installed PageMaker, InDesign CS4, and Acrobat 9 Pro - complete installations

  • Integrate an oracle adf with ebs

    Hello, I have oracle adf app being called from an menu of oracle eBS . My app is called by users of 2 operating units. How my adf app can get the actual operating unit ie how I restrict my data to the right operating unit. Many thanks, Aurel

  • PO without material

    Hi All, Is it possible to create PO without material master and Account Assignment category as well. BR Govindaraj.d

  • Workflow task  - Function 'SWL_WI_SELECT'

    Hi Experts, When pass a workitem id from a workflow task to the function 'SWL_WI_SELECT' with parameter DO_COMMIT = 'X', I always get the error message 'No administrator found for the task'. Do you know if I am missing anything and how to fix it? Ple