Event.Target and nested clips

Hey all,.


Here's my dilemma; I have a bunch of video clips in my main timeline with at least 2 nested clips inside them, MyMc.nested1.nested2 etc.
I gave the top most video clips that rely on the main timeline instance names.
In a document class that I created a private variable typed as an array and placed all these MC names in this table.
I then loop through the length of the array and assigned 2 event for each instance listeners.
Example:

for (var i: uint = 0; i < _activities.length; i ++)
{
_activities [i] .buttonMode = true;
_activities [i] .addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
_activities [i] .addEventListener (MouseEvent.MOUSE_UP, dropIt);
}

in the event pickup() is were my problem seems to be coming.
In the microphone function, I have the following:

event.target.startDrag)

It seems to work, but only on the lowest nested movie clip... nested2
I can use event.target.parent.parent.startDrag () and that seems to work... Except when I place an another movieclip in the second layer of the of the MyMC, if it is accidentally clicked, it will now slide on the stage.
I tried to use event.target.mouseChildren = false, but that doesn't seem to work on the lowest nested object... nested2 as this seems to be one I'm clicking
Is there something that miss me to say, click only the mc at a higher level, and then ignore all nested mc?

Thank you

Try to use: "event.currentTarget" and you can also set 'mouseChildren = false' on the clip you want to move (but what to put in a function init, not the mouse Manager).

Tags: Adobe Animate

