What can make a FlexGlobal variable "undefined"?

I am writing an AIR app.  I have a group of variables that are needed across all of the major components in my application so I have delcared them in the main application as public, and then import the mx.core.FlexGlobals class into all of my major components.  The variable that I am having trouble with is an ArrayCollection called chapterAC.  I delcare it in my main application like this:
public var chapterAC:ArrayCollection = new ArrayCollection();
I will only be adding objects to this ArrayCollection at the zero level.  ie. chapterAC[0].someValue.  Keeping this in mind, I add elements to the ArrayCollection as follows:
FlexGlobals.topLevelApplication.chapterAC.addItemAt({title1: "My Title", value1: 3, title2:"My Second Title", value2: 4}, 0);
So the problem is that when traced, under certain circumstances, the trace is saying that the values are "undefined".  For instance, I may change the value of FlexGlobals.topLevelApplication.chapterAC[0].title1 to "hello" and it will trace that the value is now "hello".  Then I will change the value of FlexGlobals...title2 to something like "friend" and it will trace out that its value is now "friend".  But if I go back and trace title1 again, it should still say "hello" but now it says "undefined".  Going back and tracing title2 should say "friend" but it now says "undefined".
Also, if I give the ArrayCollection some values in one component and trace them, they will trace just fine, but in another component, they will trace as "undefined" and if I go back to the original component, they will trace as "undefined".
Am I doing something wrong with the arraycollection?  Do I need to give each individual element a type?

Amy, I appreciate your feedback.  You actually made me go back and brush up on my debugging skills.  But the solution turned out to be simple, because I am simply a moron It turns out if you use the method addItemAt on an arraycollection, it does not simply replace the item that is already there.  It puts the new item at the index you specify, and moves the existing items down the chain, ALL OF THEM.  So I simply had to stop using the addItemAt method and just declare the values directly.
i.e.
FlexGlobals.topLevelApplication.chapterAC[0].title1 = "New Title";

