Trying to understand and use an Array

I would like to have a game where the player has three tries before the game stops or moves on to another level.
In this game an object jumps up with a mouseClick and if it doesn't hit it's target it falls where it crashes into a floor that uses hitTestObject.
This leads to a  restartBtn. but I want that movieClip to remain on the stage, which has an animation that splatters. A new MovieClip is put on to the stage and the cycle starts over.
Before this stage of the game s over I want the various movieClip splatters to be visible on the stage.
I thought an Array would help me achieve this result but I'm not familiar with using them dynamically.
I'm hoping someone can give me some tips as to what might work.
I have temporarily separated this problem from the rest of the code as I'm hoping it will be clearer.
This is where I left off and when I click the button it seems to eliminate the previous movieClip and introduce the next one.
But it seems like I'm missing someting so I thought I would post it as it is probably a problem that comes up a lot in games. Thanks
import flash.display.MovieClip;
import flash.events.MouseEvent;
var movieArray:Array = new Array();
movieArray = ["Egg_A","Egg_B","Egg_C"];
movieArray[0] = new Egg;
movieArray[1] = new Egg_B;
movieArray[2] = new Egg_C;
var myMovieClip:MovieClip;
init();
function init()
          for (var i:int = 0; i < movieArray.length; i++)
                    emptyMC.addChild(movieArray[i]);
mainBtn.addEventListener(MouseEvent.CLICK,changeEgg);
function changeEgg(evt:MouseEvent):void
          for (var i:int = 0; i < movieArray.length; i++)
                    movieArray.splice(i,1);
          init();

I don't see where an array is going to make anything remain.  Just having an instance created without removing it until you want it to go away is all you need.
I don't see much reason with what you are doing with that array either.  First you assign a set of strings to it, then you replace those strings with instances of some Egg objects.  Then you add all the eggs to the display at once in your init() function (not one at a time), or you remove them all from the array with your change Egg function... calling the init() function after emptying the array isn't going to yield much since the init() function uses the array.