Similar Questions

  • Events of mouse and nested clips

    I have a movieclip that contains other clips, but the nested clips do not appear to detect mouse events.

    Through research, I found that only the parent can detect these events, but is there a way to move the parent video clip mouse click to children?

    I want to have a little clip. When you the reversal, it is moving towards the top, and then you should be able to click on other various things about it. When you deploy, he is moving back down.

    If this is not practical, what is the best way to keep a movieclip "attached" to a different scale, and without childing the?

    There should be no problem seen movieclips nested with coding mice which they are responsible, unless the movieclip containing also has mouse coding assigned.

  • How to get event.target/event.currentTarget for HTML 5 canvas for Manager click

    Hello

    I hope that everyone else is doing great.

    I belong to bottom Actionscript and just started on CC Flash HTML 5 Canvas.

    How to get event.target and event.currentTarget in CC Flash for HTML 5 canvas for the click event.
    As we used to do an ACE 3.0

    btn.addEventListener (MouseEvent.CLICK, GB);

    function GB (evt:MouseEvent) {}

    trace ("evt-" + evt.currentTarget); It will let us know the selected target
    }

    For HTML-5

    btn.addEventListener ('click', go.bind (this));

    function GB (evt) {}

    Console.log ("evt-" + evt.? t); What is the correct syntax here?

    }


    Thank you


    Hey guys found the answer to stackoverflow

    It's - evt.target

  • iMovie clips are original media events library after the update v10 and visible events in iMovie, but clips do not appear in iMovie

    I've updated to iMovie 10.  He created a new library.  When you use Show Package Contents, I see events and clips are original media.  When I opened the app, I see the events, but there are clips 0 indicated in each event.  How to recognize the clips?

    Hi there Jeffkant,

    Looks like you have imported content in your new iMovie library, but there is no actual clips showing events you have in your library. I thought there might be a problem with the new library, or something could have damaged the library when the import was made, so I would like to start by creating a new library, once again the disk inside your movies folder:

    iMovie (2013): work with multiple libraries

    If the problem persists with the new library, then I create a new user admin on your computer and see if you can reproduce the problem there.

    OS X El Capitan: set up users on your Mac.

    Let me know how it goes, so we can see what to do next. Thank you for using communities of support from Apple!

  • testbox. Optimization of event.target listener and event name

    Is it possible to get the name of a TextBox of event.target?

    stage.addEventListener (MouseEvent.MOUSE_DOWN, clickHandler);

    function clickHandler(e:Event):void {}

    trace (e.Target.Name);

    }

    out to click on a text box is

    instance1111

    I am creating a clickHandler which takes care of everything by checking the name of which was clicked on instead of adding individual headphones to each object.

    (added)

    Another solution that I thought would be to separate the text and turn it into an object, but I prefer not to do that if it can be helped.

    (question 2)

    I worked on a menu, when you click on something it becomes visible and adds / removes event listeners to each button you change your location.

    Switching between menus causes a noticeable pause, which made me think to spend the 1 Manager of.

    Is there a reason to not just leave the active event listeners?  Even better if I can get the above responded and have 1 single active listener to the menu instead of 30.

    In order to get the name of the event.target text box you need

    Event.Target.parent.parent.Name

    A text box consists of 2 subobjects.

    (added)
    Your comment about having children made me put 2 and 2 together.  Initially, I tried e.target and she came back with TextLine, didn't think about it being a "child" until your comment.

    trace (e.Target); TextLine

    trace (e.Target.parent); Sprite

    trace (e.Target.parent.parent); TLFTextField

  • Select the event inside the nested symbol does not

    It's actually based on a previous thread located here: http://forums.Adobe.com/message/5596353#5596353

    I thought about adding to this thread, but in many ways it deserves it's own separate discussion.

    I used the Zaxist examples and AMULI put in place successful. On a navigation bar located directly in the root.

    Now, the question is the same thing with a menu that is nested inside a symbol.

    In my example, I have a button that when you click on anime a symbol of navigation bar down. This works. Also, the LINK button retains its background color set to black until the user clicks another button in the main navigation bar. OK, he has no other button in this example. So just pretend and believe me, it works.

    Now in the nested clip, there is a similar function I Illustrazione in the compositionReady. Then I added my actions to each of the four buttons inside the symbol navlink nested. The rollover/rollover effects work well. But the click event shows an error. It is basically the same click event in the navigation bar on the root, which does not have an error.

    My code inside the compositionReady is;

    Reset the State of each button

    buttons = {}

    Reset: function() {}

    sym.getSymbol("btnLink").$("back").css ({"opacity": "0"})

    }

    }

    which button?  Zero means no!

    We set this variable to get know e what button

    WB = 0;

    Reset each State buttons Sub

    buttonsub = {}

    Reset: function() {}

    sym.getSymbol("btnCommunication").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnIndividuality").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnCreativity").$("back").css ({"opacity": "0"})

    sym.getSymbol("btnInclusivity").$("back").css ({"opacity": "0"})

    }

    }

    which button?  Zero means no!

    We set this variable to get know e what sub button

    SB = 0;


    I would like to only it where there are two functions. One for all main buttons and the other for all the buttons of the child. This way I can have two buttons stuck to the hover effect when you click them in order. If all goes well, that makes some sense.

    Here is my event click in the button "btnIndividuality" inside the symbol navLink nested:

    buttonsub. Reset();

    sym.getSymbol("btnIndividuality").$("back").css ({opacity: 1})

    SB = 1;

    The other three buttons are basically the same.

    So I tried a number of ideas. Especially goes directly from the stage and drilling down into JQuery. Nope.

    So the Firebug error is 'Javascript error in the event handler. Type of event = 162 item line ' we of edge.2.0.0.min.js. It's this line:

    function (a) {if (a) {if(!this.aSymbolInstances) this.aSymbolInstances = []; this.aSymbolInstances.push (a.getSymbolElement ())}}; Y = Function (a, b, c) {function f (c, b) {if (b.length > = 2 & & typeof b [0] = 'object' & & typeof b [1] = 'object' & & b [1] .Guy! == "onError") {var e; e = d.Event ("onError"); if (g) e.compId = g.getComposition () .compId; e.originalEvent = b [1]; d (doc indicator) .triggerHandler (e)} window.console.log ("Javascript error in the event handler.}} Type of event = "(+a)} var e = this [b [0]], g;" = If (typeof e = "function") if (b.slice (1), a = 'element') return function() {var;

    Why would I get this here and not on the root? What is the correct path to make it all work? If close, but not home right now.

    Files are located in:

    https://www.dropbox.com/s/xlgfeeyam9hyuf3/nested.zip

    Oops! Sorry, without my knowledge, that it was published before it is completed

    (3) thus, using Firebug, you get this when you trigger a click event

    In other words, sym.getSymbol ("btnCommunication"), the first statement in your buttonsub.reset function fails.

    In your mind, sym points to the instance of navLink, parent of the instance of btnCommunication.

    But the buttonsub.reset function is defined in the compositionReady event handler, so when it runs sym points until the symbol of the scene, which has no child symbol instance named btnCommunication. Where the bug.

    Therefore, the context of symbol should be past to the function as a parameter. Set it like this:

    buttonsub = {}

    reset function: ( symClick)

    {

    symClick.getSymbol("btnCommunication").$("back").css ({"opacity": "0"})

    And call it like this:

    buttonsub. Reset ( sym);

    In other words, the formal parameter symClick will receive as the effective setting, this actually sym sym pointing to the instance of navLink.

    Gil

    .

  • Helps the event.target.name

    I'm very green with actionscript and coding in general so please forgive me if I ask you something that sounds super easy.

    Is it possible to take the "event.target.name" value, which in my case would be something like 'SW5005_mc' and change this value.

    I use this value now to tell another clip of gotoAndStop (event.target.name); I have identical to the event.target.name marked images.

    I would like to take the value of event.target.name for example "SW5005_mc" and delete the "_mc" and put a dash between the 'SW' and the '5005.

    for "SW-5005" and then I'd spend it in a text field.

    I don't really know where to start, or if this is possible.

    Thanks for any help or suggestion,

    Chris

    You can use String.indexOf to find the _ and just get everything entered, then use substr and substring for the rest:

    var a: String = event.target.name;
    var b:String = a.substring (0, a.indexOf ("_")); get the front part of the _
    var c:String = b.substr (0.2) + "-" + b.substr (2); Insert a - between the first two characters and the rest
    trace (c);

    SW-5005

  • Buttons and video clips

    I have a number of buttons in a single clip. If I type this code in the movieclip, where there are the buttons it should work?

    Pic2.onRelease = function() {}
    photo_mc.loadPhoto (image [2]);
    picture_num();
    }

    He has not worked for me, don't know if the clip is preventing to be clickable, but the roller on the effect of the buttons works.

    first of all, I would place the code in frame 1 of your document and from there is much easiert to target any nested object, for example. I have a movieclip with 5 buttons, movieclip is called "myMC" and buttons are called "myBut1" at 5. I have them would target the root of this way.

    myMC.myBut1.onRelease = function...
    myMC.myBut2.onRelease = function...

    I don't think there should be a problem with the buttons inside movieclips, but I normally always use movieclips as buttons and not the native flash button object.

  • Why there are graphics and Movie Clip in Flash?

    Where there are graphics and Movie Clip in Flash?

    What is the deference?
    When to choose one of the other?
    It would be simpler if Flash does that Movie Clip (so people are not confusing choose)?

    Thank you!

    Main differences are:

    MovieClip symbols contain their own calendars. That's why they can run animations inside of them that are independent of the main timeline. They are also targeted by actionscript to run the script-driven events, animations, changes, etc.

    Graphic symbols are better used to hold static images images, text or what you create with the drawing tools. Although you can run an animation in them, it should the main timeline to be of the same length to see the full animation. Graphic symbols cannot be targeted by actionscript.

  • event.target.buttonImportIcon ();

    First of all, let me say that I know just enough to be dangerous... so please be nice.

    FYI - I have Acrobat, full paid, more up-to-date version.

    I created a form and in this form, I have several boxes for the insertion of photos. I use the script event.target.buttonImportIcon (); to insert pictures. I am aware that in the free version, only the PDF files may be inserted. However, I have the full version. When the box opens for me to find the picture to be inserted, it takes by default showing only PDF files. I can change it to jpg and browse, but it is heavy, because every time I have to complete this form, I need to send pictures of 12-18 for documentation.

    My question is, is there a way so that the box which opens all to display jpg files? Or at least to show all file extensions? I know that this is not a huge deal, but I do 3 to 5 of these forms per day, with pictures of 12-18 each, so it would be nice not to change the file type, I'm looking at every time.

    Thanks a lot for your help!

    Someone asked more information, so here's a more complete script which can be placed in a folder level JavaScript file:

    var ASGJ_buttonImportIconAll = app.trustedFunction(function (doc, f_name) {
    
        // Get a reference to the specified field
        var f = doc.getField(f_name);
    
        // If the specified field does not exist...
        if (!f) {
    
            app.beginPriv();
            app.alert({
                cMsg: "The specified field [" + f_name + "] does not exist.",
                nIcon: 0,  // Error icon
                nType: 0,  // OK
                cTitle: "Field does not exist"
            });
            app.endPriv();
    
            return;
        }
    
        // If the specified field is not a button...
        if (f.type !== "button") {
    
            app.beginPriv();
            app.alert({
                cMsg: "The specified field [" + f_name + "] is not a button.\r\rField type: " + f.type + "\r\rCannot import icon.",
                nIcon: 0,  // Error icon
                nType: 0,  // OK
                cTitle: "Field is not a button"
            });
            app.endPriv();
    
            return;
        }
    
        // If the button layout is label only...
        if (f.buttonPosition === position.textOnly) {
    
            app.beginPriv();
            app.alert({
                cMsg: "The specified button [" + f_name + "] has a Text-only layout.\r\rCannot import icon.",
                nIcon: 0,  // Error icon
                nType: 0,  // OK
                cTitle: "Button layout is text-only"
            });
            app.endPriv();
    
            return;
        }
    
        // Prompt user to select a file to use as the source for the button icon
        app.beginPriv();
        var oFilespec = app.browseForDoc({
            cFileFilter: 2,
            cWindowTitle: "Select an image"
        });
        app.endPriv();
    
        // Deal with the selected file
        if (typeof oFilespec !== "undefined") {
    
            // Attempt to use the selected file as the source of the button icon
            app.beginPriv();
            var nReturn = f.buttonImportIcon({
                cPath: oFilespec.cPath
            });
            app.endPriv();
    
            switch (nReturn) {
            case -1 :
                app.beginPriv();
                app.alert({
                    cMsg: "The selected file: " + oFilespec.cPath + "\r\rcould not be opened." ,
                    nIcon: 0,  // Error icon
                    nType: 0,  // OK
                    cTitle: "Cannot open selected file"
                });
                app.endPriv();
                break;
            case -2 :
                app.beginPriv();
                app.alert({
                    cMsg: "The selected page is invalid.\r\rCannot import icon.",
                    nIcon: 0,  // Error icon
                    nType: 0,  // OK
                    cTitle: "Selected page invalid"
                });
                app.endPriv();
                break;
            default :
                // Import was successful or user canceled
                // so there's nothing to do
            }
    
        }
    
    });
    

    The function can be called like that in the mouse event to the top of a button:

    ASGJ_buttonImportIconAll(this, event.target.name);
    
  • All share storage iscsi connect same target and volume

    Hi Alls,

    I have openfiler and do 1 iscsi volume share in two ESX hosts with even described as iscsi target.

    So a (first) ESX have dynamic config discover iscsi target and the format of finishing, so ESX block size have new data store come from iscsi.

    Another ESX must sign in with the same ip address of the iscsi target and even target iqn. then discover iscsi and rescan datastore have see the name of name identical to that found on ESX first data store.

    (Note for second ESX is not block format size but rescan HBAS/VMSF found eponymous store data like first ESX)

    Issue.

    1. for iscsi target that have one objective and correspond to a volume on openfiler can operate with 2 ESXs at the same time with the same target?

    2 if not, how to configure shared storage with openfiler that can used data volume on openfiler?

    Kind regards

    Bancha

    Like I said before, vMotion can saturate an uplink, so you will need to keep an eye on it. If you want to perform vMotion on the same vSwitch anyway, I suggest you create a group of separate ports with private IP (e.g. 192.168.x.y) addresses for her and let the two active vmnic for this group of ports allow failover in the event of an uplink failure.

    André

  • Difference between sous-suite and nested sequence?

    What is the difference between the subsequence and nested in first Pro CC 2015 sequence?

    -RK

    Hi guys,.

    With the help of 'Nest' on a selection of elements in a sequence will be 1) create a new sequence in your bin, 2) place the clips selected in the sequence and 3) replace the clips selected by the instance of the nested sequence.

    With the help of 'Do the sous-séquence' on a selection of elements in a sequence 1) will create a new sequence in your tray and 2) place the clips selected in the sequence. However, unlike the 'nest', it does not replace the selected clips. It is a useful option if you want to keep a backup of part of your sequence until you review the part.

  • VIDEO and AUDIO CLIPS not COUPLED in TIMELINE

    I just noticed something in recent weeks, that my audio and video clips become couples in the timeline. But if I press alt + click selects audio and video clips. But a single click selects just the video or audio. I understand that alt + click was chosen, either video or audio to a linked file, it seems now vice versa.

    Can someone explain where I am mistaken here? Is this something to do with track targeting which I am not understand?

    Hi Srukweza,

    Shadreck Rukweza wrote:

    I just noticed something in recent weeks, that my audio and video clips become couples in the timeline. But if I press alt + click selects audio and video clips. But a single click selects just the video or audio. I understand that alt + click was chosen, either video or audio to a linked file, it seems now vice versa.

    Can someone explain where I am mistaken here? Is this something to do with track targeting which I am not understand?

    Looks like you have deselected the selection bound function. Click on the button of the timeline show the screenshot and see if the selection bound has returned.

    Thank you

    Kevin

  • Y at - it another way to get the doc object other than event.target

    I have a situation where event.target returns undefined.

    I have JavaScript in the preSubmit event not firing when you click on the button Save in the workspace. I've been tracking this button across the bridge form called saveXML. The code I ran changes the XML, so I still need to run before a save. I've added a call to run the preSubmit event before the saveXML line. My code has failed because I discovered because when you use event.target in the preSubmit case, it is not defined when it is called from the form bridge code.

    I noticed that the form bridge code itself used event.target. I'm gathering from the comments that the event object is changed by this code for the target child is no longer there. I created a variable at the top and together event.target before where I think that it would be changed. I then used this variable, and it solved my problem.

  • Remove the MovieClip with event.target.content

    Hi everyone please I need your help I have this code and I want to delete baresClip but I cante removeit Please helpme

    var loaderBares:Loader = new Loader();

    loaderBares.unload ();

    loaderBares.load (new URLRequest("negocio/bares.swf"));

    loaderBares.contentLoaderInfo.addEventListener (Event.COMPLETE, loadBares);

    function loadBares(event:Event) {}

    var baresClip:MovieClip = event.target.content;

    baresClip.x =-474;

    baresClip.y = - 135;

    addChild (baresClip);

    baresClip.over1.receta1.addEventListener (MouseEvent.CLICK, prueba);

    function prueba(event:MouseEvent):void {}

    gotoAndStop ("receta1");

    removeChild (baresClip); / * Here is work * /.

    }

    MovieClip (root),.mc_negocio.menu_negocio.btn_botanas.addEventListener (MouseEvent.CLICK, goToBotanas);

    function goToBotanas(event:MouseEvent):void

    {

    removeChild (baresClip);   / * Here is not work * /.

    gotoAndPlay ("botanas");

    }

    Oh, I see what you're doing.  you entered baresClip local loadBares.

    to remedy this, use:

    var baresClip:MovieClip

    var loaderBares:Loader = new Loader();

    loaderBares.unload ();

    loaderBares.load (new URLRequest("negocio/bares.swf"));

    loaderBares.contentLoaderInfo.addEventListener (Event.COMPLETE, s loadBare);

    function loadBares(event:Event) {}

    baresClip = event.target.content;

    baresClip.x =-474;

    baresClip.y = - 135;

    addChild (baresClip);

    baresClip.over1.receta1.addEventListener (MouseEvent.CLICK, prueba);

    function prueba(event:MouseEvent):void {}

    gotoAndStop ("receta1");

    removeChild (baresClip); / * Here is work * /.

    }

    MovieClip (root).mc_negocio.menu_negocio.btn_botanas.addEventListener (ouseEvent.CLICK, goToBotanas M);

    function goToBotanas(event:MouseEvent):void

    {

    removeChild (baresClip);   / * Here is not work * /.

    gotoAndPlay ("botanas");

    }

Maybe you are looking for

  • Firefox can not find server suddenly, no changes

    Firefox is my browser on my iMac that I click on when I want to go on the Internet or in my list of favorites. I did not do anything to say now 'server not found '. Firefox can't find the server at what web address I submitted my Firefox is 19.0, lat

  • Tecra A2 - not do AccuPoint pointing stick work in this model?

    I spilled some water on my keyboard and it has stopped working, I took apart to get out the liquid, but it would not clip back together afterwards so I inserted a keyboard in Tecra S1, that I had to spare in its place. The keyboard is identical to th

  • First episode of the show has been approved. How can I change the category of the show?

    I just realized the 1st category, I chose is not really suited for the show. I remember to choose the categories when I presented the feed. I have to return the stream in order to change the categories? Should I remove this particular episode before

  • Windows XP search error 1068

    I can't reboot my search function of Windows on Windows XP SP3.  I get the error 1068.  I went in administrative tools to try to start it and get the message "the dependency service or group could start." Can someone help me?

  • User profile does not load correctly, the user could not be connected.

    I tried to login to my account to administrator with my correct password and it says "user profile can be connected, user profile does not load correctly ' or something to that effect. Even when I login as a guest and enter my admin password on the u