Similar Messages

  • What can make the iPod 4G battery damage?

    What can make the iPod 4G battery damage?

    Leaving it plugged in all the time can damage it, it needs to be cycled every now anda again. It keeps its internal resistanc from building up too much.
    Obviously, dropping it, getting it wet, lighting it on fire ect will also damage it.

  • What can make the battery damage?

    What can make the battery damage?

    Heat, sun, not use the iPod for a long time.
    If you don't go to use it for more than 1 month, recharge up to 50%

  • What can make a application deployment SLOW?

    Hi guys!
    A co-worker is having some trouble deploying Oracle ADF BC app to Integrated Weblogic Server.
    His computer conf's is same as me (Core i7, 4GB Ram, etc...) but his deploy time is twice slow than mine (sometimes 3x) while deploying the same APP.
    We both are using JDK 1.6.31 (32bits, I choose 32bits because 64bits doesn't support Fast Swap) on Windows 7 x64.
    From this perpesctive I want to ask, what kind of problem can make the Deployment to IngratedWLS slow?
    PS: Using JDeveloper 11.1.2.1, Application Modules are already using DataSource connections.
    Thanks in Advance,
    Renan.

    Amy, I appreciate your feedback.  You actually made me go back and brush up on my debugging skills.  But the solution turned out to be simple, because I am simply a moron It turns out if you use the method addItemAt on an arraycollection, it does not simply replace the item that is already there.  It puts the new item at the index you specify, and moves the existing items down the chain, ALL OF THEM.  So I simply had to stop using the addItemAt method and just declare the values directly.
    i.e.
    FlexGlobals.topLevelApplication.chapterAC[0].title1 = "New Title";

  • BB Protect: what can make it fail?

    My bb was stolen.  I happened to activate BB Protect before and I have commanded it to Wipe.  Is there anything the thief can do to fail the command? 
    Solved!
    Go to Solution.

    If the battery is removed from the phone it will not wipe until power is applied to the phone and it starts up, and at the same time it has to be able to receive the mobile network.
    To disable Blackberr Protect while the phone is operational the user would require the phone's password. By default 10 wrong password attemps will wipe the phone and it will be useless without a re-install of the OS and software. 
    If you have no password in the phone then anyone who is smart and knows how to us a Blackberry can stop Blackberry Protect if he does this before you send the wipe.
    If you change your Blackberry account ID on line, then the phone can no longer do updates, or install any software. With this you have to call in to your provider and report the phone missing. The phone's IMEI number should be reported to the carrier as lost or stolen. This way it can be cancelled. The phone will be useless.
    Jerry G.

  • What can make a DBF going offline ?

    Hello,
    First post here...
    I got an error that made 2 datafiles become offline. I had to recover them and it seems to work now.
    I wonder what is the cause of that. My db (9i in Archivelog mode) is on a W2K Server.
    Here is part of the alert.log:
    Thu Apr 14 10:10:52 2005
    Thread 1 cannot allocate new log, sequence 1132189
    Checkpoint not complete
    Current log# 3 seq# 1132188 mem# 0: L:\ORAHOME1\ORADATA\MYBASE\REDO03.LOG
    Thu Apr 14 10:10:53 2005
    Errors in file d:\orahome9i\admin\mybase\bdump\mybase_ckpt_5528.trc:
    ORA-01171: datafile 29 going offline due to error advancing checkpoint
    ORA-01122: database file 29 failed verification check
    ORA-01110: data file 29: 'D:\ORAHOME1\ORADATA\MYBASE\MY_DATA_FILE.ORA'
    ORA-01208: data file is an old version - not accessing current version
    I have to precise that the datafiles are quite
    small (ie <1GB) and that the problem occured during the production (not after any admin operation on the db).
    The only preceding events that could be the cause of this problem, I think, are due to ARC process:
    Thu Apr 14 10:10:49 2005
    ARC0: Evaluating archive log 1 thread 1 sequence 1132186
    ARC0: Warning. Log sequence in archive filename wrapped
    to fix length as indicated by %S in LOG_ARCHIVE_FORMAT.
    Old log archive with same name might be overwritten.
    ARC0: Beginning to archive log 1 thread 1 sequence 1132186
    Creating archive destination LOG_ARCHIVE_DEST_1: 'E:\ARCHIVELOGS_ORACLE\ARC32186.001'
    ARC0: Completed archiving log 1 thread 1 sequence 1132186
    I know that I should use %s instead of %S in my file mask.
    But do you think that it could have been the origin of my problem ?
    Thanks for any advice or idea to dig
    Aurélien Bastardie

    Your error is not related to the archive logs. Oracle offlined the datafiles because it could not update file header(s). The ORA-01122 indicates that the file was out of synch w/ the control file - most likely because it could not update the file - so it offlined it.
    Check your system event logs for any disk related errors.
    ORA-01171: datafile 29 going offline due to error advancing checkpoint
    ORA-01122: database file 29 failed verification check
    ORA-01110: data file 29: 'D:\ORAHOME1\ORADATA\MYBASE\MY_DATA_FILE.ORA'

  • Help: What can make "System.out.println" not displaying anything?

    Hello,
    We have Portal 10g.
    I have noticed a pb on the interpretation of existing JSP pages.
    I simplified the code... and I noticed that even this command doesn't work :
    <%
    System.out.println("Hello World");
    %>
    Any idea ?
    Is there any security ? permission I should get ?
    JSP works fine on our old 8i environment ...
    Thanks in advance for your help.
    Olivier

    Olivier,
    between 8i and 10g are aeons of time (for computer technology). As far as I recall, in 8i came with a Apache and JServ module. This supported Servlets and JSP through a special Oracle implementation. After that OC4J as a J2EE container for EJBs and Servlets/JSPs was introduced.
    Using JSPs with the database installation only is not advised anymore. You can use OC4J for that. But be aware that will require some changes in the configuration and deployment of JSPs.
    HTH,
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • What can make my Firewire drive unbootable?

    I have a 17" 800MHz iLamp. Here's the situation: I do a complete backup of my HD to an external Firewire drive using Carbon Copy Cloner. Now, this used to work just fine, but at some unknowable point in the past, something changed. Now, if I choose the external drive as my startup disk, it won't work. When I restart I get the grey apple screen with the spinny thing, it thinks for awhile (2-3 minutes or so) and then the apple changes to the circle-slash "no" symbol.
    The thing is, that same external drive will boot my other machine - a 933MHz G3 iBook - just fine. The problem is somehow specific to the iMac.
    I'm running 10.3.9.
    The data on the backup drive seems good otherwise, and I have tried repairing privs post-backup, to no avail.
    Any thoughts on why this might be?

    Nobody really knows. There's lots of posts in here about it.
    Some people are re-installing, going back to 10.4.3. You'd have to archive and install, upgrade to 10.4.3 with the COMBO drive and consider updating your Quicktime.

  • What can be done to make these code examples work on web Browsers?

    I have tried numerous versions of ?Hello World? examples over the web to display the text on a web page. All the examples work on my local machine in the application viewer, but they don?t work when from a web browser. I have tried both Firefox and IE.
    Some of them include:
    [http://java.sun.com/docs/books/tutorial/uiswing/examples/start/HelloWorldSwingProject/src/start/HelloWorldSwing.java|http://java.sun.com/docs/books/tutorial/uiswing/examples/start/HelloWorldSwingProject/src/start/HelloWorldSwing.java]
    Firefox error:
    java.lang.reflect.InvocationTargetException
         at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassCastException: start.HelloWorldSwing cannot be cast to java.applet.Applet
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Exception: java.lang.reflect.InvocationTargetException [http://en.wikipedia.org/wiki/Swing_%28Java%29|http://en.wikipedia.org/wiki/Swing_%28Java%29]
    Error when viewed on Firefox:
    java.lang.reflect.InvocationTargetException
         at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassCastException: start.SwingExample cannot be cast to java.applet.Applet
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Exception: java.lang.reflect.InvocationTargetException An Ideal Code if someone could decipher why it fails from a browser is:
    import javax.swing.*;
    public class SwingHelloWorld extends JFrame {
        public SwingHelloWorld(String name) {
          super(name);
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
          JLabel label = new JLabel(name);
          // label.setPreferredSize(new Dimension(210, 80));
          this.getContentPane().add(label);
          this.pack();
          this.setVisible(true);
      public static void main(String argv[]) {
            SwingHelloWorld swingHelloWorld = new SwingHelloWorld("This would be great if it worked via a browser!");
    } Error from Firefox:
    java.lang.reflect.InvocationTargetException
         at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: java.lang.InstantiationException: start.SwingHelloWorld
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.InstantiationException: start.SwingHelloWorld
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         ... 9 more
    Exception: java.lang.reflect.InvocationTargetException The latter code is very short and would serve the intended purpose most ideal. It can accept input and allow me to replace the ?System.out.println? function that works so well to display when working with code in the development environment.
    Thanks in advance for any input on this.
    -- L. James
    L. D. James
    Edited by: apollothethird on Mar 8, 2010 5:05 AM

    paulcw wrote:
    As per your suggestion, I changed the &#147;extend&#148; to Applet and changed it to &#147;JApplet&#148;. Making that change will result in code that won?t even compile.Right. You're going to have to change your program to actually work as an applet.
    Either that or use Java Web Start, which is probably the best option.Thanks. The code I presented was my attempt to find examples that represented the advice I thought I was getting (to use JFrame and JLabels). I?m changing the direction of the examples I?m looking for now.
    >
    The current code as published by sun.com actually compiles and displays in the Netbeans programming environment. It looks great. But I?m kind of stuck with the missing link for making it output to the browser.Different things work in different ways. You wrote a standalone application which compiles and runs. Writing an applet is a different thing, and works in a different way. Read the applet tutorials for more information on applet methods and the applet lifecycle.Thanks. I?m reading. I try to execute some of the examples from my reading, but and stuck. So, I?m asking for some clarifications of some of the components I?m stuck with. Having some of my questions answered would help me to understand better the lots of reading and studying that I?m doing.
    I?m taking in all the advice that is given, and I appreciate it a lot.
    >
    Thanks for the hints. Thanks also in advance if you happen to know how to change the extend to Applet or JApplet instead of &#147;JFrame&#148; and it works.This is made clear in the applet tutorials. It's more than just changing the class to extend. Note that Applet/JApplet extends Panel/JPanel, so that changes the way your program is constructed. Basically, you don't have to create your own frame.Also, I don?t want a frame. I?m trying to find a way to make my question clear. I appreciate the time you?re taking to respond to a new user?s scope.
    >
    But again, web start is probably a better choice if you have a running app.
    You should probably abandon the idea that you just have to nudge a program slightly in a new direction to make a wholly new thing. Programming is all about reducing complex problems to a set of concrete solutions.Absolutely. I have some examples that will actually print a string to a browser. However, those examples will print what?s written in the immediate code, with no apparent method (that I can) make into a variable. The ?Hello World? example that I find that has a main class is the ones that are failing. The ones that don?t have a main class will print.
    I have been trying to find a way to pass a variable to this code that will print over the web:
    import javax.swing.JApplet;
    import javax.swing.SwingUtilities;
    import javax.swing.JLabel;
    public class HelloWorld extends JApplet {
        //Called when this applet is loaded into the browser.
        public void init() {
            //Execute a job on the event-dispatching thread; creating this applet's GUI.
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        JLabel lbl = new JLabel("Hello World");
                        add(lbl);
            } catch (Exception e) {
                System.err.println("createGUI didn't complete successfully");
    }However when I try to add a functioning main class and change the ?Hello World? to a string variable, it fails. I understand it fails because I?m having a missing link about how to turn the class into something that can take input.
    I know I?ll be ridiculed for the example I?m about to print, but I?m printing it to give an example of having a variable for my output.
    Look at the code that fails (just to get an idea of what I?m trying to explain):
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package test1;
    * @author teama
    import javax.swing.JApplet;
    import javax.swing.SwingUtilities;
    import javax.swing.JLabel;
    public class HelloWorld extends JApplet {
        //Called when this applet is loaded into the browser.
        public void init() {
            //Execute a job on the event-dispatching thread; creating this applet's GUI.
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run(String myhello) {
                        JLabel lbl = new JLabel(myhello);
                        add(lbl);
            } catch (Exception e) {
                System.err.println("createGUI didn't complete successfully");
            public static void main(String[] args) {
                // This is the output of my calculation
                // HelloWorld.void("Hello World")
                run("My Hello")               
    } -- L. James
    L. D. James

  • I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    Version 11.1.5.5 of iTunes was just released today. If you update to that, does that help with the recognition troubles?
    http://www.apple.com/itunes/download/

  • IPhone 4 shuts down on its own all the time. Sometimes restarts without ability to make calls, receive emails, and the wrong time.  Only a restore fixes it.  What can I try?

    So my iPhone had a broken screen and back for a while, which may have something to do with this.  I mean like missing peices.  I realize this leads to corrosion and I may have a broken iPhone but this is a really strange problem.  It's always shutting off on its own, sometimes in my pocket while locked and sometimes randomly while in use.   For example the other day this started happening everytime I started safari.  This happens all the time, I usually just restart it and it works for a while.   Sometimes after shutting off a few times in a row, after restarting it will show the wrong time, screws up phone calls and says that it cannot locate the gmail server, or something to that extent (won't load emails).   The phone calls are weird, I can't receive any.   Any calls that are made from the phone, go through on the other side and ring for them, but won't ring or make a connection on my side, also I can't end the call when this happens, it responds to me pressing end by fading the screen to that graytone color that it does before ending usually but stays on that screen whenever you go back to it, only disappearing after reseting.  Texts work, not in iMessage, and internet seems to work.   The only thing that fixes this condition is a restore. The iphone has been turning itself off over the last 3 months and its been getting progressively worse.  Recently its been pretty bad, and then the phone started to do all that weird stuff I've been talking about.  That started about 3 weeks ago and has happened 4 times, the last two times relatively close together.   This is really annoying and I can't afford to replace it.   Do I have to live with it?   What can I try?  Should I maybe replace the battery?  I took the panel off to look at it and the plastic around it was pitted possibly from being really hot.

    Please don't respond with useless comments.  I've already addressed the fact that my screen was broken a few months ago.  My phone may or may not be broken beyond repair either way, as I said before I can't afford a new phone.  It's a strange problem because from what I can tell no one else has posted the same problem anywhere I can find.  Don't be a dickhole.

  • So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    First, I would recommend repairing the hard drive with Disk Utility.
    If that doesn't fix the problem, there's a very dangerous command you can execute in the Terminal.  This is very hazardous, because a simple typo can result in very drastic consequences.  I have seen people erase their entire hard drive by putting a space in the wrong place!  So, please follow the directions I'm going to give you very carefully!
    Open the Terminal, which is found in the Utilities folder in the Applications folder.  In the Terminal, enter the following:
    sudo rm -f
    Make sure to put a space after the "-f"!  Then, drag the troublesome file from the Finder and drop it on the Terminal window.  That should insert the path to the file in the command.  Then go back to the Terminal and press return.  You will be asked for your password, and when you type it, nothing will be shown as a security measure.  Press return again after entering your password.  The file should be deleted.

  • Every Time that I try ot download my songs that I have purchased from Itunes and error message come up, "error 450." Make sure that your network connection is open and try again. What can I do to fix this problem?

    Every time that I try to download my music from I tunes an error message comes up it says, ( err = 450) Make sure that your network connetion is active and try again.  What can I do to fix this problem, I have tried everthing that I-tunes has told me but with no luck. Thanks

    Try disabling your parental controls. Does that help with the 450?
    iTunes: Using Parental Controls

  • I make Rest for iPad, and now every time i open it , i chose the country and the network  and tells me he works the activation and then tell me the iPad could not be activated, try again what can i do

    i make Rest for iPad, and now every time i open it , i chose the country and the network  and tells me he works the activation and then tell me the iPad could not be activated, try again what can i do

    Those are the instructions for your computer's iTunes (i.e. using the Store menu at the top of your computer's iTunes and selecting 'View My Account' on it). If you are doing it on your iPad then are you following the instructions for iOS devices :
    To unhide your purchases
    Depending on the content type, open the App Store, iBooks, or iTunes Store on your device.
    Scroll to the bottom of the main page.
    If you're not already signed in, tap Sign In.
    Tap your Apple ID name, then tap View Account.
    Scroll down on the Account pane, and tap Hidden Purchases.
    Locate the item you would like to unhide then tap the Unhide button.

  • N97 What can I delete from C: in order to make spa...

    I am using Nokia Messaging with my Gmail account but, due to low memory problems on C, I am obliged to delete my incoming mails almost every hour in order to make space. Problem is that I cannot delete on the phone without sync which means that the mails are also deleted on the server which is not ok if I want to keep some mails for further reference.
    So, I have to find more space on C but what can I delete without affecting the normal operation of the phone ?
    For instance, can I delete OVI store or APIBridge ?
    It is time that Nokia issues a new firmware allowing a better use of the memory !!!!
    Thanks in advance for your help.

    Hi, first you could change messagememory - copy messages from C to E and delete them from C afterwards. Open the onboard browser and delete privacy data.  About messages - you will have to set up your mailaccount again on E - delet whats on C.
    All apps as facebook, fring, nimbuzz etc can be installed at E. Install everything possible on E. - You could delete ovistore and use it through the webbrowser instead. - I think Carman does that.

Maybe you are looking for