Similar Messages

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • Trying to understand and learn how to use btrfs

    I have been the past days trying to get my head around how btrfs works
    I have been trying tools like mkinitcpio-btrfs (very poorly documented) and now, if i list the subvolumes i have in certain volume (/) i see i have 4 subvolumes that have been created while playing around.
    If i try to delete them with "sudo btrfs subvolume delete __active", for example, I get a "ERROR: Error accessing '__active'
    What am I doing wrong?
    Also, I cannot get the whole idea about the difference between snapshots and subvolumes, i mean, a snapshot should be a directory that saves the changes made on the fs, s, if you want to roll back those changes, you just have to make btrfs "forget" the changes stored in that directory and move along, but I cannot take the idea of the subvolume thing.....
    As btrfs is quite experimental and the wikis are not noob-proof still, I'd appreciate if someone gave me a hand trying to understand these concept...
    For the moment, I'm just using it on a test computer and on a personal laptop with no fear of data loss,.
    Any help is welcome
    Thanks!
    Last edited by jasonwryan (2013-07-19 23:13:27)

    I honestly think it is probably a better idea to not use mkinitpcio-btrfs.  As mentioned above, it is poorly documented, and for me it has never worked right (if at all).  It is an unofficial AUR package, and unfortunately our wiki still seems to give the false impression that using this package is the way to user btrfs with Arch.
    The way I have my system set up is that in subvolid=0 (the root of the btrfs filesystem) I have a rootfs subvolume and a home subvolume (there are others, but these are what primarily make up my system).  So in my fstab, I basically have two nearly identical lines, but one has no subvol specified and is mounted at /, and the other has 'subvol=home' mounted at /home. 
    So in order to make it so that I can change the root filesystem as I please, instead of having the / fstab entry specify the subvolume, I put it in the kernel command line.  That is, I have 'rootflags=subvol=rootfs' in the kernel command line.  So if I want to change it, I simply change the path to one of the snapshots. 
    Just remember that if you are one who likes a custom kernel, it is likely that you will have to have an initamfs no matter what you compile into your kernel.  For one thing, the kernel has no mechanism for scanning for multiple device btrfs filesystems.  But also, I have read that the kernel itself cannot handle the rootflags kernel command line argument.
    Oracle Linux does something interesting with their default setup.  They are not a rolling release, so this probably wouldn't work so well in Arch Linux, but they actually install the root filesystem (I think it is actually done to subvolid=0) and then after installation of the packages, a snapshot of the root filesystem is made, and the system is setup to boot off of that snapshot.  So it is almost like having an overlayfs on openwrt.  There is always a copy of the original system, and and changes that are being made are being done "on top" of the original.  So in the event of an emergency, yo can always get back to the original working state.
    If you put your root filesystem on something other than the root of the btrfs filesystem (which you should, as it makes the whole setup much more flexible), then you should also set up a mountpoint somewhere to give administrator access to the filesystem from subvolid=0.  For example, I have an autofs mountpoint at /var/lib/btrfs-root.   chose that spot because /var/lib is where devtools puts the clean chroot.  So it seemed as reasonable a place as any.
    You should go to the btrfs wiki, and peruse through the stuff there... not our wiki, but the actual btrfs one, as our wiki is pretty sparse.  There is not all that much content there (not like the Arch wiki), but it does cover the features pretty well.  I mean, there is certainly quite a lot for being information on only a single filesystem, but it shouldn't take you too long to get through it.  There are a few links to articles about midway down the front page.  What really gave me a better grasp of getting started with btrfs were the ones titled "How I Got Started with the Btrfs Filesystem for Oracle Linux" and "How I Use the Advanced Capabilities of Btrfs".

  • Understanding and using Logical Components for Managed System configuration

    Experts.....
    I am embarking on a fresh installation of SolMan 7 EhP1 SPS25 and after a few bugs along the way, I am finally nearing the end of including the first Managed System.  Somewhat related to {forum:id=10293771] I am hoping I can get some advice, but specifically with regards to Logical Components.
    General question - I have a slide from SAP that shows a picture from Product->System->Instance->Logical System (client)->Logical Component.  I am confused because it shows that Client 100 of a given ABAP system could be assigned to Logical Component A, whereas Client 200 of the same system could be assigned to Logical Component B.  This seems wrong to me?
    I am at the last step of the managed systems configuration wizard : "create logical components" and only want to ensure that I set things up to hopefully ensure that later usages (Maintenance Optimizer, etc) will handle things correctly!!!
    - Our SAP landscape is not very complex
    1. only ERP and EP (Dev/Test/Prod). 
    2. We are utilizing HR Self Service (XSS).
    3. The ERP ABAP systems are on Netweaver 7.01. 
    4. EhP4 has been installed, however we only activated the HCM business functions.  Therefore SAP_HR is on 604 whereas SAP_APPL is on 600.  I think this might be driving some of the confusion in SMSY
    For the DEV ABAP system I am trying to configure:
    1. The system is showing up in two products : "SAP ERP" and "SAP ERP Enhancement Package" with the header data for both showing "EHP4 FOR SAP ERP 6.0 / NW7.01" and "SAP ERP 6.0"
    2. Under "SAP ERP" the "product instance selection" shows only "SAP NW - Adobe Docu. Service" and "SAP ECC Server" as relevant
    3. Under ""SAP ERP Enhancement Package" the "product instance selection" shows only "Human Capital Mgmt" as relevant by default.  I manually flagged the development portal system as "relevant" for "SAP XSS (Self Services)"
    4. The RCA DBA Cockpit system is complaining "No data available for extractor activation. Please check product mapping and Software Components in SMSY"
    5. In the Managed System wizard, there is no logical component for any of the "EHP4 FOR SAP ERP 6.0 / NW7.01" selections
    From what I can tell, I think this is correct:
    1. Create a Z_EHP4 logical component and assign the DEV/QAS/PRD systems to them
    2. Also assign the DEV/QAS/PRD to the existing SAP logical component "SAP ERP ECC SERVER"???
    3. For the Solutions, my plan is to create
    a. Non-Production ERP : with the dev/test erp/ep systems, but test system as the leading system
    b. Production ERP with the prod erp/ep systems only
    Thanks for any advice/guidance to help me avoid future problems!!
    Edited by: Eric Poellinger on Jun 15, 2011 6:32 PM

    General question - I have a slide from SAP that shows a picture from Product->System->Instance->Logical System (client)->Logical Component. I am confused because it shows that Client 100 of a given ABAP system could be assigned to Logical Component A, whereas Client 200 of the same system could be assigned to Logical Component B. This seems wrong to me?
    Client 100 could be assigned to any number of logical components, client 200 could be assigned to those same ones or none of them. A logical component is just a grouping of systems used to accomplish some task in SolMan.
    For example with ChaRM you could have 2 logical components.
    ZCHARM_DEV development (100) -> QA (200) -> prod (300)
    ZCHARM_SEC security (900) -> QA (200) -> prod(300)
    One is used to show the path for moving development changes to prod, the other for security changes. 200 belongs to both, but 100 only to one.
    Set them up in whatever way meets you needs. It looks like for you, you could just use the default one and assign your clients to the various system roles. Not all functionality in SolMan uses the logical components though.

  • Trying to create and use of a packaged class....

    Hi ,
    I have created a directory and put there the generated class....
    The dir structure is as:
    C:\oracle_files\Java\Examples\
                                  class_variables
                                  common_classes
    I have set the classpath to both the two above directories....
    The ThreeBedroomHouse class which has been compiled and put into the \common_classes is as follows...:
    package common_classes;
    public class ThreeBedroomHouse
          /*private class variable*/
    The compilation(successful) was done as :
    C:\oracle_files\Java\Examples\class_variables>
    C:\oracle\product\10.2.0\database10g\jdk\bin\javac -d C:\oracle_files\Java\Examples\common_classes\ ThreeBedroomHouse.java
    and the ThreeBedroomHouse.class file was generated in the "C:\oracle_files\Java\Examples\common_classes" directory....
    I tried to compile the second .java file , called HomeBuilder -including a main()- with code such as:
    import common_classes.*;
    public class HomeBuilder
    {When i try to compile it....
    C:\oracle_files\Java\Examples\class_variables>C:\oracle\product\10.2.0\database10g\jdk\bin\javac HomeBuilder.java
    I get the errors....
    package common_classes does not exist....
    Can you please pinpoint the error....?????
    Many thanks ... for your help and info....
    Sim

    I have succedded in running it.....at last!!!! However , in a manner which is not understandable to me.....
    That are the steps i 've taken.....
    [pre]C:\oracle_files\Java\Examples\class_variables>set classpath
    CLASSPATH=.;C:\oracle_files\Java\Examples
    C:\oracle_files\Java\Examples\class_variables>C:\oracle\product\10.2.0\database10g\jdk\bin\javac -d C:\oracle_files\Java\Examples ThreeBedroomHouse.java
    C:\oracle_files\Java\Examples\class_variables>C:\oracle\product\10.2.0\database10g\jdk\bin\javac HomeBuilder.java
    HomeBuilder.java:28: cannot access ThreeBedroomHouse
    bad class file: .\ThreeBedroomHouse.java
    file does not contain class ThreeBedroomHouse
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    ThreeBedroomHouse myHouse=new ThreeBedroomHouse();
    *^
    1 error
    C:\oracle_files\Java\Examples\class_variables>set classpath=C:\oracle_files\Java\Examples
    C:\oracle_files\Java\Examples\class_variables>C:\oracle\product\10.2.0\database10g\jdk\bin\javac HomeBuilder.java
    C:\oracle_files\Java\Examples\class_variables>java HomeBuilder
    Exception in thread "main" java.lang.NoClassDefFoundError: HomeBuilder
    C:\oracle_files\Java\Examples\class_variables>set classpath=.,C:\oracle_files\Java\Examples
    C:\oracle_files\Java\Examples\class_variables>java HomeBuilder
    Exception in thread "main" java.lang.NoClassDefFoundError: HomeBuilder
    C:\oracle_files\Java\Examples\class_variables>set classpath=.;C:\oracle_files\Java\Examples
    C:\oracle_files\Java\Examples\class_variables>java HomeBuilder
    3
    3
    4
    4
    C:\oracle_files\Java\Examples\class_variables>The above in bold are the 'critical' points in the whole procedure.....
    First of all , i have deleted the ThreeBedroom.class file generated and i have compiled as such
    C:\oracle_files\Java\Examples\class_variables>C:\oracle\product\10.2.0\database10g\jdk\bin\javac -d C:\oracle_files\Java\Examples ThreeBedroomHouse.java
    Then , i have realized that i have made a mistake at setting the classpath ..... I have seperated the two entries ('.' and <directory path>) with a comma instead of a semicolon ';'.....
    But something i cannot understand is......
    when i have set the classpath as : CLASSPATH=.;C:\oracle_files\Java\Examples the compilation of the HomeBuilder.java is unsuccessful ....
    I have to set the CLASSPATH as CLASSPATH=C:\oracle_files\Java\Examples
    without the 'characters' *.;* to have it compiled successfully......
    Afterwards... if i try to execute the compiled .class file with the current classpath ... the java exe file produces error again.....
    I have to set it at its previous setting in order to run it successfully.....
    All this description is shown above......
    Can you please explain this 'strange(????) behavior'....?????
    Many thanks...
    Sim

  • Trying to understand the use of adjustment layers

    I think I am missing something here so thought I would bring it here for discussion.
    I am learning to do Adjustment Layers and when I do an adjustment layer of levels  and then another of  hue/saturation it has no way of confirming my choices.  If  then  want to do Shadows/Highlights it will not work change anything and I think it is because I have not confirmed the adjustment layer. What do I need to do after doing the adjustment layer to go ahead and do something else no as an adjustment layer on the photo OR is that impossible. How to make this work????
    Sandie

    An Adjustment layer effects all visible pixles in the layers below itself. So if you have a Levels Adjustment Layer and the Background layer below, the entire Background layer is affected. If you have another layer above the Background that is not an Adjustment Layer but only covers have the entire image space, the Levels Adjustment will effect the additional layer and the visible parts of the Background layer. If you add a second Adjustment layer, the effects stack. The lower of the Adjustments is applied first, the second is applied afterward, moving upward.
    The Adjustment Layers themselves are transparent, they are a bit like a lens filter on your camera. Just like looking through a pair of sunglasses causes the world to appear darker, an a Levels Adjustment Layer can make the layers beneath it appear darker (or lighter, as dictated by the settings). But as Ken mentions, the strenght of using an Adjustment Layer, as opposed to using an Adjustment, is that you can always come back and change the settings later.

  • I can import my first clip to the video library, but not the second clip. I tried dragging-dropping and using the "E" key, but only the first clip will show up in the library. I use IMovie 9.0.9 and OSX 10.8.5. with no problems until yesterday.

    I can drag my first clip from the New Event window into the Project Library, but not the second. I can highlight the second clip in the New Event window, but it won't "drag". The "E" key works for the first clip, but not the second.I've been using IMovie daily and the problem just appeared. No upgrades to the computer and no new software installed.  IMovie 9.0.9 and OSX 10.8.5

    Thanks victoryhat.  I learned some new things from this very clear tutorial.  But it didn't answer my question about why the titles don't stay with the video when I export it.
    He did mention something that might be a clue however.  When he talked about importing a title he created as an image, he noted that he was careful to make the image the same size as the video he was adding it to: 1280 x 720.  Since I took the video with an iPhone in the vertical position, my video image isn't the same size and orientation as the titles.
    Maybe there is a way I should be setting the screen for this size???  I'll go back and play around.  Meanwhile thanks for alerting me to Gary Rosenzweig's MacMost tutorials.  Very clear.  I'll look for more.

  • Trying to obtain and use PeopleSoft Open Query ODBC driver

    I've found architectural diagrams and descriptions of the PeopleSoft Open Query ODBC driver and am looking for where to download this driver from.
    Anyone know or have any experience in using it?
    Thanks,
    Bob Sleik

    Hello Bob,
    The "PeopleSoft Open Query ODBC driver"
    is delivered with PeopleTools.  Starting with PT8.50, this driver is installed by running PS_HOME\bin\client\winx86\psodbccrinst.exe, which spools a log to %TEMP%\psodbccrinst.log
    The psodbccrinst.log shows the files and registry updates involved.
    After installing, when you open the ODBC administrator, you'll see 'PeopleSoft PeopleTools' driver for your PeopleTools release.
    Kind Regards,
    -Kirsten Zurbrugg

  • Trying to download and use Flashplayer

    Hi
    I've been trying to view virtual tours of houses through an estate agent's website which requires me to download Adobe Flashplayer. I go to the Adobe website, download and install Flashplayer okay but then it just doesn't seem to 'activate', so that when I go back into the website it's still saying I need to download Flashplayer (and I've now been round this loop about 5 times!).
    Being new to a Mac, is there something I'm supposed to do to make some downloaded software actually work?
    Many thanks!

    Flash player is usually installed as part of the OS installer. Go here on the Adobe web site:
    http://kb2.adobe.com/cps/141/tn_14157.html
    and download and run the uninstaller first. You have to quit all browsers when you uninstall and install. Then the Flash player is here:
    http://get.adobe.com/flashplayer/
    Then run Disk Utility and Repair Permissions.

  • Part 07 - Understanding and Using Cascading Style Sheets | Classroom: Basic Site Layout and Navigation in Dreamweaver | Adobe TV

    In this video you’ll continue to further customize your website using CSS or Cascading Style Sheets. With CSS you can control many visual aspects of the website efficiently and consistently.  Learn the basics of how CSS rules work and how you can easily take advantage of the power and flexibility of CSS in Dreamweaver including creating and editing your own CSS class.
    http://adobe.ly/wTlFxC

    some of these tutorials don't really work. changing the body image to scrolling or fixed doesn't change anything on my computer, and apparantly doesn't change anything on the version that the instructor is using either, since he never shows us the "before"

  • Apache access denied when trying to start and use perl...

    I have a simple perl script that is sitting in my "sites" directory, and have turned on all the changes in the apache httpd.conf file.
    when I use http://localhost~username i get the default web page, but when I add the firct.cgi to the end, I get the following error...
    Forbidden
    You don't have permission to access /~kentjason/first.cgi on this server.
    why is this happening. I should be able to see anything in that directory, right?
    thanks alot,
    jason

    For security reasons you can't just run .cgi scripts from any-old location.
    By default apache will only run scripts that are in /Library/WebServer/CGI-Executables, and referenced by http://servername/cgi-bin/script.cgi
    If you want to run this as a CGI your simplest solution is to put the script in /Library/WebServer/CGI-Executables and change the URL you call to prepend the /cgi-bin/

  • FCproX Trying to find and use the Audio Animation Editor

    I put the playhead at the point I wanted the audio/music to go under a sound bite and hit option K and nothing happened.  What do I need to do?  Thanks!

    Hold down the option key and click the audio volume control line in the audio part of the timeline.
    A keyframe will appear at that point.
    You can make as many keyframes as you want this way and drag them up and down to achieve the desired effect.
    You don't need the Audio Animation editor.

  • HT3131 MY macbook pro will only connect to my TV when the lid is open. When I close it to enter clamshell mode my TV gives me a error message saying "resolution mismatch." i have tried switching cables and using different TV's. it works on all my other TV

    It works all my other TV's except my Magnavox 39 inch. i have made sure that the resolutions are compatible.

    Yay! Solved my own question; just did a hard shutdown, worked like a charm! Funny, didn't before. But who am I to question salvation?

  • Using Parameterized Arrays in Stored Procedure

    I tried following code to pass array value to stored procedure but its giving error, as I am new to this procedure, please advise what am I missing ?
    Best Regards,
    Luqman
    My code is as below.
    CREATE TYPE num_array AS table of number;
    create or replace procedure give_me_an_array
    ( p_array in num_array )
    as
    begin
    for i in 1 .. p_array.count
    loop
    dbms_output.put_line( p_array(i) );
    end loop;
    end give_me_an_array;
    declare
    mdata num_array;
    begin
    mdata(1) := 1234;
    mdata(2) := 10;
    give_me_an_array(mdata);
    end;

    Hi Satya,
    Now I got it, thanks,
    Can you please advise, if I use the same stored procedure for EMP Table and use my array values to retrieve the selected EMPNo
    I tried following but I could not succeed.
    When I compile the stored procedure, error occurs:
    "inconsistent datatypes: expected NUMBER got NUM_ARRAY"
    for example:
    CREATE TYPE NUM_ARRAY AS TABLE OF NUMBER;
    Create or Replace Package TB_Data
    Is Type CV_Type Is REF CURSOR;
    END TB_DATA;
    Create or Replace Stored Procedure give_me_an_array
    (CV IN OUT TB_DATA.CV_TYPE,
    MEmpNo In Num_Array)
    Is
    Begin
    Open CV for
    Select * from EMP
    Where Empno in MEmpNo;
    End myProc;
    declare
    mdata num_array:=num_array(7839,7844);
    begin
    give_me_an_array(mdata);
    end;
    Best Regards,
    Luqman

  • Trying to understand variables in Edge Animate

    I am writing ALL my code in the document.compositionReady window and have a few questions.
    1. I am trying to understand the use of sym.setVariable() vs using the var keyword. It seems that if I declare
    var myVar = "test" then the variable myVar is available in all my functions further down the code. So when would I use sym.setVariable("myVar","test")?
    2. Since I am writing all my code on document.compositionReady is it possible to edit the code in Dreamweaver. (I like the find and collapse functions in DW). I tried opening the edgeActions.js file and making some edits but they did not seem to always work.
    3. Back to variables. If I define a variable within a function by using the var keyword, it seems to only be available within that function. Is that true? How do I define a variable in a function that is available globally?
    4. Clearly I am mixing javascript, jquery and edgeAnimate API in my code. Is that ok? I am making my animations work but concerned that I am not doing this efficiently/effectively.
    Thanks for any tips, advice, comments.

    Hi, Marlene-
    #2: You should be able to use any editor to edit the edgeActions.js file.
    #1,3: Variables can be declared for local scope (within the function) and attached to various scopes within the composition.  I tend to use variables attached to various symbols to maintain state within that particular scope.  For instance, in the floral sample file, I attached the game score to the game board symbol so that when it was destroyed and recreated, it would reinitialize to 0.
    http://html.adobe.com/edge/animate/showcase.html
    #4: That should be fine.
    Hope that helps answer some of your questions!
    -Elaine

Maybe you are looking for

  • How to modify global variable in a function?

    Hello, I want to modify a globalvariable in a function, at first I did it this way: class Global_output_class GlobalDim("Correlation_Status,fail_part,End_Exp") dim pouet Correlation_Status = 12 Call Correlation() pouet = Correlation_Status Function C

  • Excel 2013 (or 2010) wont recover/repair excel files with sheets with invalid names

    Hi All I have a situation where some legacy software (Crystal Reports) have exported to Excel some problematic workbooks in .xls (in 5.0/95) format. These workbooks have an invalid worksheet name which I have discovered is a known problem with Legacy

  • Thinkpad Edge S430 Core i7 Thunderbolt Device

    I was wondering about the Thunderbolt device as there are no drivers at the support page and even the Solution Center/System Update Utility doesn't recognize the Thunderbolt device. As so it isn't listed in the Windows Device Manager. I made sure tha

  • How do I unsync photos when I have uninstalled itunes?

    I synched some albums onto my ipad with iTunes from PC (Checked "sync photos" and provided paths).  Later, due to computer crashes on PC, uninstalled iTunes. How do I get rid of the photos?

  • Calculate Shared Pool Size

    HI, EBS:12.0.6 DB:10.2.0.3 This is the formula to calculate shared pool size.. minimum share_pool_size = - mp(sp_idx).minvalue - + - (Num_of_CPU * 2MB) + - (Num_of_sessions * 17408) + - (10% of the old shared_pool_size for overhead)from where i can g