Statements of target event JavaScript mouse: [MovieClip (name = null)]

I'm trying to get the name of the object that ended the mouse
I have:

function myFunc(e) {
alert (e.target);
}
this.myObject.addEventListener("mouseover", myFunc.bind(this));

instead of return myObject returns [MovieClip(name=null)]
I disabled mouseChildren myObject

Yes, canvas mode does not have the property name for a reason any. This has been discussed here:

Animate CC/Createjs properties of the clips/instances/bitmaps are null

Tags: Adobe Animate

Similar Questions

  • movieClip name inside the Variable

    What is the problem with this part of my code?

    I am trying to use a variable (which will eventually be linked to a table, but not baby in AS3) to House a movieClip name and then use this variable in tweens, filters and others.

    //

    glowColor var = "0xFFFFFF";

    var glowAlpha is. 75;

    var glowBlurX = 25;

    var glowBlurY = 25;

    var glowStrength = 2;

    var glowQuality = 2;

    var glowInner = false;

    var glowKnockout = false;

    //

    var mcName = "mcUnitedStates."


    mcWorldMapBottom.this [mcName] .filters = [new GlowFilter (glowColor, glowAlpha, glowBlurX, glowBlurY, glowStrength, glowQuality, glowInner, glo wKnockout)];

    I get an error:
    1084: syntax error: expecting identifier before that.

    You don't want to throw a he in the middle.  I don't know what the rest of the script implies, but it may be that just you:

    mcWorldMapBottom [mcName] .filters =...

  • variable in a movieclip name

    Hello, being a beginner I am still getting the syntax rules ACEs... could someone help, please?

    1. I have a variable called "num" that has a different value (1 to 6) the chronology of the scene repeats itself every time

    NUM = Number (random (6) + 1);

    2 here, I would like to use the "num" value in a movieclip name (number of 'container' must change according to the value of "num")

    unevariable = 1 _mc.cont 1 _txt container;

    How can I use the value 'no' inside the names of movieclip ( 1 in the example above replacement)?


    :

  • target the properties of the mouse event: ROLL_OVER, MOUSE: DOWN

    Hi - I'm targeting the States of the button IE: ROLL_OVER is interpolated a bit bigger.

    So I want to go back to its original size.

    BUT it is not recognizing the start and reverse methods.

    Scene 1, Layer "layer 2", 1 environment, Line 60 1061: call to a method maybe not defined in advance through a reference with static type gs:TweenLite.»

    button.addEventListener (MouseEvent.ROLL_OVER, rollOverHandler, false, 0, true);
    button.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler, false, 0, true);
    button.addEventListener (Event.MOUSE_UP, mouseUpHandler);
    button.addEventListener (MouseEvent.ROLL_OUT, rollOutHandler, false, 0, true);

    var myTween:TweenLite = new TweenLite(button,1,{scaleX:1.05,scaleY:1.05,onComplete:myReverseFunction});)

    function rollOverHandler(e:MouseEvent):void

    {

    TweenLite.to (button, 1, {scaleX:1.05, scaleY: 1.05, ease:Elastic.easeOut});})

    myTween.start ();

    }

    function myReverseFunction (): void

    {

    myTween.reverse ();

    }

    There is no such method 'start' to TweenLite, because it starts immediately. If you want to reverse the Tween when it has finished the easiest is to use "yoyo" in TweenMax. (Although you can use onComplete so if you want to).

  • Targeting of confusion with movieclips as buttons

    I have a layer on my main timeline with 14 clips including instance names: button_1 button_14 and a layer beneath them called overlay_mc which covers the entire scene.

    When I run the following code, I get the result listed on the low extreme when I mouse over the buttons. My questions are the following:

    (1) why do a hand on the overlay_mc as well as the buttons cursor?

    (2) why the overlay_mc seems to have an EventListener registered for it?

    (3) why doesn't the gotoAndPlay() methods not fire on any of the movieclips even though the EventListeners seems to recognize them?

    (4) why my tracks make a reference to an instance name (for example: instance489) instead of instance names I have provided?

    Help, please!

    var numberOfButtons:int = 14;

    function initializeButtons (): void {}
    for (var i: int = 1; i < = numberOfButtons; i ++) {}
    var buttonName:String = "button_" + i;
    trace (ButtonName);
    [buttonName] buttonMode = true;
    [buttonName] useHandCursor = true;
    [buttonName] addEventListener(MouseEvent.MOUSE_OUT,mouseOut,false,0,true);
    [buttonName] addEventListener(MouseEvent.MOUSE_OVER,mouseOver,false,0,true);
    [buttonName] addEventListener(MouseEvent.MOUSE_DOWN,mouseDown,false,0,true);
    }
    }

    initializeButtons();

    function mouseOut(event:MouseEvent):void {}
    event.target.gotoAndPlay ("Up");
    }
    function mouseOver(event:MouseEvent):void {}
    trace (Event.currentTarget);
    trace (Event.Target.Name);
    event.target.gotoAndPlay ("Over");
    }
    function mouseDown(event:MouseEvent):void {}
    event.target.gotoAndPlay ("Down");
    }

    --------------------------------- Output------------------------------------------------

    button_1
    button_2
    button_3
    button_4
    button_5
    button_6
    button_7
    button_8
    button_9
    button_10
    button_11
    button_12
    button_13
    button_14
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance529
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance477
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance481
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance489
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance489
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance489
    [object MainTimeline]
    overlay_mc
    [object MainTimeline]
    instance529
    [object MainTimeline]
    overlay_mc

    AS3 can not use strings to reference objects.  using the scoring table to convert strings into objects worked in as2, but in as3 the method used to convert strings into objects is getChildByName().  you get a child of the parent by default which is the movieclip which the timeline is on stage when you enter this code in the Panel shares.  It is the same as

    this.getChildByName (buttonName).

    the other code, MovieClip(), is used to help the flash compiler, struggling to remember the fact that this.getChildByName (buttonName) is, in fact, a movieclip.  the compiler can generate an error if you do not throw this object as something that can have its active buttonMode.  so, which casts the object as a clip that I could do it because of the title of your son.

  • How to manage the events of mouse in Flash? What exactly "this" qualifies?

    Hi, I have problems with mouse (working in HTML5 Canvas) events I hope someone here can explain a few things.

    First of all, can someone explain what exactly "this" means? What I've read, it seems that 'this' refers to the current timeline that you are in, when you type the code?

    -------

    in any case, my problem, is that I have some nested clips I want to control (start, stop) with mouse Rollover events and using the code below, the parent layer seems to work, but I can't find a way to get a 'child' movieClip to use this code (and works). There are no tutorials on what I can find on this subject, so any help would be very appreciated.



    This.Stop ();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    This.on ("rollover", fl_MouseOverHandler_32);

    function fl_MouseOverHandler_32()

    {

    This.Play ();

    stage.enableMouseOver (0);

    }

    use:

    var tl = this;

    TL. Stop();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    TL.on ("rollover", fl_MouseOverHandler_32, NULL, true);

    function fl_MouseOverHandler_32()

    {

    TL. Play();

    stage.enableMouseOver (0);

    }

    child mc

    var rl = this;

    RL. Stop();

    frequency of var = 3;

    stage.enableMouseOver (frequency);

    rl.clickCatcher.on ("rollover", fl_MouseOverHandler_16, null, true);

    function fl_MouseOverHandler_16()

    {

    rl.gotoAndPlay (328);

    stage.enableMouseOver (0);

    }

  • 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.

  • Dynamically create a movieclip name

    I have a series of small clips (about 100 of them, cannot be created when running) already exists in my main movie.
    These were name of A1 A100. I have to refer to one of these clips according to a calculated value to run from 1 to 100. I don't want to use a switch & case statement, because there would be too many of them.
    How do I create a movieclip variable in AS and assign one of the existing movieclips as the real object?
    For example, I tried:
    var MCobj:MovieClip = 'A' + calculatedNumber;
    But this does not create a valid reference to the existing MC. Any ideas?
    Thank you

    use array notation to help solve your chain in a flash movieclip:

  • The events of mouse in the EVENT structure FAKE FIRE? Buffer Clear?

    Hi people,

    Nothing too complicated here.

    I uses a structure of the EVENT to capture keyboard events, or the mouse to operator custom popups.

    The problem is that about 1 in 10 times, if I program for several popups in a row, sometimes they trigger inputs with random Ghost and never appear to the user.

    I tried the search for keyboard trick to the top and "mouse up" instead of "mouse down". But it didn't stop him completely. It seemed to improve.

    I like to either,

    A. the problem

    B. disable the keyboard / mouse buffer before starting.

    Thanks in advance.

    PS. NOR is delayed to avoid creating popups operator more and better. I had to just get off my chest.

    The response was:

    The shot came from me hitting Ctrl-R to run the VI. When I published the letter 'R', the first VI seen as a sequence of keys and shot.

    DOH!

  • MovieClip name variable

    I have only one scene with MovieClips using secondary scenes. Inside the image, I have a MovieClip that contains the Menu "buttons"(MovieClips agissant comme deles de boutons). "»

    Since the Menu buttons, I'm trying to access frame labels inside of the "slips" who live at the same level as the MovieClip Menu. Menu and Slide 1,2,3 are all brothers and sisters.

    I'll put 'Slovak' in the Menu when the user clicks on a button I would like to pass the path of the slide label.

    I can get things hardcoded a name of coding, but I can't understand how to move the stored variable.

    For more convenience, the value of the Slovak var is a string containing the exact name of the slide.

    Here's the code to work:

    MovieClip (this.parent.getChildByName ("Slide3")) .gotoAndPlay ("slide_out");

    I need:

    MovieClip (this.parent.getChildByName (VARIABLE VALUE)) .gotoAndPlay ("slide_out");

    How can I pass the variable here?

    Thanks in advance.

    I don't understand what the problem is. To use a variable instead of a string, you just put the name of the variable in place of the string.

    MovieClip (this.parent.getChildByName (Slovak)) .gotoAndPlay ("slide_out");

  • If the State shows red and javascript script does not

    I am just learning Javascript and I can't believe, I have problems with that simple statement, but alas I am.

    Any help would be appreciated.

    The script is a script of learning:

    JavaScript document

    var crust = prompt ("what kind of crust do you want - thin or regular?'");

    If (== crust "thin"). (crust is 'regular')) {

    var cheese is prompt ("choose your cheese?");.

    {Switch (Cheese)}

    case "mozarella":

    case 'feta ':

    "parmesan" case

    case "cheddar":

    break;

    by default:

    Alert ("sorry we not that kind of cheese.");

    break;

    }

    } else {}

    Alert ("sorry we don't serve that kind of crust here.'");

    }

    Line no 4 and 19 shows red and the script does not run.  Help, please.  I created a similar script with numbers and it works fine but as soon as I put channels in I get errors.

    I tried to rewrite these lines so many times in so many different ways.

    I use Dreamweaver CC 2015, I Am studying an old version of Javascript?

    Any help would be appreciated.

    Thank you

    Try to run your code through this online validation tool.

    JavaScript - http://www.jslint.com/



    Nancy O.

  • 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

  • getChildByName - access to an instance of movieclip name inside

    It works:

    layerMenu.duplicateMov (LHolder.L1Holder, layerMenu.getChildByName ("layer1"));

    It does not work:

    layerMenu.duplicateMov (LHolder.L1Holder, layerMenu.getChildByName ("layer1"). L0Dup);

    L0Dup is an instance name of the movieclip inside the getChildByName ("layer1")

    Clues for a workaround?


    Thus, flash can't you boxes can be an object of class displayobjectparent.  If any other potoential questions I listed in message 3 do not apply, use:

    layerMenu.duplicateMov (LHolder.L1Holder, Box (layerMenu.getChildByName ("layer1")) .getChildByName ("L0Dup"));

  • State and target infrastructure grid

    Hello

    What is the difference between the target and the State?

    Sometimes, if the resource has shutdowned, target shows offline but State shows online. That we look?


    $ crs_stat -t
    
    oracle@green ~]$ crsstat
    
       Resource                          Target     State
    -----------                          ------     -----
    ora.ASM1.asm                          ONLINE     ONLINE 
    ora.LISTENER_GREEN.lsnr               ONLINE     ONLINE 

    Hello

    Maybe, but it depends. You need view the State of retail

    To understand what is happening on the peek at the value of the STATE_DETAILS attribute.

    The system may be busy or Exchange or Exchange or hungry CPU or audits of State CRS are infrequent.

    See how CRS checks the State of the resources? See the CHECK_INTERVAL attribute value.

    How long it takes for the State to get in sync with the target? Compare with CHECK_INTERVAL.

    Kind regards

  • Elements of targeting via javascript... How?

    Here is the code for a navigation menu where only option seems lit at a time (based on the code sent to me by the amazing Jon Fritz II).

    CSS:

    a button0 #, a {#button1

    Display: block;

    float: left;

    Width: 55px;

    height: 67px;

    margin: 0;

    }

    a button0.inactive #.{background: url(/carousel_home.png)-55 0 non-repetition}
    a button0.active #.{background: url(/carousel_home.png) 0 0 non-repetition}
    a button1.inactive #.{background: url(/carousel_vip.png) - 0 non-repetition 55px}
    a button1.active #.{background: url(/carousel_vip.png) 0 0 non-repetition}

    HTML:

    < a href = "#" onclick = "changeClass (this) ' class = 'inactive menu' id = 'button0' > < / has >"

    < a href = "#" onclick = "changeClass (this) ' class = 'inactive menu' id ="button1"> < / a >"

    JSCRIPT:

    < script >

    function changeClass (elClass) {}

    var divsLength = document.getElementsByClassName("menu").length;

    for (i = 0; i < divsLength; i ++) {}

    document.getElementsByClassName ("menu") [i] .className = 'inactive menu ';

    }

    elClass.className = 'active menu ';

    }

    < /script >

    What makes that swap the class of a button clicked (in a menu), returning all the other buttons to their original state, where only 1 button appears "informed" at the same time. The a tags are used as block elements that simply change the background image to produce a State "enlightened" and "off".

    My question is via javascript (or something else), is it possible to change class trigger for buttons in a region outside of the menu? In other words, we can do a link text on the page itself trigger which button in the menu 'light '. Something like < a href = "javascript:slide('div1'); JavaScript: (go turn on button1) "> example < /a >"

    The reason is that this menu is not the ONLY way to go from one section to another. So if I click on a link in another DIV on the same page that takes me to another area, ideally, I would like to see the button that represents the area in the menu nav lights as it is clicked on - even if she didn't. And of course, the other buttons are NOT lit.

    Thank you!

    There is little difference between these two, although it could cause your page suddenly jump to the top (if the link is near the bottom, since the browser will interpret the link null as an anchor named to the top of the page.  The way to resolve this would be like that-

    link

    I prefer this format, but I don't know why.

    For the second problem, change this-

    something

    something2

    on this subject.

    something

    something2

Maybe you are looking for