Stop and play nested MovieClip problem

I'm doing a falling bomb and the effect of the explosion. I created bomb1 with a nested motion tween and then I created bomb2 with explosion effect nested in another deep level inside bomb1. My hope was that when the bomb hit the target down, the movement stops and at the same time, there will be an explosion.  The problem is that I can't do two actions, which happened at the same time, it is blocking the movement completely or have the explosion then the bomb keep going down. I can't do two things happened at the same time.  bomb1. Stop(); must stop the movement down and bomb1.bomb2.gotoAndPlay (31); should make the effect of the explosion. Any idea?


import flash.events.Event;

var bombPlaying: Boolean = true;

this.addEventListener (Event.ENTER_FRAME, handleCollision);

function handleCollision(evt: Event): void {}

If (bomb1.hitTestObject (gLine1)) {}

bomb1. Stop();

bomb1.bomb2.gotoAndPlay (31);

}

}

I had the problem solved. The eventListener would be removed before "bomb1.stop (); bomb1.bomb2.gotoAndPlay (31);

import flash.events.Event;

       

bomb1.gotoAndStop (1);

   

myButton.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler);

   

function fl_MouseClickHandler(event: MouseEvent): void {}

bomb1.gotoAndPlay (1);

this.addEventListener (Event.ENTER_FRAME, handleCollision);

}

function handleCollision(evt: Event): void {}

If (bomb1.hitTestObject (gLine1)) {}

this.removeEventListener (Event.ENTER_FRAME, handleCollision);

bomb1. Stop();

bomb1.bomb2.gotoAndPlay (31);

}

}

Tags: Adobe Animate

