Drag and drop the game. splice method does not work on the table

Hello

I have a drag and drop game. You listen a sound for 'bread' peculiarities, you switch to slide that mc in a box. If it's the right object I want to delete as mc and splice table so it isn't select this object more.

However I notice two things.

When I splice (0) a specific item - so nothing works.

When I connect the indexed element cuurent IE: the last element to get right - it is not actually delete it table.

I highlighted the parts of key code.

private function placeBubbles (): void
{
var nextX:int = 0;
for each (var: bubble in bubbles)
{
bubble.buttonMode = bubble.useHandCursor = true;
bubble.addEventListener (MouseEvent.MOUSE_DOWN, dragHandler);
bubble.addEventListener (MouseEvent.MOUSE_UP, checkDrag);
Bubble.x = 0 + nextX;
Bubble.y = 300;
nextX += 100;

addChild (bubble);
}
nextGameRound();
}

private function nextGameRound (): void
{
currentIndexArray = int (Math.random () * bubbles.length);
currentBubble bubbles = [currentIndexArray];

currentBubble.playSound ();
}

private void checkDrag(e:MouseEvent)
{
e.currentTarget.stopDrag ();
If (this.currentBubble.hitTestObject (this.box))
{
If (currentBubble & & currentBubble == e.currentTarget)
{
currentBubble.visible = false;
trace ("Right");
Bubbles.splice (currentIndexArray);
Bubbles.splice (0);

trace (Bubbles);
nextGameRound();
soundCorrect.play)
}
}
on the other
{

TweenLite.to (e.currentTarget, 1, {x: xIni, y: yIni, ease:Strong.easeOut, onComplete:onFinishTween}) ;// - If you want something happens on the ending of tween - good idea while children must wait})

}
nextGameRound();
}

the splice() method accepts two arguments.  the first is the index of the item to delete (start) and the 2nd argument is the number of elements to remove.  in your situation, you should use:

Bubbles.splice(currentIndexArray,1);

Tags: Adobe Animate

