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.

Tags: Adobe Animate

Similar Questions

  • With the help of text and buttons movieclips as buttons to point to the same layered framework?

    I'll have a terrible time with the 3.0 AS and animating CC 2015.2 in this project.  I was given a suggestion, but now I'm so confused output errors that I hope to get answers from you advanced people.

    The project is similar to this:

    Identify the Structure of the trees

    Framework 1 - nothing selected, visible instructions

    Frame 2 - Select sheets by clicking on the image (tree top or bottom) or text, leaves description becomes visible

    Frame 3 - branches select by clicking on the image (tree top or bottom) or text, description branches becomes visible

    Frame 4 - trunk select by clicking on the image (tree top or bottom) or text, description of trunk becomes visible


    Suggestion is:

    Do the video clip of each region of image tree and drop it on the layer smaller on top with alpha 0%

    Create a badge of the clip, and then tap on timeline with each framework has put in evidence and description

    Make the text button, then tap chronology framework with each has put in evidence and description

    Trunk frame – more small area place top layer

    Branches Frame - smaller than the leaves but superior to the place of the trunk between the two

    Framework of leaves - most square of the area on the layer under the Branches

    Can anyone offer any suggestions?  I used to program 5.5 Flash with Actionscript 2.0, but difficulties with Animate and Actionscript 3.0.  I don't know if I have to use swaps or specific images, but when viewing, he travels all frames without stopping even if each image as the AS command stop ();

    Thanks in advance!


    Rick

    Tree-Example.png

    Yes, if your buttons or movieclips, overlap one on top Gets the default click event. So, if you decide to create separate movieClips or separate buttons, be sure to give everyone an exclusive space.

    One approach I've used in the past for such things is to open the work, the tree in Photoshop then "cut" art into segments and put each segment in a different layer in Photoshop. Then you can import that art directly in to animate and each layer will import under a separate post. Then you can combine them into a movieClip to a work of art on the stage. From there, you can select each segment and each a movieClip or button you want.

  • I just got an iphone and am confused with itunes.  I the have not used in years.  I can I sync my music from itunes to iphone.

    I just got an iphone and am confused with itunes.  I the have not used in years.  I can I sync my music from itunes to iPhone.

    You need a computer that is running the latest iTunes version to either a Mac or Windows operating system.

    Mac

    1. Open iTunes.
    2. In the MenuBar at the top of your computer screen, choose iTunes > check for the updates.
    3. Follow the prompts to install the latest version.

    Windows

    1. Open iTunes.
    2. In the MenuBar at the top of the iTunes window, choose Help > check for updates. Learn what to do If you see not the menu bar.
    3. Follow the prompts to install the latest version.

    Instructions for syncing your iPhone here > synchronize your iPhone, iPad or iPod touch with iTunes on your computer via a USB - Apple Support

  • When I click with the right button of the mouse on videos from facebook it shows no options for me to copy the link and etc.

    When I click with the right button of the mouse on videos from facebook it shows no options for me to copy the link and etc. It only shows the parameters for the flash player. How can I fix?

    You can find the URL of the thumbnail by following these steps:
    In the context menu, choose {inspect element}.
    Now, you can see the URL in the source down (perhaps you click the small arrow to the left of the line of seledted firstly to show).

  • Moving the tabs with the left button of the mouse no longer works! Help please!

    Well, since today, when I try to move/rearrange my tabs on the tab bar, the 'move' tab to copy! So instead of moving, I add another tab with the same Web page. Also I can't add tab for the bookmarks bar or by dragging with the left button of the mouse on it.

    I even tried restarting my computer, my firefox nightly and even rebooted in safe mode. Oh and I have the latest update. If someone has an idea?

    Well after that the next update on every night, the problem has been fixed.

  • Update Firefox 29 I can't access to the sidebar of history with the history button. Any suggestions on how to change this? I tried to customize the toolbar

    Since the last update I can not access the sidebar of history with the history button more. I tried to customize the toolbar and download the Restorer Classic theme. Neither worked help would be appreciated.

    Does it mean that nothing happens when you click the history button and choose View history Sidebar?

    And nothing happens when you click the taskbar button side story provided by classic restaurateur theme?

    What happens when you hold the Ctrl key and press H?

    If none of the works above, restart Firefox with disabled modules and test again. Of course the button provided by the Restorer of classic theme will be temporarily unavailable.

  • the camera shutter sound cannot be silent with the mute button on my phone i 6 s

    the camera shutter sound cannot be silent with the mute button on my phone i 6 s

    Depending on where you purchased your phone, this is not possible, because of legislation in these countries that regulate this feature.

    In all other cases, try to force reboot the phone by holding down the button sleep and home for 10 seconds, until the Apple logo comes back again. You won't lose data, but it can cure some problems after installing new software or applications.

    In the case where this does not work, restore the phone:

    Use iTunes to restore your device iOS to factory settings

  • Firefox v15 and up to cause my computer (MAC OSX 10.8.2) to freeze for about 30 seconds every 15 to 30 seconds and I have to turn it off with the power button

    Firefox v15 and up to cause my computer (MAC OSX 10.8.2) to freeze for about 30 seconds every 15 to 30 seconds and I have to turn it off with the power button. It this causes only after I opened Firefox, my computer works well before the opening of Firefox. I h

    It looks a little like yo maybe has a hardware problem on your computer. have you tried to repair permissions on your hard drive? create a new Firefox profile? Use the Profile Manager to create and delete profiles Firefox

  • By clicking with the right button on something, I accidentally stuck the pictures on a website - I want them back, but may not know how to do

    By clicking with the right button on something, I accidentally blocked the photos to a Web site - want their return but may not know how to do

    This has happened

    Don't know how many times

    == I right click on the images of block a site or something like that.

    Check the image exceptions: Tools > Options > content: Load Images: Exceptions - see the web content, pop-ups, fonts and language settings

    A way to see what images are blocked is to click on the favicon (Site ID icon) on the left side of the address bar and click the button "additional information".
    This will open the Security tab of the window of the Information Page (also accessible via Tools > Page Info).
    Go to the Media of this Page Info window tab.
    Select the first image and scroll though the list with the arrow pointing downwards.
    If an image in the list is grayed out and there is a check mark in the box of block Images of... remove this brand in order to unlock the images from this area.

    See also the problems that cause to not show images and http://kb.mozillazine.org/Images_or_animations_do_not_load

  • replacing the trackpad in 440p with trackpad + track buttons (or keys only) ThinkPad 430

    does anyone know if it is possible to replace the new trackpad without physical buttons on thinkpad 440p with the trackpad + buttons or buttons only (I don't like on the touch button functions)?

    It would be the best final solution to the misconception of the 440p trackpad. !!!

    Thank you

    Piotr

    # It is not possible.

  • Is it possible to connect my Application ' Stop' button with the "Run" button of LabVIEW?

    Problem - one of my clients recently tested my new LabVIEW application and asked how the arrested LabVIEW application can be restarted without clicking on the "Run" (right arrow) button.

    Is possible solution - possible to connect my Application ' Stop' button with the "Run" button of LabVIEW?

    Thank you!

    Barry

    The big problem is in your Acquistion to stop audio event. You run the LabVIEW stop sign which is the equivalent of hitting the Cancel button in the toolbar.  (See contextual help on that).  You can stop the acquisition, but you don't want to stop your LabVIEW program.  You need this case in the event your computer to transition state in a sleep mode when you do not make any purchase.  Then hit the purchase button to start again transitions the machine state in the acquisition.

    In your case of program output, you want really to leave LabVIEW it.  You want to run and stop commands like closing the com port and one of these activeX references.  Then allow it to stop the while loop.  Turn the LabVIEW out outside the loop so that once everything is cleaned, your application may close.  You probably want to wrap this command in a case structure so that if you are in the execution environment, it leaves your application.  But if you are in the development environment, you don't want to cause your LabVIEW environment stop.  Another thing is that right now, you actually have a race condition in the Exit event.  The com port will close first or LabVIEW will come out.  There is no defined order of execution.

    Alternatively, you can have an event to close panel? in this way, you haven't accidentally short circuit all your program by pressing the X key.  You want to capture this event, discard it.  And if you want to not actually closed, did trigger the Exit Program button so that you can gracefully shutdown.

  • When the Admin sign on the office comes to the top, but after that the computer does not respond when the user tries to do anything. There are actually turns off the computer with the power button.

    Original title: user profile

    My administrator user profile does not work properly, but I have a user profile that has activated the parental control that worked well for about a year and yesterday when this user logs on the desktop comes up, but after that the computer does not respond when that user tries to do anything. There are actually turns off the computer with the power button.  I ran a virus scan and spyware scan in my user admin profile and he has not found anything.  I don't know what to check.

    Hello rhunter15,

    There may be a program to interfere with Parental controls so that we can try a few things to see if we can determine the application or program that is causing problems.

    First of all, we run System File Checker to see if you have a corrupt file system.

    • Click Start
    • Click on all programs
    • Click Accessories, and then right-click on the command prompt.
    • Select the Security tab and choose "Run as Administrator"
    • Click on command prompt
    • Type SFC/scannow.

    It will scan and repair any damaged operating system files.

    To determine if there is a program because of a conflict, we recommend that you perform a "clean boot" of the computer. A clean boot is designed to disable programs and services in the background as much as possible. This helps determine which service or program can be the cause of the problem.  For more information about how to perform a clean boot for troubleshooting, click the number below to view the article in the Microsoft Knowledge Base.

    KB 929135 - how to solve a problem of performaing a clean boot in Windows Vista.
    http://support.Microsoft.com/kb/929135

    Once you have finished the clean boot, check again and see if you get the error of parental control.

    If please post again and let us know if that helped pinpoint the problem or if you still need help.

    Thank you

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

  • Questions and Confusion with the game automatic and unable to implement the ReadyBoost for a storage device

    OK, I tried to set up the Readyboost on one of my flash drives and to do this, access the AutoPlay window. I followed several instructions and advice from several Web sites, I tried to click with the right button on the flash drive in the computer menu, but the AutoPlay option does not appear. And when I go to the control panel section and where is automatic playback, the flash player is not registered under the devices section. I also tried to go to the command prompt as administrator by typing "net start shellhwdetection '. However, who told me that this service was already active. Can someone please help me configure AutoPlay to my flash drive so I can set up the ReadyBoost

    OK, I tried to set up the Readyboost on one of my flash drives and to do this, access the AutoPlay window. I followed several instructions and advice from several Web sites, I tried to click with the right button on the flash drive in the computer menu, but the AutoPlay option does not appear. And when I go to the control panel section and where is automatic playback, the flash player is not registered under the devices section. I also tried to go to the command prompt as administrator by typing "net start shellhwdetection '. However, who told me that this service was already active. Can someone please help me configure AutoPlay to my flash drive so I can set up the ReadyBoost

    Hey RayRay43

    You must make sure that the flash player is suitable for readyboost

    read all the information on the setup of readyboost to bleepingcomputer tutorial link below

    http://www.bleepingcomputer.com/tutorials/tutorial136.html

    have a happy holiday season

    Walter, the time zone traveller

  • Confused with methods of loading between HP and the battery Level8technology

    Hi all

    I recently ordered a 12 cell Li-ion battery for my Hp dv9310us replace battery Li - Ion 6 cells aging.

    I have been using hp refill that says that very often unload completely the battery by changing the power to "never" options settings so that the laptop stays on until there is no more energy left. Then recharge it back to 100%.

    I bought my new battery company, Level8technology and on their website under the heading battery care and maintenance, they said that for Li - ion batteries should not be left to discharge less than 20% in the opposite case the cells can fail and recharging must begin once, he gets to that or even before no problem.

    I'm confused, with my new battery only a week.

    Any experience in this?

    Thank you

    MS

    I agree with Hüffer.  I went to not allow your battery less than 20%.

    With the old nickel metal-hydride and even older NiCd batteries, it had to discharge and then recharge.

    Still, I learned that this is not necessary with Li - ion batteries.

  • Extremely confused with the extremely complicated presentation of BlackBerry applications

    Please help me, I'm very confused with the extremely complicated presentation of BlackBerry applications.

    I made an app, the name is "App", I got signed and downloaded the App using the emulator Ripple, with the word 'HelloWorld' signature (password not true of course).

    Now, I do another application, with the name of the App (B) I CAN'T use the same HelloWorld signature password because the emulator Ripple said "Oh, Snap!" Build request failed with the message: [ERROR] error: Code signing request failed because this version of the application or the package has been previously signed. If please increment the version (s) and try to connect again. »

    Now, I don't understand and I am EXTREMELY confused with the presentation of the model of application for Blackberry.

    I should first request, for an another RDK and COMINCO files create a new signature for App B password?

    Or should I just increment the bundle version? the problem is when I tried it on Blackberry server seems to give narrations of error message that the APP ID is already used.

    Okay, I'm officially stuck and I don't know what to do. Can any developer of blackberry here or the official employee blackberry tells me what I need to do?

    Thank you.

    I do not use ripple either but can see what the problem is (nothing to do with the ripple)

    Open your file config.xml for the new project (probably copied 'App A'?)

    In the widget section, change the id to something different, for example com.example.AppB

    Save - reload the ripple and make sure you have the new ID in the Config-> Widget

    All sorted

Maybe you are looking for