Array of JPanel and Array of JTextField?

Hi,
I try to create array of jpanel and inizialize it in "for" , but when run it give me this error message:
"Exception in thread "main" java.lang.NullPointerException"
at the row: "panInsCantante.add(panInsNCC);"
why?
(ps. i tried in another code to create array of jtextfield and it give me same error message..)
here part of code :
      JPanel [] panInsCantante = new JPanel[3];
      for(int i=0;i<=N;i++){
           JPanel panInsNCC= new JPanel();
           panInsNCC.setLayout( new GridLayout(3,1) );
           panInsNCC.add(campoTesto1);
           panInsNCC.add(campoTesto2);
           panInsNCC.add(campoTesto3);
           //panInsCantante[i] = new JPanel();
           //panInsCantante.setLayout( new GridLayout(1,1) );
     panInsCantante[i].add(panInsNCC);

a question (theoric...)A VERY important question I may add.
what's the difference between ..
this instance :
JPanel [] panInsCantante = new
JPanel[3];This declares and initializes the array itself, nothing more. No JPanels have been initialized as yet, just the array. It's as if you have now built the shelves to hold the books, but you have no books up there yet...
and this instance of panInsCantante? :
panInsCantante[i] = new JPanel();and this initializes each JPanel in the array as you loop through the array. .... and now you have filled the shelves with the books and can use the books.
You will need them both.
In all likelihood, the reason for your confusion is that all of your previous arrays were arrays of primative types: int, double, float, and char. In this situation, you don't need to go through the step of initializing the variable.
But now you are faced for the first time with an array of reference type, an array of Objects. This is a different situation and requires the steps that we have gone through.
Message was edited by:
petes1234

Similar Messages

  • Array of string and array of numbers

    Why am i not getting an array of numbers form this array of strings?
    Attachments:
    Untitled 5.vi ‏8 KB

    Here's a quick attempt at a crude workaround. See if it works for you....
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Untitled 5_MODCA.vi ‏13 KB
    CrudeCleanup.png ‏7 KB

  • Strange behaviour of "And array Elements"

    If u connect an empty boolean array to "And Array Elements" function, The output is "True" !. Is this correct?. Is there something wrong ?. Please Help.

    Hi J.A.C
    This is correct.This is an explanation I've found: "This behavior is intentiional, and stems from elementary Boolean logic. The Boolean algebra primitives are analogous to numeric operations are integers. Just as the identity element for addition is 0, and for multiplication, 1; the identity for Boolean OR is FALSE, and for AND, TRUE. For example, x^0 == 1; that is, x times itself zero times is by definition 1. For the same reason boolean x ANDed with itself zero times is TRUE."
    If this is not acceptable for your application, then just use the "Array Size" VI first to check if you've an empty Array (Array size=0) and then you can pass or not the array to the "And Array Elements" function.
    Hope this helps.
    Luca
    Regards,
    Luca

  • How to create an array of JButtons and How to implment it ...

    This is what i want to do - I want to create an array of JButtons that has 8 rows of 8 buttons, could someone help me with this (im creating a checkers board) all i need is the array of buttons and them in 8 rows of 8 buttons .... im pretty confident in the way of making them do what i want but need help getting it up and running .... please note it is to be done in the swing environment and not in a applet or anything - ie in a JPanel and a JFrame .... any help would be GREATLY appreciated.

    U can try this
            JButton b[][] = new Button[8][8];
         setLayout(new YourLayout());
         for(int i =0; i<8; i++)
              for(int j =0; j<8; j++)
                   b[i][j] = new Button("Test");
                   b[i][j].addActionListener(new YourAction());
                   add(b[i][j]);
         }               

  • Array of JPanel ??????

    Hy,
    Can anyone please tell me if the folowing exist
    (Array of JPanel):
    JPanel pane[];
    pane = new JPanel[5];
    for(int i=1;i<5;i++) {
    pane.setBounds(10,y,100,50);
    y= y + 20;

    Sure, you can do this (with some modification), but you need to create each JPanel stored in the array (the array won't automatically be initialized with JPanels):// create an array to hold JPanels
    JPanel[] panels = new JPanel[5];
    // Loop through the array and create
    // a new panel for each slot.
    // Also add the new panel to a parent panel
    // and set its size and location.
    for (int i=0; i < panels.length; i++)
       panels[ i ] = new JPanel();
       otherPanel.add(panels[ i ]);
       panels[ i ].setBounds(x, y, 100, 50);
    }Notice that the array is zero-based (the first item is panels[0] and the last item is panels[4]). Good luck!

  • Please help with ovals and arrays

    i'm creating an array that will be used to create a number of bubbles (simple ovals) on the screen. I can create 1 bubble/oval with no problem, but when i use the array to create multiple ones, everything craches and i get a big number of errors.
    Can someone please help or point me in the right direction?
    thank you
    Marko
    p.s. the code that i'm using at the moment is listed below. * to draw 1 oval, array not used
    import java.awt.Color;
    import java.awt.Graphics;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    public class Bubbles extends JPanel
        int array[] = {1,2,3,4,5};
        public void paintComponent(Graphics g)
            super.paintComponent(g);
            this.setBackground(Color.WHITE);
            for(int x = 0; x<5; x++)
            g.setColor(Color.BLUE);
            g.drawOval((array.(30,30,100,100));
    public static void main( String args[])
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Bubbles b = new Bubbles();
    b.setBackground(Color.WHITE);
    frame.getContentPane().add(b);
    frame.setSize(400, 400);
    frame.setVisible(true);

    Finally, this plug-in is ready for beta testing on www.amazoncanvas.com
    Thank you all who have participated in this program.

  • All the xml and arrays are getting NULL Problem

    Hello guys
    I am working on a project which uses xml loading, e4x and array manipulation extensively, and it was going good but now I got stuck on a strange problem.  Whole code was fine and application was working and responding in a desired way, but then mystourisly it stopped working and started to retun NULL values to almost all the actionscript (internal) Arrays and XML varibales.
    Now Whenever i load xml file and assign the loaded values to internal xml variables, internal values get only NULL instead of data.
    Same is the situation with Arrays, I created some components in mxml, and when i passed them to arrays by reference, code gets compiled successfully, but again Array has only null values [that code was working fine too]
    I am wondering if Adobe Flex did a silenced update or something similar and it is the result of that things !
    I am using Adobe Flex 3.2 with SDK 3.3 on windows Vista Ultimate.
    Please check this attached project, Import it and see if you face the same problem
    Thanks
    Link to Problem Project
    http://isolatedperson.googlepages.com/problemXperiment.zip
    Problem Screenshot
    http://isolatedperson.googlepages.com/xmlissue.JPG

    Use HTTPService to load the data. You'll have fewer problems.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application creationComplete="dataSvc.send();"
      xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                import mx.collections.XMLListCollection;
                import mx.rpc.events.ResultEvent;
                [Bindable] private var xlc:XMLListCollection;
                   private function loadXML(evt:ResultEvent):void{
                    xlc =  new XMLListCollection(evt.result.individual.@id as XMLList);
              ]]>
         </mx:Script>
         <mx:HTTPService resultFormat="e4x" result="loadXML(event)" url="alirazaTree.xml" id="dataSvc"/>
         <mx:ComboBox id="cbx" dataProvider="{xlc}"/>
    </mx:Application>

  • Loops and Arrays help

    Hi,
    I'm a freshman in college and new to java. I am completely lost and really need help with a current assignment. Here are the instructions given by my teacher...
    Building on provided code:
    Loops and Arrays
    Tracking Sales
    Files Main.java and Sales.java contain a Java application that prompts for and reads in the sales for each of 5 salespeople in a company. Files Main.java and Sales.java can be found here http://www.ecst.csuchico.edu/~amk/foo/csci111/labs/lab6N/Main.java
    and here http://www.ecst.csuchico.edu/~amk/foo/csci111/labs/lab6N/Sales.java It then prints out the id and amount of sales for each salesperson and the total sales. Study the code, then compile and run the program to see how it works. Now modify the program as follows:
    1. (1 pts) Compute and print the average sale. (You can compute this directly from the total; no new loop is necessary.)
    2. (2 pts) Find and print the maximum sale. Print both the id of the salesperson with the max sale and the amount of the sale, e.g., "Salesperson 3 had the highest sale with $4500." Note that you don't necessarily need another loop for this; you can get it in the same loop where the values are read and the sum is computed.
    3. (2 pts) Do the same for the minimum sale.
    4. (6 pts) After the list, sum, average, max and min have been printed, ask the user to enter a value. Then print the id of each salesperson who exceeded that amount, and the amount of their sales. Also print the total number of salespeople whose sales exceeded the value entered.
    5. (2 pts) The salespeople are objecting to having an id of 0-no one wants that designation. Modify your program so that the ids run from 1-5 instead of 0-4. Do not modify the array-just make the information for salesperson 1 reside in array location 0, and so on.
    6. (8 pts) Instead of always reading in 5 sales amounts, allow the user to provide the number of sales people and then create an array that is just the right size. The program can then proceed as before. You should do this two ways:
    1. at the beginning ask the user (via a prompt) for the number of sales people and then create the new array
    2. you should also allow the user to input this as a program argument (which indicates a new Constructor and hence changes to both Main and Sales). You may want to see some notes.
    7. (4 pts) Create javadocs and an object model for the lab
    You should organize your code so that it is easily readable and provides appropriate methods for appropriate tasks. Generally, variables should have local (method) scope if not needed by multiple methods. If many methods need a variable, it should be an Instance Variable so you do not have to pass it around to methods.
    You must create the working application and a web page to provide the applications information (i.e., a page with links to the source code, the javadoc and an object model) to get full credit. You can use the example.html's from the last two labs to help you remember how to do this.
    I'm not asking for someone to do this assignment for me...I'm just hoping there is someone out there patient and kind enough to maybe give me a step by step of what to do or how to get started, because I am completely lost from the beginning of #1 in the instructions.
    Any help would be much appreciated! Thank you!
    Message was edited by:
    Scott_010
    Message was edited by:
    Scott_010

    First ask the person who gave this asignment as to why do you require two classes for this , you can have only the Sales.java class with main method in it . Anyways.
    Let Main.java have a main method which instanciates a public class Sales and calls a method named say readVal() in Sales class.
    In the readVal method of sales class define two arrays i.e ids and sales. Start prompting the user for inputting the id and sales and with user inputting values keep storing it in the respective arrays .. Limit this reading to just 5 i.e only 5 salesPerson.
    Once both the arrays are populated, call another method of Sales class which will be used for all computations and output passing both the arrays.
    In this new method say Compute() , read values from array and keep calculating total,average and whatever you want by adding steps in just this loop. You can do this in readval method too after reading the values but lets keep the calculation part seperate from input.
    You must create the working application and a web page to provide the applications information (i.e., a page with links to the source code, the javadoc and an object model) to get full credit. You can use the example.html's from the last two labs to help you remember how to do this. I think this is ur personal stuff , but if you want to use web page , you probably will require to use servlet to read values from the html form passed to the server.

  • MS Office Report Express VI and Array Problem

    Hello all,
    I have a strange issue with the MS Office Report VI that's included with the Report Generation Toolkit. I created an Excel template which I linked using the "Custom template for Excel" preference and applied all the named ranges. However, two of the named ranges that I am inputting are 1D Arrays of doubles. Now the problem:
    When I input the arrays to their specific name range (it's only 6 values), instead of inputting just the array values into the cells, it inputs like this:
    0    Value
    1    Value
    2    Value
    6    Value
    It pushes the "Value" to the column next to the name range because of the 0-6.
    It does this with both arrays so it screws up all the formulas. Any one know how to remove the 0-6 and just input the values?
    Thanks all 
    Solved!
    Go to Solution.

    Greetings, I wrote a program that generates an array of data and stores a data table, just as a chart, just starting to program, I hope that my program can be useful
    Atom
    Certified LabVIEW Associate Developer
    Attachments:
    write_excel.vi ‏60 KB

  • Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.

    Hi,
    I have a MBP 13' Late 2011 and Yosemite 10.10.2 (14C1514).
    Until yesterday, I was using Garmin ConnectIQ SDK and all was working fine.
    Yesterday, I've updated my system with latest security updates and Xcode updates too (Version 6.2 (6C131e)).
    Since, I can't launch the ConnectIQ simulator app, I have this message in console :
    8/04/2015 15:19:04,103 mds[38]: There was an error parsing the Info.plist for the bundle at URL Info.plist -- file:///Volumes/Leto/connectiq-sdk-mac-1.1.0_2/ios/ConnectIQ.bundle/
    The data couldn’t be read because it isn’t in the correct format.
    <CFBasicHash 0x7fa64f44e9a0 [0x7fff7dfc7cf0]>{type = immutable dict, count = 2,
    entries =>
      0 : <CFString 0x7fff7df92580 [0x7fff7dfc7cf0]>{contents = "NSDebugDescription"} = <CFString 0x7fa64f44f0a0 [0x7fff7dfc7cf0]>{contents = "Unexpected character b at line 1"}
      1 : <CFString 0x7fff7df9f5e0 [0x7fff7dfc7cf0]>{contents = "kCFPropertyListOldStyleParsingError"} = Error Domain=NSCocoaErrorDomain Code=3840 "The data couldn’t be read because it isn’t in the correct format." (Conversion of string failed.) UserInfo=0x7fa64f44eda0 {NSDebugDescription=Conversion of string failed.}
    I have looked at this file and it looks like a binary plist
    bplist00ß^P^V^A^B^C^D^E^F^G^H
    ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_ !"$%&'()'+,^[\CFBundleNameWDTXcodeYDTSDKName_^P^XNSHumanReadableCopyrightZDTSDKBuild_^P^YCFBundleDevelopmentRegion_^P^OCFBundleVersi    on_^P^SBuildMachineOSBuild^DTPlatformName_^P^SCFBundlePackageType_^P^ZCFBundleShortVersionString_^P^ZCFBundleSupportedPlatforms_^P^]CFBundleInfoDictionaryVersion_^P^RCFBundleE    xecutableZDTCompiler_^P^PMinimumOSVersion_^P^RCFBundleIdentifier^UIDeviceFamily_^P^QDTPlatformVersion\DTXcodeBuild_^P^QCFBundleSignature_^P^ODTPlatformBuildYConnectIQT0611[iph    oneos8.1o^P-^@C^@o^@p^@y^@r^@i^@g^@h^@t^@ ^@©^@ ^@2^@0^@1^@5^@ ^@G^@a^@r^@m^@i^@n^@.^@ ^@A^@l^@l^@ ^@r^@i^@g^@h^@t^@s^@ ^@r^@e^@s^@e^@r^@v^@e^@d^@.V12B411RenQ1V14C109Xiphoneos    TBNDLS1.0¡#XiPhoneOSS6.0YConnectIQ_^P"com.apple.compilers.llvm.clang.1_0S8.1_^P^Tcom.garmin.ConnectIQ¡*^P^AW6A2008aT????^@^H^@7^@D^@L^@V^@q^@|^@<98>^@ª^@À^@Ï^@å^A^B^A^_^A?^AT^    A_^Ar^A<87>^A<96>^Aª^A·^AË^AÝ^Aç^Aì^Aø^BU^B\^B_^Ba^Bh^Bq^Bv^Bz^B|^B<85>^B<89>^B<93>^B¸^B¼^BÓ^BÕ^B×^Bß^@^@^@^@^@^@^B^A^@^@^@^@^@^@^@-^@^@^@^@^@^@^@^@^@^@^@^@^@^@^Bä
    I guess it is a normal format but my system seems to be unable to read binary plist ?
    I tried some stuff with plutil
    plutil -lint Info.plist
    Info.plist: Unexpected character b at line 1
    Same for convert
    plutil -convert xml1 Info.plist
    Info.plist: Property List error: Unexpected character b at line 1 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
    I also try to download a fresh version of the connectIQ SDK and no changes.
    Any idea ?
    Thanks

    Step by step, how did you arrive at seeing this agreement?

  • A few questions about Arrays and Array Methods.

    I have 2 dimentional arrays in a number of classes, and I wish to pass them about as variables, however, I can only seem to send int[], rather than int[][]. Gives me some compile errors.
    Another thing. How do i get the length of an array?
    I've tried: getLength(object), but it's a 2d array (int[][]), and It's having none of it. How do i get the length of a particular side?

    An object like int[][] only has a single "length", and that is the length of the first dimension. This object is an array that contains arrays of int, and each of those arrays could have a different length. Your 2D array may happen to be rectangular but that isn't a requirement of Java. So you would have to write your own code to find the lengths of the sides. The first side would be theArray.length, the second side would be theArray[0].length, and like that.

  • Connecting kurzweil sp88 to GB I want to connect my Kurzweil sp88 to GB. The Kurzweil has a baffling array of buttons and possible MIDI channels. It also has the old style MIDI plug ins. I've got the MIDI out connected to my MacBook Pro via USB adapter.

    I have my Kurzweil connected to my MacBook Pro via an adapter (old style MIDI from Kurzweil to USB adapter connecting to Mac). The Kurzweil has a baffling array of buttons and possible MIDI channels. Can anyone please tell me which of the channels I should use? Also, should I leave the MIDI In cable out of the Kurzweil? Thanks for as detailed an answer as possible. If you like you can respond directly to me at [email protected]

    First of all I do not own this keyboard. But a quick look at the manual (found on the internet) says that when first powered up the SP88 is in Internal Sounds mode. Meaning you hear the sounds selected when playing the keyboard. It also stated that the default Midi Transmit Channel is Midi Channel #1.
    Looks like you would need to go to the SP88 Keyboard's MIDI SETUP and simply select LOCAL OFF. Now the keyboard should be ready to transmit Midi Out only and no internal sounds should be heard.
    Next you may or may not need to do this but you might need to go into the Utilities Folder found in your Applications Folder on your Mac and double click AUDIO MIDI SETUP the keyboard Icon. Figure #1 below.
    Next you need to make a physical connection from the Midi Out of the SP88 to the Midi In on your Midi Interface. Figure #3 below. You may need to Click on Add Device first. Figure #2 below.
    In the examples shown below I have a Yamaha Electronic Drum Kit that is Midi Out only... not USB out. I had to plug a Midi cable from the Midi Out Port on the back of my Drum Module to the Midi In Port on the back of my Motu 828 Audio Inferface which is connected to my Mac. Next I created the Audio Interface and Drum Module "Devices" as mentioned above.
    I then double clicked on the Drum Module and made my Midi Out Selections. Figure #4 Below. And once it was setup and the icons closed I used my mouse to draw a virtual cable connection from the Drum Module Out to the Audio Interface In. Figure #3 below. This is how I got my Midi Devices to talk to one another.
    Once you have made your setup as I have outlined create a MIDI Instrument Track in Garageband, select an instrument for example a Piano then Record Enable that track in Garageband and see if you now hear what you are playing. In this example the SP88 is a Midi Controller only and you will only hear sounds selected in Garageband which is what you want.
    Keep in midi your setup may be different than mine. You can keep your SP88 Keyboard on the default Midi Channel #1. That would be a good place to start. Garageband receives Midi on all channels.

  • How to plot mutiple arrays on right and left y axes?

    Hi everyone,
    I have a (hopefully small?) problem... I have a 2D array with 6 columns of data I need to plot on a graph... I would like array 0 to plot on the left axis and arrays 1-5 to plot using the left axis... I have tried using clusters to group both sets of data wired to a for loop for each axis... But this is not working... Can't seem to find anything online to help with this..
    Any suggestions would be greatly appreciated.
    Regards,
    Jack
    Solved!
    Go to Solution.

    Not to worry.... Found this link..
    http://digital.ni.com/public.nsf/allkb/049C7E362BE​4270A8625756E005CC46F
    Thanks for vewing...
    Regards,
    Jack

  • I have read 118 files (from a directory) each with 2088 data and put them into a 2 D array with 2cols and 246384row, I want to have aeach file on a separate columns with 2088 rows

    I have read 118 files from a directory using the list.vi. Each file has 2 cols with 2088rows. Now I have the data in a 2 D array with 2cols and 246384rows (118files * 2088rows). However I want to put each file in the same array but each file in separate columns. then I would have 236 columns (2cols for each of the 118 files) by 2088 rows. thank you very much in advance.

    Hiya,
    here's a couple of .vi's that might help out. I've taken a minimum manipulation approach by using replace array subset, and I'm not bothering to strip out the 1D array before inserting it. Instead I flip the array of filenames, and from this fill in the end 2-D array from the right, overwriting the column that will eventually become the "X" data values (same for each file) and appear on the right.
    The second .vi is a sub.vi I posted elsewhere on the discussion group to get the number of lines in a file. If you're sure that you know the number of data points is always going to be 2088, then replace this sub vi with a constant to speed up the program. (by about 2 seconds!)
    I've also updated the .vi to work as a sub.vi if you wa
    nt it to, complete with error handling.
    Hope this helps.
    S.
    // it takes almost no time to rate an answer
    Attachments:
    read_files_updated.vi ‏81 KB
    Num_Lines_in_File.vi ‏62 KB

  • Populating a dynamic array with objects and managing it in runtime.

    So I'm another stuck firstyear. I'll try and make my question compact. I'm using Flash CS6 and have drawn an animated character on the stage that consists of separate parts that are animated and its head is a separate class/symbol entirely because it has not only animation, but a state switch timeline as well. This said Head extends the Main that is the character MovieClip.
    I am using a dynamic array to store and .push and .splice objects of another class that would collide with this said Head.
    I also discovered the super() function that is implicitly called as the constructor of the parent in any child class that extends the parent, in this case Head extends Main. The issue is that my collidable object array is populated within the main, within the function that spawns every next collidable object with a TimerEvent. This said function then gets called twice due to the super() call.
    I have tried putting this super() call into an impossible statement in my child class, but it doesn't change a thing, and it was said that this method is unsafe so I don't even know if it should be working.
    However what confuses me the most is when I trace() the .length of my collidable object array at the end of that function. As I said earlier, the original function both spawns an object after a period of Timer(1000) and adds it to the stage as well as adds the object onto the object array, but the super() constructor only duplicates the length call and a creates a copy of the object on the stage, but it does not add the second copy of the object onto the array. The trace() output goes on like so:
    1
    1
    2
    2
    3
    3
    4
    4
    etc.
    I wonder why and I'm really stumped by this.
    Here is the code in question:
    public class Main extends MovieClip {
                        public var nicesnowflake: fallingsnow;
                        var nicesnowflakespawntimer: Timer = new Timer(1000);
                        public var nicesnowflakearray: Array = new Array();
                        public function Main() {
                                  nicesnowflakespawntimer.addEventListener(TimerEvent.TIMER, nicesnowflakespawn);
                                  nicesnowflakespawntimer.start();
                        public function nicesnowflakespawn(event:TimerEvent) : void {
                                  nicesnowflake = new fallingsnow;
                                  nicesnowflake.x = Math.random()* stage.stageWidth;
                                  nicesnowflake.y = - stage.stageHeight + 100;
                                  nicesnowflakearray.push(nicesnowflake);
                                  stage.addChild(nicesnowflake);
                                  trace(nicesnowflakearray.length);
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
                        public function snowhit(event:Event) : void {
                                  if (nicesnowflakearray[0].y >= 460){
                                            if (nicesnowflakearray[0].y == stage.stageHeight) {
                                            nicesnowflakearray.splice(nicesnowflakearray.indexOf(nicesnowflake), 1);
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    I am also fiddling with the collision, but I believe that it would sort itself out when I deal with the array pop and depop properly. However I'm pasting it anyway in case the issue is subtly hidden somewhere I'm not looking for it. And here is the child class:
    public class Head extends Main {
                        public function Head(){
                                  if (false){
                                            super();
                                  this.stop();
    So like what happens at the moment is that the array gets populated by the first object that spawns, but there is two objects on the stage, then when the objects reach stage.460y mark the array splices() the one object away and displays an error:
    "#1010: A term is undefined and has no properties.
              at Main/snowhit()"
    then when the next object spawns, it repeats the process. Why does it trace the array.length as "1, 1, 2, 2, 3, 3, 4, 4, 5, 5, etc" until the despawn point and then goes on to display an error and then starts from 1 again, because if the array length is more than one object at the time when the first object of the array gets spliced away, shouldn't it go on as usual, since there are other objects in the array?
    Thank you very much to whomever will read this through.

    There are multiple problems:
    1. You should add eventlisteners for your objects only once, but you add eventlisteners every time your timer runs to all of your snowflakes, again and again:
                                  for (var i:Number = 0; i < nicesnowflakearray.length; i++){
                                            nicesnowflakearray[i].addEventListener(Event.ENTER_FRAME, snowhit);
    change it to
    nicesnowflake.addEventListener(Event.ENTER_FRAME, snowhit);
    I don`t see why its even necessary to employ this snowflakearray, it would be much straight forward if you simply let the snowflakes take care of themselves.
    2. Then you have to change your enterframe function accordingly
    public function snowhit(event:Event) : void {
                                  if (e.currentTarget.y >= 460){
                                            if (e.currentTarget.y == stage.stageHeight) {
                                            e.currentTarget.removeEventlistener(Event.ENTER_FRAME, snowhit);
                                            removeChild(e.currentTarget);
    3.
                                  //if (this.hitTestObject(nicesnowflake)){
                                            //trace("hit");
    since "this" is a reference to the Main class (root) it surely won`t function as you intend it to.
                                  if (false){
                                            super();
    makes no sense to use a condition that can never be true

Maybe you are looking for

  • Possible to run Adobe Interactive Forms in ABAP Webdynpro?

    Hi, Thanks all... I was request to install Adobe Interactive Forms (Adobe Document Server) and integrate with Web Dynpro web application. Would ABAP webdynpro could be fully integrated with Adobe Interactive Forms (Adobe Document Server)??? How could

  • Printing transparent marker images

    Hello, I'm using transparent PNG images (baloons) as markers for features of interest on my map application. Everything's just fine until we try to print from the browser. The marker images appear with blocks around the border, defeating the purpose

  • WebCenter Imaging - Organization ID

    Hey I am using WebCenter Capture and Oracle Forms Recognitin to create a "batch" that is inputted by our Imaging server. The back consists of: 1. A txt file 2. A TIF image 3. An XML file The problem is that, in the XML file, there is a line <orgid>17

  • Inserting a audio clip

    i want to insert a audio clip but i cant seem to get it to work

  • CS3 FLV Encode - Metadata "undefined"

    Hey all - I've recently picked up flash again after a few years, and I'm trying to work with FLVs. I've been using the "import video" command in CS3 to encode the FLV files; it's been working great up until now when my video payer swfs have been hard