Need to remove a sprite object when another sprite object hits it

Hello All,
I have a brick class where I have created a rectangle using flash.display.graphics.
I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.
I have another class called ball where I have created a circle with flash.display.graphics.
The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.
the error I get is shown only for the last brick that is created in a for loop.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at grid/ball_movement()// my function in enter frame event
The code I wrote in ENTER_FRAME is
if (Ball.hitTestObject(bricks)) {
removeChild(bricks);
where
var Ball:ball=new ball()
var bricks:brick=new brick()
any help is highly appreciated.
thanks
iceheros

Thanks a lot Kglad for your help. But how can I check for the entire grid, this works but how to detect the hit for all the bricks in my 10X10 grid? It is currently removing only the last brick (element) =100 (10X10) when I form the grid.
Thanks Again
iceheros

Similar Messages

  • Vector Smart Object inside another smart object losing quality after scale

    Hi,
    I have 6 icons created on Illustrator and imported as vector smart objects.
    Then, I select all 6 and create another Smart Object from then.
    If I scale this smart object now, it will loose it´s quality, as if the icons were raster in the first place.
    This was not what happend in in PS CS5.
    It´s a bug or new "feature"?
    Rodrigo C.

    You need to realize that Photoshop renders pixels for the embedded object  then when you scale the smart object layer it scale like and raster layer through interpolation not scaled with vector graphics. Its the way smart object layers work. Hers is a very old thread on the subject
    smart objects pixelized | Adobe Community

  • Smart object within another smart object

    I'm running photoshop cs3.  I created two different smart objects.  Within each of those smart objects, I want to include another smart object.  However, when I update the embedded smart object, only the partent SO is updated, the other SO seems to have a different child.  here is the setup visually:
    canvas -> SO1  -> SO3
    canvas -> SO2  -> SO3
    so when I update SO3 from within SO1, only SO1 is updated - SO2 stays the same.  is there any way to have updates to SO3 affect all its parent SOs?
    thanks

    Bart Cross wrote:
    Smart objects are not really that smart after all. Yes PS uses a version of the original object, not the object itself.
    Furthermore, I would add they they aren't even OBJECTS!
    The very concept of an object is that changing it would affect all instances of that object, no matter where it is included, intended to save development time on complex projects.
    http://en.wikipedia.org/wiki/Object_(computer_science)

  • How to lod Hierarchy from one info object to anothe info object

    Dear Friends,
    I am facing one problem with the loading of hierarchy from one object to another.
    Please find my scenario below.
    We are having 0material with hierarchy.This hierarchy is loading from R/3.We have to load this hierarchy to anothe object by replacing the nodes.So can you guys please suggest how to achieve this.Please let me know if you people are required additional information.
    Thanks in advance.
    Regards
    Madhu

    Hi Madhu,
    By default, you cant use a transformation to load data into the Hierarchy Master data.
    I havent tried it myself, but for you to explore, I'll suggest the below idea.
    Write an ABAP program to download the hierarchy table data from 0material into a flat file.
    Create flat file datasource to upload hierarchy to the other infoobject.
    Put both of them in a process chain and execute one after another.
    Hope this helps. Pls let us know.
    Regards,
    Bijesh

  • The menu navigation on top hides behind embedded video object,when the embedded object is .wmv file

    When you mouseover on the Top Navigation menu. The menu bar hides behind the embedded wmv video object. This issue doesnt happen if the video object embedded is a you tube video and also this page works correctly in IE7

    Lightbox with any other content should work as expected where slideshow will bring the fade effect for all other contents on page.
    Please provide the page link where you see this behavior.
    Thanks,
    Sanjit

  • Need to remove space for a field when displayed in ALV Report

    Hi,
    I have material field of length 18, but the content is only 10 char. I need to remove the extra space when it is displayed on ALV Report.
    Is there any option in ALV field catalogue

    use statement condense.
    condense zmatnr.
    also giv output lenth of alv column as 10.

  • Do I need to remove the application?

    I am working on iPlanet 6.0SP4.Do i need to remove the old application when I redeploy the new one. Because there is also an option called "override" when doing the deployment, what that mean?
    If I didn't remove the application, and redeploy with override option, is it possible that two same classes will be stored in the ldap server with different id

    Hi,
    See when you deploy any ear application it first copy it in "<iAS-install-dir>/ias/JAR" dir and extract all the war/jar modules in it. And after it picks the modules from here and explode in respective directory under "<iAS-install-dir>/ias/APPS or .../APPS/modules". When you say Override modules, it replaces all the old modules having the same name with the new one and then explode them.
    Moreover when you deploy any module it will make entries in LDAP under "Application server/6.0/J2EE-Modules/<war/jar-module-name>" and for each Servlet/JSP/EJB under "Application server/ClassDef/<GUID>".
    So when you redeploy same application again and you don't change the module names then it will overwrite this registry information as the module names and GUID is same (in this case you have to restart iAS). But if you reassemble application using deploytool, then it will create new GUIDs for each components in your app and the second entry will be change in this case.
    Now when ever plugin will send the request for the new app it will read GUID from the "J2EE-Modules/<war/jar-module-name>" node and will send it to the KXS and the KXS will see what class to load after looking at "ClassDef/<GUID>" node.
    If the modules have the same name as original Application, then the old GUID entries in registry are of no use and will make iAS slow only as it reads the whole registry while starting.
    Please feel free to ask further questions.
    Sanjeev,
    Developer Support, Sun ONE Application Server-India.

  • On cleanuing up COM object when using Microsoft.Office.Interop.Excel

    When using Microsoft.Office.Interop.Excel the COM objects that are created by the code must be released using System.Runtime.InteropServices.Marshal.ReleaseComObject().
    Most of the time it's pretty clear when a new COM object is created such as:
    Excel._Application excelApp = null;
    Excel._Workbook wb = null;
    Excel._Worksheet ws = null;
    Excel.Range newRange = null;
    try
    // four COM objects are created below
    excelApp = new Excel.Application();
    wb = excelApp.Workbooks.Add();
    ws = (Excel.Worksheet)wb.Worksheets.Add();
    newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these line of cod create new COM object?
    newRange.Font.Bold = true;
    newRange.Borders.Color = borderColor;
    finally
    if (excelApp != null) Marshal.ReleaseComObject(excelApp)
    if (wb != null) Marshal.ReleaseComObject(wb)
    if (ws != null) Marshal.ReleaseComObject(ws)
    if (newRange != null) Marshal.ReleaseComObject(newRange)
    In the above code I create four COM objects in the first part that need to be released when I'm finished with them. But it's not clear if the other two lines of code create a new COM object or not.  If they do then my code needs to look more
    like this:
    Excel._Application excelApp = null;
    Excel._Workbook wb = null;
    Excel._Worksheet ws = null;
    Excel.Range newRange = null;
    Excel.Font fnt = null;
    Excel.Borders bds = null;
    try
    // four COM objects are created below
    excelApp = new Excel.Application();
    wb = excelApp.Workbooks.Add();
    ws = (Excel.Worksheet)wb.Worksheets.Add();
    newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these line of cod create new COM object?
    fnt = newRange.Font
    fnt.Bold = true;
    bds = new newRange.Borders;
    bds.Color = borderColor;
    finally
    if (excelApp != null) Marshal.ReleaseComObject(excelApp)
    if (wb != null) Marshal.ReleaseComObject(wb)
    if (ws != null) Marshal.ReleaseComObject(ws)
    if (newRange != null) Marshal.ReleaseComObject(newRange)
    if (fnt != null) Marshal.ReleaseComObject(fnt)
    if (bds != null) Marshal.ReleaseComObject(bds)
    How can I tell if getting a property creates a new COM object or not?

    Thank you for your replay but I do understand that the font object is a COM object.  What I'm trying to figure out is if a NEW object is created each time I access the font member of a Range object and if I need to call
    Marshal.ReleaseComObject on the font object after using it.
    Most member object of an object are a single instance and each time you access the member you simply get the pointer to that instance. For example:
    using(DataTable dt = new DataTable("Some Table Name"))
    PropertyCollection ep1 = dt.ExtendedProperties;
    PropertyCollection ep2 = dt.ExtendedProperties;
    if (Object.ReferenceEquals(ep1,ep2)) Console.WriteLine("They are the same object");
    else Console.WriteLine("They are different objects");
    The output will be: They are the same object
    On the other hand this:
    Excel._Application excelApp = new Excel.Application();
    Excel._Workbook wb = excelApp.Workbooks.Add();
    Excel._Worksheet ws = (Excel.Worksheet)wb.Worksheets.Add();
    Excel.Range newRange = (Excel.Range)ws.Range["A1","A30"];
    // do these lines of code create new COM object?
    Excel.Font ef1 = newRange.Font;
    Excel.Font ef2 = newRange.Font;
    if (Object.ReferenceEquals(ef1,ef2)) Consloe.WriteLine("They are the same object");
    else Consloe.WriteLine("They are different objects");
    The output will be: They are different objects
    It looks like each time I access the font member I get a new object.  I suspect that is not the case and what I am getting is two pointers to the same object and the reference counter is incremented by one.
    So really the question is what happens to the font member object of the Range object when the range object is released.  I assume the font member will be released along with the Range object ever if the font object has a reference count greater then
    0.
    If I am correct in my assumption then I can access the font member object as much as I need to without worrying about releasing it.
    I have been reading a lot about working with COM and the need to use Marshal.ReleaseComObject and there does seem to be a lot of disagreement and even confusion on the
    mater about when and if COM objects need to be explicitly released.

  • Drawing a Graphics object on a Graphics object

    Is there anyway to draw a Graphics object on another Graphics object? I'm trying to show 2 screens, side by side, on a Canvas and I'm trying to cheat a little :-P Basically, I want to take half of one screen and half of another and put them on top of each other to form one screen.
    OR is there a way to turn a Graphics object into an Image object?

    I'm not sure if this is what you're after, but you can
    - create an offscreen image using "createImage(int width, int height)" method of a Component , then
    - obtain the graphics context of the offscreen image using "getGraphics()",
    - you can then draw onto the offscreen image using the graphics context.
    hope that helps. =)

  • Using ps trying to remove an object from a picture, following steps but when object is removed area is replaced by another portion of the photo like someones face as opposed to what should normally be in the background

    using PS on a regular computer windows 7 tryng to remove an object from a picture,  following steps in the tutorial however when the object is removed it is replaced by another (unwanted) portion of the photo i.e. someones face  instead of what would have normally been in the background

    Well, we can't know. You have not told us what tools you use and what steps nor provided any screenshots. From your description it simply sounds like you are following some tutorial (which again we know nothing about because you haven't told us which one) and getting things wrong. You need to do much better if you want people to help you.
    Mylenium

  • Removing a single object when multiple objects share the same name?

    The below code uses a for loop to make spheres as in this thread:
    http://forum.java.sun.com/thread.jspa?forumID=21&threadID=320945
    However, the name is always sphere. I have another part of the code that,
    using collision detection, removes a sphere using the tg.removeChild(); command when another sphere (created elsewhere) is
    within a set proximity. But how do I specify which sphere it should remove when they are all called 'sphere'? Can I use a
    object ID to get around this and if so, how?
        public void makeSpheres()
           Color3f lightColour = new Color3f(0.0f, 0.0f, 1.0f);    //Blue light
           Vector3f lightDirection = new Vector3f(4.0f, -7.0f, -12.0f);
           for (int i=0; i==5; i++)
               Sphere sphere = new Sphere(0.25f);
               BoundingSphere bounds = new BoundingSphere(new Point3d( getXCoords(), getYCoords(), getZCoords()), 100.0);
               DirectionalLight light = new DirectionalLight(lightColour, lightDirection);     //Each sphere has a blue light
               light.setInfluencingBounds(bounds);
               TransformGroup tg=new TransformGroup();  //Create new TG
               Transform3D transform=new Transform3D();
               Vector3f vector = new Vector3f(setXCoords(),setYCoords(),setZCoords());  //Set Position
               transform.setTranslation(vector);
               tg.setTransform(transform);            //Add sphere to scenegraph
               tg.addChild(sphere);
               Play2.objRoot.addChild(tg);
           }

    Basically, you get a reference to the object you click on through one of the Pick tools from the Pickfast api. Then you iterate over the scenegraph until you find the object your picktool returned. Then you remove it. Check out the examples at
    https://java3d.dev.java.net/binary-builds.html
    If there are a known finite number of spheres you can keep references to them in a list or a Switch.
    regards

  • Need a way to pass object to another application

    Hello Everyone,
    I need to pass an object from one application to another. I wanted to do that using request.setAttribute(Object) but this works only on RequestDispatcher.forward(URL) method and can be used only within the application you are currently in. It does not work for absolute URLs therefore I cannot go to another application. I also tried response.sendRedirect(URL) but then request object is lost when redirected to another application.
    Any help will be greatly appreciated,
    Thanks in advance,
    Y.M.

    if your two application servers are on the same box,
    then you can get the RequestDispatcher object from
    another ServletContext and then use the
    request.setAttribute() call.
    ServletContext newContext =
    getServletContext().getContext(webApp);
         if( newContext == null )
    throw new IllegalArgumentException("Invalid webApp
    p '"+webApp+"' does not exist.");
    request.setAttribute("myobject", objToPass) ;
    RequestDispatcher dispatcher =
    newContext.getRequestDispatcher(urlToGoTo) ;
    dispatcher.forward(request, response);
    Unfortunately those apps are on different servers ...

  • I need to remove myself as the primary administrator for a CC acount and assign to another administrator. How should I proceed?

    I need to remove myself as the primary administrator for a CC acount and assign to another administrator. How should I proceed?

    adobe forums, only to discover Adobe doesn't allow a primary admin to ever leave. This is rather silly as people leave workplaces, they don't stay for life. An answer in a different forum on this site said one must cancel their adobe account, then start a new one. Though... Adobe doesn't allow a person to cancel their adobe account. It all must be done via Adobe customer service, which has proved non existent. There is no email address to email a request, there is a chat option which claims 24/7 chat however this functionality doesn't seem to work on my new Lenovo computer, current IE explorer running Windows 8.
    Adobe - you really need to sort this out. I have left the work place where I was the Team Administrator some months ago now and now I need to be removed from that workplace account completely. Currently, I still have full access to it, which is not good from a security point of view because if I were a disgruntled ex-employee I could play havoc with my workplaces subscription and access their confidential files stored in the cloud.
    Looking through the Forum, there is a great deal of conversation on this exact point. I'd suggest you answer this one, then create a sticky so people don't keep creating new threads and then see about resolving the issue so that Primary Admins can change in future, and be removed when they leave the workplace.
    Thanks
    Geoff

  • I added your recommended ad ons when upating new Firefox version. I need to remove the "no scripts" plus others. No scripts is screwing up many of my work sites, and some normal things I can not open or download.

    When downloading new version of Firefox, I added recommended ad ons. Need to remove especially "no scripts"

    You can disable or remove Noscript easily, See:
    * https://support.mozilla.org/en-US/kb/Uninstalling%20add-ons

  • Do i need to remove the micro sim card when using home wi fi on ipad2

    do i need to remove the micro sim card from the i pad 2 when using wi fi sat home?

    thank you Ralph may i just ask you if your home wifi network is not working do you then have to actively seek the data connection?i suppose i am asking do you need to choose from a menu ?

Maybe you are looking for