Acces the same array in other .as file gives message it don't exist..

I am working on a little shooter as a project for learning as3.
I have struggled a lot with as3 syntax but am willing to bite the bullet and hope someday the light will shine...
the problem:
I have created three movieclips in a fla.
I connected 4 .as files to that fla:
bomber.as
bullet.as
kanon.as
shooter.as (connected to the file/stage itself).
All the behaviors of the mc's are described in packages in their own connected .as file.
I want to do a hitTestObject with all the "bullets" and the "bomber".
inside the as file f the bullet I make an array to store the bullets.
when I want to acces this same array in another .as file i get a message it don't exist..
Someone can suggest a solution...?
any help is very much appreciated!

package {
    import flash.display.MovieClip;
    import flash.events.MouseEvent;
    import flash.events.KeyboardEvent;
    import flash.events.*;//ik mankeer een event; ik weet niet welke, daarom importeer ik maar alle events...
    import flash.utils.Timer;
    import flash.utils.*;
    import kanon_mc;
    public class shooter extends MovieClip {
        public var varkanon:kanon_mc=new kanon_mc;
        public function shooter() {
            mijnTimer.addEventListener(TimerEvent.TIMER,tikTak);
            mijnTimer.start();
            varkanon=new kanon_mc  ;
            stage.addChild(varkanon); 
            varkanon.x=10; 
            varkanon.y=10; 
            //varkanon.x=stage.stageHeight-varkanon.height;
            stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);
            stage.addEventListener(KeyboardEvent.KEY_UP,keyUpHandler);
TypeError: Error #1009: .... object  null ...
at kanon_mc()
at shooter()
what am I doing wrong?
the shoother is attached to the document and kanon_mc is a movieclip in the library.

Similar Messages

  • How to use  the same channel to send a file and messages to the server

    I'm trying to develop a simple program that will send and receive files from the server and in the same time I need to communicate with the server through the messages
    I'm using TCP Socket
    my problem is
    I have only one channel
    so, I have no option, either I can use it for sending the file itself or sending the message .. but not both !
    my question is : How can I use the same channel for sending and receiving (file & message)
    I would appreciate for any clue or hint
    best

    kajbj wrote:
    kmarwani wrote:
    Thanks for reply
    yes, that what I'm thinking to do
    but, in case of sending binary file, if I attached a flag on its header, will it corrupt the file ?
    bestThe other end would of course need to decode the messages that you get, and only write the "data" part to the file.Thanks
    I'm gonna try to hard-code what you suggest and i will post what happen with me here
    even though I'm not sure how can I add header to a binary file and remove it from the file at other end. (coz I read it as stream and send as array without touching its contents)
    this how I'm sending the file
    ConnSocket = CSocket.accept();
    ToClient = new DataOutputStream(ConnSocket.getOutputStream());
    File myFile = new File("abc.jpg");
    FileInputStream myFileInStream = new FileInputStream(myFile);
    BufferedInputStream mybuffInStream = new BufferedInputStream(myFileInStream);
    myBytArray = new byte[(int) myFile.length()];
    mybuffInStream.read(myBytArray, 0, myBytArray.length);
    ToClient.write(myBytArray, 0, myBytArray.length);
    ToClient.flush();
    myFileInStream.close();best

  • Is there any option to recover a file we saved with the same name that other by mistake in a MAC PC

    is there any option to recover a file we saved with the same name that other by mistake in a MAC PC

    There's a slim chance. +*Stop using the drive IMMEDIATELY.+*
    Then see: [Data Recovery|http://web.me.com/pondini/AppleTips/Recover.html].

  • How to use the same element in different photoshop files?

    It occurs to me often that I use the same element in different photoshop files, a header or footer shown in the example below. So when the footer changes in one document, I need to change this footer in every other single document.
    Is there a possibility to use some kind of template, one single document,  that can be placed in different files , which is still editable afterwards?
    Thanks in advance.
    I'm using Photoshop CS6

    In a single document you can have several pages and these pages may have headers and footers that share smart objects.  If you replace the contents of the an embedded smart object on one page page that is shared on an other page the pages you will see both pages contents are changed. For they share the common object.   It is also possibly to have independent smart object layers. It depends how you create the layers in the single document.
    Example one sharing a smart object hi-light a smart object layer and use menu layer>Duplicate Layer... This will create a second smart object layer that share a common smart object. Each layer has is own associated transform. Do it again and you will have three layers the share a common smart object. So you can use each layer associated transform to position and size the layers contents. Make a picture package for example. When you hi-light any of the three smart layers and you use menu Layer>Smart Objects>Replace Contents... all three layers contents will be replace with the new smart object.  Care must be taken to replace the smart object with an identical size object for only the object is replaced the three associated transform for the three layers are not replaced or changed.
    Example two independent smart objects  hi-light a smart object layer and use menu layer>Smart Objects>New Smart Object via Copy.  This will  create a second smart object layer that has it own embedded smart object copy.  Do it again and you will have three all have independent embedded smart object that are identical.  However they do not have to remain identical.  For example if the first smart object layer was created by using ACR to open a RAW file as a smart object layer the embedded object is a copy of the raw file and its associated RAW conversion settings.  Double clicking on one of the smart object layers and you will see ACR open on its embedded RAW file with the embedded RAW conversion setting.  Changing these settings will update the layer smart object content with new ACR setting and pixel when you click OK in ACR. Repeat for the third and you will find you have three different raw conversions in Photoshop you can mask and blend together to bring out detail.
    I think what your missing is that a smart object contains a copy of the original object.  Changing the original after creating a smart object layer in document will not effect the smart object layer at all. Its independant from the original having a copy of the original. Only changes to the smart object layer and its embedded smart object effect smart object layers.

  • How can I, depending on the elemnts of an array, write into the same array

    Hi everyone, to make this a little clearer, consider a 2*2 I8 array, many y objective is the following:
    1) connect the array to the case structure, and depending on a specific case that's value of element of indeces (0,0), write over the same array in this way
    1 0
     2 3 
    for example, note that in (0,0) there's 1, so my decision is to make the array (same array) as:
    0 0
    2 3
    any ideas?
    Thanks.
    T. A.

    toniaz wrote:
    ... should I add the array itself inside the loop or should I add its local variable?
    The array data is in the shift register or wire!
    Any controls or indicators of the array just lets you interface to it via the front panel. Don't use controls or indicators as data storage via local variables, that's not the right way.
    Here's a very simple demo (LV 8.0) that shows one possibility how to do this. See if it makes sense.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    changeArrayElement.vi ‏18 KB

  • How can I keep all the previous datas in the same array?

    I have a problem with keeping the previous datas in my array. The problem is when the iteration loop is executed, I have one or two value(s) stored in the array. The second iteration I have either one or two values (depending on the condition) coming out, but it overwrites my previous value. I want to keep all my data in the same array as the loop is executed.PS. I have attached a simple vi along this message. If anyone can help me out with this, I really appreciate for the help.
    Regards,
    Sonny

    If you iterate several times (N > 100) then I would suggest using the Initialize Array outside of the For Loop and then use the Replace Array Subset inside the Loop to populate the array. The reason for this is because the Build Array utility has to locate a new space in memory for the newly concatenated array -- the Replace Array Element utility uses the same memory space.
    If you iterate just a few times with a small array then using the Build Array should be okay.
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • HT2498 If I use camera window to download my pictures to my computer, and then I copy and paste the pictures to iPhoto. Would I be ending up having the same pictures in two different files in my computer, and so wasting space in my hard drive?

    I recently bought a canon camera. The instructions of the camara recommend to use the canon software (camara window) to download pictures to my computer.  I would like to have my pictures in i-photo because it syncs them to my ipad.
    I want to download the pictures from my camera to camara window, and then drag and drop the pictures to i-photo. If I keep my pictures in both programs would I be wasting space in my computer hard drive by having the same pictures in two different files?

    Yes.
    Ignore the Canon software. It gains you nothing and adds complexity. Just use iPhoto for the lot.
    Regards
    TD

  • Creating a Master virtual hard disk and using the same for all other VM's

    Hi,
    We would like to create a master virtual hard disk and use the same for all other VM's. Can we do that ?
    my requirements :
    1) create 10 VM's
    2) first create a master virtual hard disk with win OS and use the same to create the 10 VM's.
    3) After creating the VM's change the HDD size.
                  -- if i have created master virtual disk with 500GB , and use the same for creating a virtual machine. can we change the HDD size to 1TB ?
    After creating the VM's ,i will change the system names and activate the windows accordingly.
    Will there be any implications ,if we can/will do like this.
    Thanks.

    Hi Suren424,
    I think Using Differencing Disks may cover your needs .
    Please refer to following setps:
       "Create the Parent Virtual Machine Configuration and Virtual Hard Disk
        Install the Operating System, updates, and common software
        Generalize the installation
        Prepare the parent virtual hard disk
        Create the differencing disks
        Create virtual machines that use the differencing disks
    For details please refer to follwing link:
    http://social.technet.microsoft.com/wiki/contents/articles/1393.hyper-v-virtual-machine-vm-parent-child-configuration-using-differencing-disks.aspx
    Hope this helps
    Best Regards
    Elton Ji
    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.

  • My iPad, Macbook and Apple TV are all set up with the same iCloud email address.  I bought the iPhone 6 and accidentally set the iCloud up with a different email.  My phone will not let me change the email address to be the same as my other devices,

    My iPad, Macbook and Apple TV are all set up with the same iCloud email address.  I bought the iPhone 6 and accidentally set the iCloud up with a different email.  My phone will not let me change the email address to be the same as my other devices, it tells me that email is already being used. How do I delete the iPhones iCloud account and reinstall it to match my other devices.

    Yes it will, just sign out, then sign back in with the correct address.
    Settings>iCloud>Sign Out.

  • My iPhone 4 appears with no service every day, i have to restarted and a few hours later again the same problem, Any other solution please???

    my iPhone 4 appears with no service every day, i have to make restart and a few hours later again the same problem, Any other solution please???

    This is almost always a symptom of a phone that was jailbroken or hacked to unlock it.
    Where did you get the phone?

  • Why doesn't the rotate gesture on my trackpad behave as it used to for switching between tabs when it works the same with all other programs besides Firefox?

    Why doesn't the rotate gesture on my trackpad behave as it used to for switching between tabs when it works the same with all other programs besides Firefox?
    I changed the about:config to make the rotate gesture move between tabs, and it worked great for well over a year. Now it behaves erratically as described here:
    https://bugzilla.mozilla.org/show_bug.cgi?id=877598
    It used to be very controllable to move one tab over, now it is erratic and moves quickly and to unexpected tabs regardless of how slow I do the rotate gesture. This is the main reason I use Firefox over Chrome and I would like to continue to do so unless there is no fix to this.

    Just set the browser.gesture.twist.threshold to something around 15-25.

  • Follwing query fails on one database, but the same works on other Database

    Hi,
    The following SQL fails on one database with ORA-01722 but the same works on other database.
    SQL> SELECT i.version, d.name, i.instance_name, i.host_name
    FROM v$instance i, v$database d, v$parameter p 2
    3 WHERE p.name = 'instance_number'
    4 AND DECODE(p.value, 0, 1, p.value) = i.instance_number;
    AND DECODE(p.value, 0, 1, p.value) = i.instance_number
    ERROR at line 4:
    ORA-01722: invalid number
    both databases are at same version (10.2.0.1) both are on same machine.
    Initailly I suspected NLS settings, I am surprised to see NLS settings are also same on both the databases.
    Any thoughts why is it happening

    Thanks for the reply
    Yes, i know that i am comparing varchar against number.
    bu there is no way that the database where the query is working has correct types on both sides as the tables are standard oracle dictionary tables.
    Yes, i tried this earlier, it works
    AND DECODE(p.value, '0', '1', p.value) = to_char(i.instance_number)
    it is very weired to see that error, i feel it something else that causing the trouble.

  • The final footage flicker on tv. I use encore cs4 4.0.1.048. With the same settings on other pc it's ok.

    The final footage flicker on tv. I use encore cs4 4.0.1.048. With the same settings on other pc it's ok.

    The crash report that you posted says the crash occurred during an OpenGL instruction. This means that there is a problem with OpenGL in your current graphics card drivers. I would suggest you do some research online about your graphics card model and its OpenGL 2.0 support. Perhaps there are others out there with similar issues in other OpenGL based applications.
    Here are a
    few more troubleshooting tips you can try, if you still have the strength for it. I'm sorry you're having such a hard time, but we'll try to get you through it.
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • We have three discussions forums with same subject. whenever a post gets new reply in one forum, it should automatically trigger workflow functionality to check conditions and send the same reply to other synchronized forums.

    we have three discussions forums with same subject. whenever a post gets new reply in one forum, it should automatically trigger workflow functionality to check conditions and send the same reply to other synchronized forums.
    Rajiv Kumar

    Hi,
    More details about your discussions forum will make others easier to find a corresponding solution on your requirement.
    If you mean there are three Discussion Board list waiting for synchronizing, I would suggest you create an Event Receiver for the three Discussion Board list.
    Here is a link with code demo about how to copy items from one Discussion Board to another including Replies:
    http://spcodes.blogspot.com/2013/03/programmatically-copy-items-from-one.html
    Here is a step by step sample on creating a simple Item added event receiver for Custom List in SharePoint 2010:
    http://msdn.microsoft.com/en-us/library/ff398052.aspx
    More information on Event Receiver for your reference:
    http://msdn.microsoft.com/en-us/library/gg749858(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/ff408183(v=office.14).aspx
    Feel free to reply if there are still any questions. 
    Best regards
    Patrick Liang
    TechNet Community Support

  • HT204053 My wife and I have both synced our iphones to the same desktop computer. She recently synced her ipad to the same computer. Now we cannot send messages to each other anymore. any ideas?

    My wife and I have both synced our iphones to the same desktop computer. She recently synced her ipad to the same computer. Now we cannot send messages to each other anymore. any ideas?

    By signing up for an apple ID it means she will be able to download her own apps and music and in future redownload if required for free. Ideally it should be the primary email address she uses as you can't transfer purchases etc to another ID.
    Photos shouldn't disappear but back them up before hand. These days everyone gets an iCloud.com address so she could use this as her ID. You would need to go to www.apple.com/iCloud from a computer to sign up for this. Bearing in mind you need a mac with lion or mountain lion or a pc with windows vista onward to take advantage of all services like calendar sync and find my iPhone etc.
    Otherwise sign up for an apple id with any other email address. You can do this at https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    AND Click on create an apple ID.
    the applications linked to your existing apple ID will have to be redownloaded on the other ID but you won't lose them on yours.

Maybe you are looking for