Similar Questions

  • Stop and play a sound

    Hi all

    I need to be able to stop and play a flash slide show with mp3 voice via. The stop button works fine, but as soon as I push the game, only the slide show continues. I need to keep the voices and synchronized images.

    All advice is appreciated.

    Thank you

    The first solution solved the problem for me. Thank you.

    The latter sounds like something I would like to deepen further. Any recommended places to learn more about the sound objects?

  • Library CC animate sounds how to tie and how to stop and play?

    Library CC animate sounds how to tie and how to stop and play?

    for example:

    allSounds = ["snd_1", "snd_2"]; ("snd_1" - the name of link)

    myInstance = createjs. Sound.Play(allSounds[0]);

    allSounds = ["snd_1", "snd_2"];

    allInstances = [];

    allSounds.forEach (function (item) {}

    var audioInstance = playSound (item);

    allInstances.push (audioInstance);

    });

  • Agilent 4156 new driver plug-and-play (pulse-installation problem)

    Hello, I am new to Labview and just started using the Agilent 4156 new plug-and-play driver published on 02/12/2008. I try first to set up conditions of STRESS using this project. While I am able to configure most of the things that I need, I can't set the peak pulse value using the program "Set Pulse.vi". The Readme for the driver mentioned that this program has not been tested. The error message is the following:

    Reports of the instrument:
    + 181, "illegal installation. Invalid command. »
    -113, "undefined header."
    + 0, "no error".

    Can someone help me with this problem?

    Thank you.

    Thanks for your reply.

    I think I solved the problem. There are syntax errors in the "set up" Pulse.vi (PUL has been used instead of PULS in two places). He is now able to set the basic and advanced.

    In addition, the way is designed the vi, it will always give an error because he tries to put in tension (possible only when a VIEW is of type V) 'Source' and 'Base' / 'Peak' tensions (only possible when the PGU is a type VPULSE). I removed the parts that I didn't need.

    FYI, I use an Agilent 4156 C. In the configuration screen, the revision of the CPU is 1 and the revision of the software (03.06 HOSTC, CUMS 04.07, ADC 01.00).

  • need help to create a stop and play in AS3 button?

    Hello. I'm using Flash CS5 and our school teacher has asked us to do a simple project for this weekend but I had trouble so I don't know what to do. Want to create a flash animation and use the 2 buttons ch us. The one who stops the animation and the other who will play the animation. So this way the animation plays I can click on stop and then click play at random times and the animation will stop or play.

    I have a layer of buttons with 2 buttons on the same layer. One is called the beginning and the other is called stop. I have a separate layer with a clip that I created a mobile polygon that goes from one side of the screen to the other. After you have created the clip I double clicked on the subject and created my animation in the new viewer who displayed. Now, I clicked on stage 1 and it took back me to my main timeline.

    Finally, I have a layer actions with nothing but code. I made sure to type all my code by clicking on this 1 framework and go click actions. Then I typed in my code. Please note that each layer has only 1 frame that they were all published individually by double me clicking on the object.

    After inserting the code I I go to test the movie but get all these compiler errors. What I am doing wrong? Here is my code and errors that I keep.

    start_btn.addEventListener (MouseEvent.CLICK, startPolygon);

    stop_btn.addEventListener (MouseEvent.CLICK, stopPolygon);

    function startPolygon(e:MouseEvent):void {}

    Polygon.Play ();

    }

    function stopPolygon(e:MouseEvent):void {}

    Polygon.Stop ();

    }

    My mistakes are as follows:

    Scene 1, Layer 'actions', image1, 9 1120 of the polygon of undefined property online access

    Scene 1, Layer 'actions', image1, 15 1120 of the polygon of undefined property online access

    Scene 1, Layer 'actions', frame 1, line 1 1120 access of undefined property start_btn

    Scene 1, Layer 'actions', frame 1, line 5 1120 access of undefined property stop_btn

    in the main scenario where you have your 3 objects, click your stop button.  on the contextual Control Panel affect the instance name, stop_btn.  Click on the play button and in the properties panel, set to stop_btn.  Finally, click on your polygon, and in the properties panel, set the polygon.

  • Help to add music, stop and play buttons

    Hey

    I need help, I have my video mp3 audio and fact my game and stop button. IM using cs4 and as3. I want to have the game and stop on my main page button, but still have the piece of music when the user clicks on a button that takes them to a new page. So if someone could show me what to do, that would be much appreciated!

    Thank you

    assign a class to your mp3, instantiate with the 'new' constructor and the method of reading to your sound instance:

    var s:YourSoundClass = new YourSoundClass();

    var sc:SoundChannel=s.play();

    When you want to stop your sound, use:

    TCI Stop();

  • Start button / stop and display are the problem with my system (hp pavilion dv6 6116tx)

    We will give you any one (engineer) to come here and solve the problem.

    It's peer to peer forum, where users of the HP product help each other to solve problems.

    If you are really looking for a HP engineer contact HP by telephone.

  • Nested Movieclip problem

    Hi all

    I have a movieclip within a movieclip. And inside this second movieclip, I have another mc with active buttonmODE.

    The target is a mvoieclip and a movieclip inside.

    If I click on the button of the second target movieclip then needs to be displayed.

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at InteractiveHomeDesign_sample3_fla::MainTimeline/frame1()

    Please someone has the solution for this?

    Thanks in advance.

    1009 error indicates that one of the objects targeted by your code are out of reach.  This may mean that the object...

    -is declared but not instantiated

    n ' is not have an instance name (or the name of the instance is misspelled)

    n ' is not in the frame where this code tries to talk to her

    -is animated in place, but is not assigned the name of the instances of each keyframe for her

    -is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).

    If you go to your section to publish the Flash settings and select permit debugging option, your error message should have a suite of line number the number of the frame that will help you to isolate the object that is involved.

  • MovieClip - problem with instance.play () & stop()

    Hello, I'm trying to start and stop a simple animation.  I made a circle, converted to a MovieClip symbol named 'circle' and move it using an interpolation.  He stops and plays when I pass the "stop()" and "play()" or "this.stop ()" or "this.play ()" orders, but neither when I use "circle.play ()" or "circle.stop ()".

    I tried "insert the target path" and through "this.circle" but it still does not work.

    Any suggestions?

    If you named the movieclip 'circle', but you animate it in its parent timeline, then the circle itself has nothing to play.   It's Crafty why play() and stop() work because these are the commands for the timeline in which you put the code.   The circle movieclip should contain the interpolation of chronology, not be placed in it.

  • How to record and play Audio

    Hello

    I want a code example to learn how to record audio and play audio recorded

    Can anyone help me regarding this?

    Thank you

    Pounet

    Try this code, it works for me.

    To record the audio. Note that this code records audio in the device memory. Just change the url to save the code in the sd card.

    try {}
    Reader = Manager.createPlayer ("capture://audio?encoding=amr");
    Player.Realize ();
                
    RC = (RecordControl) player.getControl ("RecordControl");
    BT = new ByteArrayOutputStream();
    rc.setRecordStream (bt);
    FC = (FileConnection)Connector.open("file:///store/home/user/RecordedFiles/audio1.amr");
    {if (!) FC. Exists())}
    FC. Create();
    }
    OT = fc.openDataOutputStream ();
    rc.setRecordStream (ot);
    rc.startRecord ();
    Player.Start ();

    } catch (Exception e) {}
    e.printStackTrace ();
    }

    To stop and play the audio. Copy the following code,

    try {}
    RC.Commit ();
                
    data = bt.toByteArray ();
    BT. Close();
    Player.Close ();
              
                
    BI = new ByteArrayInputStream (data);
                
                
    Player = Manager.createPlayer (bi, "audio/amr");

    Player.Realize ();

    Player.Start ();

    } catch (Exception e) {}
    e.printStackTrace ();
    }

  • In fact, I have problem in adding music to be played across all folios, the problem happened when I simply lock the ipad and open it, the publication is always open and I can browse, but the music stops and cann't continue. How can I solve this t

    In fact, I have problem in adding music to be played across all folios, the problem happened when I simply lock the ipad and open it, the publication is always open and I can browse, but the music stops and cann't continue. How can I solve this problem to continue after the opening of the ipad and continue to navigate the digital publication.

    The background sound plays only if the application is open. Once the device is locked or the user switches to another application the audio will stop.

  • YouTube functionality will not work continually, constantly stopping to recharge and play short stretches

    Whenever I have the clock on the You tube function, he played 4 seconds, then stops, charge and play another 4 seconds. No continuity.

    Hello

    1. is this issue occurs with any other website?
    2. were you able to access the site before without any problem?
    3. don't you make changes to the computer?
    4. you use Internet Explorer or third-party browser to access youtube?

    I suggest you check out the link if you use internet explore below
    Problems playing the videos by using Internet Explorer
    http://support.Microsoft.com/kb/2532294

  • no desktop background and dcom shutdown and plug-and-play stop messages

    For about a month now, I have had no splash screen. I'll have to use the Task Manager to actually use my pc that is not too much a problem just annoying really, but then for the past days, windows has been close specifying a stop plug-and-play message or dcom. I went in administrative tools and services and tried to fix it but didn't work. I'm completely computer illiterate, so if someone can help please be understanding with your answer and use plain English please!

    Hi nikkianddave

    Have you installed new software until you have encountered the problem of funds? Since then, did you install any new updates MS or applications? Is updated your Anti Virus?

    Try these steps and check:

    Step 1: Perform a clean boot and see if the problem persists.

    Step 2: Try to start the DCOM Server process Launcher service & Plug-and-Play.

    Please follow the instructions below and the service that precedes the value Automatic.

    1) click the Start button and in the search box, type in: Services.msc

    2) press "Enter" to open the Services window.

    (3) find a list of related services above and verify the status and Startup Type.

    4) double-click the service to change the status of started and set the startup type to automatic.

    Step 3: For the desktop no problem you can try to set the default value for the parameter of the windows interface:

    Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. How to back up and restore the registry in Windows

    In the Windows registry (open 'regedit') and go to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\winlogon\

    Set variable "Shell" = "Explorer.exe" without the quotes.

    Also refer to:

    http://social.technet.Microsoft.com/forums/en-us/itprovistadesktopui/thread/638effda-C124-4920-80fd-6dbbab0880bf/

    After back and let us know if it helped to solve your problem.

    Thank you and best regards,

    R uma - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • [Solved] HL-DT-ST DVDRAM GT20L periph. CdRom SATA has a driver problem. The driver faces a problem of Plug-and-Play device.

    Recently, I noticed that my CD/DVD stopped working. He turns, but nothing happens; the disc is not read.
    I use Windows 7 Home Premium 64 - bit on an HP Touchsmart tx2z.

    I ran the Microsoft FixIt program through http://support.microsoft.com/kb/982116 and it has identified the following problem: 'HL-DT-ST DVDRAM GT20L periph. CdRom SATA has a driver problem. The driver faces a problem of Plug-and-Play device. »

    However, FixIt said that he was unable to solve the problem and discs are still read.

    I manually uninstalled the driver in Device Manager and then scanned for the hardware changes. The driver was reinstalled, but with the same problems as before.

    Any ideas?

    Thank you!

    Also, try following the steps for Windows Vista, which should also work in Windows 7, in the MS KB article:

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

    These measures, to remove the UpperFilters and LowerFilters, values if they exist, in the registry key named can help.

    Create a System Restore Point beforehand and restart the computer later.

  • Problem with non-plug-and-play drivers.

    I need assistance with drivers Non-Plug and Play, Null, for a Windows 7 Professional 32-bit SP1, I find the Question, no answer to the problem. In the Device Manager, on the driver tab: status is stopped and does not start. And on the general tab: device status is: this device is not present... Bonneau, Bonneau, bla (Code 24). someone Pleazzzzzzee help me, lolol

    Hello Thomas,.

    Welcome to the Microsoft Community Forum.

    1. Which device you are trying to connect to the computer?
    2. You did no particular change in the computer?
    3. A device that has a code 24 in Device Manager?

    Code 24 indicates that the device is not present or is not working properly, or does not all its drivers installed.

    If the error code reappears, check that the device is properly connected to your computer. For example, remember that all the cables are correctly installed, or that the cards are properly housed in their locations.

    See the article: error codes in the Device Manager in Windows

    http://support.Microsoft.com/kb/310123/en-us

    Also try to update the drivers for the device.

    See the article: automatically get recommended drivers and updates for your hardware

    http://Windows.Microsoft.com/en-us/Windows7/automatically-get-recommended-drivers-and-updates-for-your-hardware

    Please respond to this answer, we will be happy to help you.

    Thank you.