Similar Questions

  • Windows7 - in the My Pictures folder-need to sort the photos manually - drag and drop used to be how does not work now.

    ....

    Thank you for visiting the Microsoft answers community.

    The change in Windows 7 is to design, but if you think this is something that you want changed, please submit your suggestion on the Microsoft Connect site for your comments.

    Lisa
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I have problems with gmail with firefox. Refreshing page is slow; Drag and drop files in email sometimes do not work.

    My problem is mainly associated with gmail. When I click on return to the Inbox after reading a mail, it takes a good few seconds while in the past, it was always instant.

    My other problem is drag them / move the files as an attachment in gmail. Sometimes it won't work and I have to use the manual icon attaches trombone. However, if I restart firefox and re - connect to gmail, it will work again.

    I also noticed that when you drag an image in the mail window, it will not become an attachment, but it will appear instead. Is there a way where I can choose to have inserted images as attachments rather than displayed in the mail?

    Thanks for any advice you can give me.

    Hi Guigs2,

    Thanks for your advice. I'm not sure what will happen if I change my profile. I'm afraid I'll be somebody else for those who know me.

    So I decided to try the second option on the plugin check. After I clicked on the link the message says that my version of firefox is not the last. I've updated it and so far I don't have drag and drop the problem but we will give it some time and see. This problem does not occur all the time but it happened a few times, so I guess I should try it for a while.

    Thanks a lot for your advice

  • Drag and drop the game - add your comments

    Hello

    I created drag and drop the game:

    If the player, drag the object to the correct target - snapping to the target, else it returns to the original location.

    My question:

    I want to add sound (such as feedback) when hanging to the right target.

    What should I write in the code?

    Help, please

    Thank you (-):

    (I added the code and the printscreen)

    star.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

    function fl_ClickToDrag(event:MouseEvent):void

    {

    star.startDrag ();

    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

    function fl_ReleaseToDrop(event:MouseEvent):void

    {

    If (star.hitTestPoint (targetstar.x, targetstar.y))

    {

    Star.x = targetstar.x;

    Star.y = targetstar.y;

    }

    else {}

    Star.x = 692;

    Star.y = 232;

    }

    star.stopDrag ();

    }

    square.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

    function fl_ClickToDrag_2(event:MouseEvent):void

    {

    square.startDrag ();

    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

    function fl_ReleaseToDrop_2(event:MouseEvent):void

    {

    If (square.hitTestPoint (targetsquare.x, targetsquare.y))

    {

    Square.x = targetsquare.x;

    Square.y = targetsquare.y;

    }

    else {}

    Square.x = 122;

    Square.y = 266;

    }

    square.stopDrag ();

    }

    create your sound (using the new construction), then apply the play() method to make the sound when your hitTestPoint is real.

  • I've lost the ability to copy files on my CD player. When I drag and drop, the only authorized action is 'move' and it does not work.

    I've lost the ability to copy files on my CD player.  When I drag and drop, the only authorized action is 'move' and it does not work.   I tried press and hold the CTRL key while dragging, and when I do that all the other disks show "copy" as the default action, but when I hover over the action CD player available only changes to 'pass '.   I ran the Microsoft Troubleshooting tool for CD/DVD players and he said that the media were not writable, but there is a blank CD in the drive.  Any ideas on how to solve this problem?

    Thanks, but the cd/dvd drive works well - I can burn a cd with windows media player for example.  the problem is that I can't copy files to it.   I can play CDs (haven't checked the DVD).  I can not do and could do before, is doing drag and drop files on it.  The only authorized action is "move".   This happens even when I click CTRL + do drag.   I can copy it to any other player, but the CD player, and when I hover over the "exemplary" drive CD goes to 'move '.

    have you tried using a different suite of cd/dvd burning?

    Imageburn is free and easy to use: http://download.imgburn.com/SetupImgBurn_2.5.7.0.exe

    There may be something to play with your access keys if you have a (ie., wirekeys)

  • codesnippent createjs equivalent of flash as3 drag and drop the code snippet

    AS3 deafult code snippent for drag and drop

    circle.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag_3);

    function fl_ClickToDrag_3(event:MouseEvent):void

    {

    circle.startDrag ();

    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop_3);

    function fl_ReleaseToDrop_3(event:MouseEvent):void

    {

    circle.stopDrag ();

    }

    I just tried to convert this code createjs. but my code does not

    / * js

    var t1 = this;

    {circle.addEventListener ('mousedown', function (e)}

    {stage.addEventListener ('stagemousemove', function (e)}

    T1.x = stage.mouseX;

    T2.y = stage.mouseY;

    });

    {stage.addEventListener ('stagemouseup', function (e)}

    e.target.removeAllEventListeners ();

    });

    });

    */

    are you trying to drag and drop the circle?  If so,.

    var tl = this;

    tl.circle.addEventListener ("mousedown", downF)

    function downF (e) {}

    stage.addEventListener ('stagemousemove', moveF);

    stage.addEventListener ('stagemouseup', upF);

    };

    function upF (e) {}

    stage.removeAllEventListeners ();

    }

    function moveF (e) {}

    TL. Circle.x = stage.mouseX;

    TL. Circle.y = stage.mouseY;

    }

  • I am now on iOS 9.2 Game Center still does not work. When I open the app it freezes on a blank page. When I open the Game Center in the settings, it freezes and then crashes. Please Apple can solve this problem of Game Center iOS 9.2.

    I am on iOS 9.2 and Game Center still does not work. When I open the app it freezes on a blank page. When I open the Game Center in the Middle it hangs just. For this reason, I can't back up my data on my games. Please Apple can solve this problem of iOS 9.2.

    Hello Vaishnav,

    Thank you for using communities of Apple Support.

    I see that you are having problems with Game Center on your iPhone. I have a number of things for you to try.

    First force quit Game Center.

    1. Press the Home button twice quickly. You will see small glimpses of your applications recently used.
    2. Swipe to the left to find the Game Center app to close.
    3. Swipe up on the preview of the Game Center to close.

    Force an app to close the iOS

    If this does not work, then the next step would be a restoration. I recommend restore like new, without backup restore and everything first. If it works there, you can restore the backup.

    Use iTunes to restore your iPhone, iPad or iPod to factory settings

    Best regards.

  • Why creates shortcuts for Moving files when drag and drop the folder or file in another folder?

    I am using Windows XP SP3, just before I drag and drop the file into another folder in my windows explore. Suddenly, he is creating shortcuts for moving file. I'm not able to move the file by drag / move the mouse, it is possible that by cutting and Paste(Ctrl+X) using the keyboard. Why?

    Maybe your 'Alt' key is stuck.
    See exchanging the keyboard with another makes all the difference.

    HTH,
    JW

  • The Stream.play () method does not work why?

    I want to create an application to switch streams and republish them under continuous flow unique to the remote server.

    In the first step, I tested "Livestream code" of the "Multipoint publishing example" p. 184 of "FLASHMEDIA SERVER 4.5 Developer's Guide ADOBE®" If ns.publish method is used. He managed.

    I try stream.play method now.

    I wrote main.asc code as in the Stream.play example (p. 162) of the 'the ACTIONSCRIPT Language Reference® to ADOBE® FLASH® MEDIASERVER 4.5 server-side", but I have a certain problem despite this.

    I try to spread on my local server (Uri - "localhost/studia") by two customers - OUT and my request for "Livestream" accordingly (with stream name "livestream2") and retraslate it to a remote server by using my "studia" on a local application.

    The connection between two servers (with application "on-line") appears in the Remote Server Admin Consol, but the flow of my local server do not come to her.

    Here's my main.asc script:

    application.myRemoteConn = new NetConnection();

    application.myRemoteConn.onStatus = {function (info)}

    trace ("Connect" + info.code + "\n");

    Respond to all customers

    for (var i = 0; i < application.clients.length; i ++) {}

    application.clients [i]. Call ("onServerStatus", null, info.code, info.description);

    }

    };

    Connect use NetConnection object remote server (the remote server works with other application wery well)

    application.myRemoteConn.connect ("rtmp://RemoteServer/live");

    Estimate of the server data flow

    application.myStream = Stream.get ("livestream");

    application.myStream = Stream.get ("livestream");

    If {(application.myStream)

    application.myStream.play ("livestream2", 0, -1, true, application.myRemoteConn);

    }

    The Stream.play () method does not work why?

    What I've done wrong?

    In this case, I recommend a mixture of solution...

    Something like that will be interesting to check:

    var tempSwitchingStream = Stream.get ("myswitchingstream"); create a stream live temp on the server local app...

    tempSwitchingStream.play (livestream1, 0, -1);      Subscribe to tempSwitching to livestream1... That is to say get the content of livestream1 in there... I can also switch to different streams inside... tempSwitchingStream will get the contents of the stream of //switched

    If (tempSwitchingStream) / / if there is

    {

    NS. Attach (tempSwitchingStream);  Subscribe to my net workflow to receive data from tempSwitchingStream

    NS. Publish (livestream, "live");  now flows net is get data from tempSwitchingStream, so publishing those data with the name "livestream" on the connection to the network... NET already know its NetConnection... See above

    }

    Did you get the point? I created a temporary stream that can pass the stream in its method of game and then I push this temporary stream to a remote server...

    However, it is tricky... Majorly, in most cases similar to yours, people write applications on the application of remote server to get the stream and he spend the pull in play method as described in the first method discussed...

  • I bought Illustrator for a month, but when you try to run the application, it asks me to 'renew subscription '. I have tried reloading illustrator twice and reloaded CreativeCloud but it still does not work. What else can I try? I immediately need to HAVE

    I bought Illustrator for a month, but when you try to run the application, it asks me to 'renew subscription '. I have tried reloading illustrator twice and reloaded CreativeCloud but it still does not work. What else can I try? I need immediately GOT to work

    Log, activation, or connection errors. CS5.5 and later versions

    Mylenium

  • HP5610 All in One Printer and for some reason any fax does not work

    * - Original title - the printer does not properly

    I have a HP5610 All in One Printer and for some reason any fax does not work.  What could be the problem?  I don't have the CD installation disc.

    Hello

    To provide a proper resolution, I would need more information on your side.

    1. what operating system is installed?

    2. don't you make changes to the computer before this problem?

    We can refer to this article and check if that helps.

    Unable to send or receive Fax: http://h10025.www1.hp.com/ewfrf/wc/document?cc=us&lc=en&docname=c01670485

    You can also ask your question in the Forums of HP Support (scanning, fax and copy): http://h30434.www3.hp.com/t5/Scanning-Faxing-and-Copying/bd-p/Scan

    Thank you.

  • My computer sometimes suddenly restart after disk defragmentation and applied restore.it system still does not work. Can someone help me? : ()

    I need help on my computer, it's a window Vista Home Basic. Sometimes my computer rebooted or encountered problem blue screen. Is it related to my anti virus program or any hardware or software failure? I try to solve it, Defrag disk and system restore, but it still does not work.

    Do you have an antivirus installed? Otherwise download, update and scan with this

    http://www.Microsoft.com/security_essentials/

    Follow these steps

    http://support.Microsoft.com/kb/929135

    and this

    1. Open an elevated command prompt. To do this, click Start, click principally made programs,Accessories, right-click guest, and then click run as administrator. If you are prompted for an administrator password or a confirmation, type the password, or click allow.

    Type the following command and press ENTER:

    sfc/scannow

  • No aero effect. I have a hidden partition on my HARD drive and my clone of samsung software does not work.

    Hello

    I used tune up utility (now uninstalled) and can no longer apply themes - I have try the effect Aero troubleshooting but convenience store says it cannot identify a problem. How can I get Aero goes again?

    2. I am trying to clone my HARD drive through of an SSD, but I have a hidden partition on my HARD drive and my clone of samsung software does not work. Any thoughts on how to work around this problem?

    Original title: two issues with win 7 Home premium

    Hello

    I used tune up utility (now uninstalled) and can no longer apply themes - I have try the effect Aero troubleshooting but convenience store says it cannot identify a problem. How can I get Aero goes again?

    2. I am trying to clone my HARD drive through of an SSD, but I have a hidden partition on my HARD drive and my clone of samsung software does not work. Any thoughts on how to work around this problem?

    1. with respect to the first question: your system files have been corrupted. Do a System Restore before the app was used.

    Try you "tune up", "maximize", "registry cleaners" or any what kind of app that promises to improve the performance of your PC somehow. None of them improve anything, often at the antipodes (as you discovered). Microsoft W7 already has all the apps. you need to keep your PC in tip-top condt. Try not to add anything.

    All these various named apps. are all 'snake oil' and very dangerous to use. However, you will find a lot of 'logic' online promo. material from "authoritarian" sites as to how will be beneficial for your PC. Not drawn in by these Advertorials :)

    2 the hidden partition is probably "restore to factory condt." partition rescue/recovery of the manufacturer of your computer. This can be used for the rescue of PC when things diabolically wrong with your operating system and cannot be set by any other means. You need an ISO image (clone) of the OS partition and MBR (master boot record) only, not the entire HARD drive.  Including the partition of relief are a very good idea but I'm not familiar with the software cloning you use.

    Download Macrium Reflect free edition for purposes of cloning and recovery and make the CD

    image recovery disk. He advises you to do so (by steps in the simple wizard driven) before using the program for anything regardless of whether the image.

    What computer brand and model you are using?

  • I got a message from paypal saying that my plan has expired. I tried to renew my subscription and update my details however it does not work. What should I do?

    I got a message from paypal saying that my plan has expired. I tried to renew my subscription and update my details however it does not work. What should I do?

    A few changes/Verify account https://forums.adobe.com/thread/1465499 links that can help

    -Credit card https://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting-cr creative - cloud.html

    or

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • My creative cloud crashed trying to update; There is no option to quit or even force them to leave; and try to reinstall or uninstall does not work as it considers its still running. Please advise?

    My creative cloud crashed trying to update; There is no option to quit or even force them to leave; and try to reinstall or uninstall does not work as it considers its still running. Please advise?

    Please see I get an error code 81 when I try to install creative cloud.  Help!

Maybe you are looking for

  • Satellite A660 - does not start

    My Satellite A660 rebooted a few times and then it turned off and now it will not start at all, and register there even the packed power connected. It does not work, any help would be appreciated

  • Error 116 when a string of binary file reading

    I try to use the 'writing on a binary' and "binary file reading" pair of VI to write a string to a binary file and read it again.  The file is created successfully and a hex editor confirms that the file contains what is expected (a header + chain). 

  • How to disable the administrator password

    Need to know how to disable the adminastrator password

  • SOAP packs - which generates them?

    I have a WinXP SP3 system connected to a WRT610N router via a wired connection 100Mbps. Once the PC is turned on it begins to send SOAP packets to the router. The router seems to be send back those packages which are marked as Bad Checksum. The numbe

  • Porting Qt for Qnx Momentics application

    Hey, I wanted to know if its possible to transfer my Qt to the Qnx Momentics IDE application. I search everywhere to search to find the documentation or instuctions on how but cannot find information porting of Qt Creator Basically, that's what I I c