Maybe you are looking for

  • Satellite Pro L40 with a motherboard dead

    Hello I have a L40 Pro of the Satellite with a dead motherboard.I just got a second hand one out of ebay, who was supposed to work. I connected the components of the etc., heat sink, processor, old wireless card.When I turn it on the led and the proc

  • Problem in installing the bluetooth driver

    I have a laptop of model 15-e038tx, the driver bluetooth recommend windows8 is Ralink rt3290-01. This driver is not available in the HP driver package, and any other driver Bluetooth does not work. Is there any need of parameters to change or no driv

  • Computer laptop Chromebook does not connect to the printer HP Officejet Pro 8610 range

    Hello! I have a few problems with the connection from my laptop to my printer to print documents! I have connected my printer to my wireless network, but do not understand how to connect my laptop to the printer! I don't have a disk drive with which

  • Power Manager - battery maintenance does it really work?

    I use a CTO E525. Since owning, almost 3 years now, I never had a message advising me when the thresholds have changed. If you don't have already figured it this out it's regarding the "optimize maximum life of the battery (change automatically for m

  • Error: Settings.rc (access is denied)

    Hi experts, I installed BB JDE 4.6.1. on my other PC with jdk 1.6.0_14. The problem is that whenever I have restart my system and re - start JDE and try to build any application, it gives an error java.io.FileNotFoundException: C:\Program Research In