How can I make a button that presses that the object appears and the second press the object disappear

Hello

I'm quite new to flash programming, and I don't know how I can make a button that will make the object appear and disappear. Up to now, I have this code for calling:

(press)

{

_root.top1.gotoAndStop (2);

_root. Topp.gotoAndStop (2);

_root. MM1.gotoAndStop (2);

_root. M1.gotoAndStop (2);

}

but where I'm stuck.

Thank you for your help

What you can do, it's the object _visible property allows you to appear and disappear, or more correctly, use the _visible property opoosite.  You should not put the code 'on' objects, keep it in the timeline.

If the 'object' is the name of the instance of the object you want to fail over, and then in the code to the timeline you can use...

Object._visible = false;  First, the object is invisible

yourButtonName.onRelease = function() {}

Object._visible =! object._visible;

}

Only one line in the function sets _visible to be opposite of what it currently is.

Tags: Adobe Animate

Similar Questions

  • How can I make a button that will move the mail that I consult to a specific folder?

    I'm moving to Eudora, where I had several buttons that I had added to top to move e-mails in specific folders, such as invoices, orders, Support, etc. I see that I can customize the top bar in Thunderbird, but I can't seem to find a way to make buttons to automate the movement of e-mails in specific folders. Is there a way to do them in this program?

    I think this add-on can do what you want:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/tidybird/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

    Also consider the method of the filters:

    http://KB.mozillazine.org/filters _ (Thunderbird)

  • How can I make a question that the user is able to update and respond again? Thank you.

    I am creating a question that the user can update if it gets its bad to try again. Is this possible and if so, how?

    I gave you a link that explains how to reset a such blade, was it not clear?

  • How can I make three buttons that change color when selected...

    Without that ugly radio button select view on them? We want a part of our form to be a stolight - red, yellow, green color and we want users to be able to click on one of them to indicate green light, red light or put in custody. I did the buttons in Indesign, but I can't figure out how to make buttons come with this feature.

    This is their sole purpose, they do not need values associated with them. Any suggestions would be greatly appreciated.

    As a MouseUp event of the button use this code:

    if (color.equal(event.target.fillColor, color.red)) event.target.fillColor = color.yellow;
    else if (color.equal(event.target.fillColor, color.yellow)) event.target.fillColor = color.green;
    else if (color.equal(event.target.fillColor, color.green)) event.target.fillColor = color.red;
    

    Then manually set the fill in red color and you're ready to go...

  • How can I create a button that will execute some SQL such as UPDATE, DELETE ststements

    Hi all.
    I'm new on ADF.
    I start with this example from oracle
    [http://www.oracle.com/technology/obe/obe11jdev/ps1/ejb/ejb.html]

    My question is how can I make a button that executes sql statements like "set 'name' = last_name employees where employee_id = 111; updated"
    any hint will help you.
    Thank you

    If you are using JPA/EJB then you can write in your session bean method to access the EntityManager and using createNativeQuery to perform the update:
    http://download.Oracle.com/docs/CD/E17477_01/JavaEE/5/API/javax/persistence/EntityManager.html#createNativeQuery (java.lang.String)
    This method will be exposed in your ADF data control and you will be able to drag it to your page.

    If you use ADF BC then you can use the methods of service level AM:
    See 9.7 to 9.9 in the Fusion developer's Guide:
    http://download.Oracle.com/docs/CD/E15523_01/Web.1111/b31974/bcservices.htm#sm0206
    http://download.Oracle.com/docs/CD/E15523_01/Web.1111/b31974/bcadvgen.htm#BABEIFAI

  • How can I make a button "react?

    This is probably a dumb great question, but you know how it is, sometimes, we sit on the answer and still can not find... How can I make a button react to a click? I want just the simple effect of the button changing colors or resembling the user pushed him. Right now, it is all the same old simple button, no matter whether I click on it, you can't really make a difference. How can I give the effect "by pressing the key"? Thank you guys!

    You can choose the image button and then choose from the available image buttons or click on the folder icon when you click the button on the image and choose in the Gallery 6 Captivate.

    A few image buttons change color on hover or onclicked, these effects are predefined in them.

    Or you can change the button on which you work, Properties Panel.

    The message button and cancel on this thread it looks like a transparent button in Captivate with different fill and stroke color, and transparency is also less and with 0 corner radius.

    You will find these optionns, when you click on this button and then click on in the properties panel.

    Thank you.

  • Can I create a button that the copy is a certain test for my Clipboard?

    Can I create a button that the copy is a certain test for my Clipboard?

    For example, when I click the button on the site, then the next time to paste it somewhere, a specific text appears?

    If possible, could someone please explain to me how? =(

    Hi Travis,

    There is no native function to Muse to achieve this goal. However, you can use custom code to achieve this. Please see the following link for the code example: How to copy to the Clipboard in JavaScript?-stack overflow

    Kind regards

    Aish

  • How can I make photoshop usable for users of the guest account?

    How can I make photoshop usable for users of the guest account?

    Hi vinturs,

    · Was there a prompt during the installation of Photoshop in what concerns users?

    · You are unable to use Photoshop in the guest account?

    Any program installed on the computer must also be available to be used by the guest account, unless as otherwise modified during the installation.

  • How can I make my view on my screen the entire page instead of just a part of the page

    How can I make my view on my screen the entire page instead of just a part of the page

    Hello

    This Microsoft Information should help you with your problem:

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-screen-resolution

    See you soon.

  • How can I make a mirror image of my desktop hard drive and copy it to an external hard drive?

    * Original title: Mirror image

    How can I make a mirror image of my desktop hard drive and copy it to an external hard drive? I use Windows 7 Home Premium. Thanks in advance for your help.

    Blessings,

    Thomas

    The "how to Geek" has an excellent guide on how to do it. Check here: http://www.howtogeek.com/howto/4241/how-to-create-a-system-image-in-windows-7/

  • How can I delete a button that appears just to the right of the help link.

    In the blue field just to the right of the gray box that has the file, Edit, View, history, Favorites, tools, and help links is a blue button with a circular logo white. When you click on it it will link to a full site which seems being written East. How can I remove this button? I have a screen shot that shows the key mystery but don't see a way to reach this question

    How to show or hide various toolbars?

    Most toolbars can be shown or hidden according to your needs. To show or hide a toolbar, click an empty section of the band to tabs and check or uncheck it from the context menu.

       Menu Bar: This toolbar at the top of the Firefox window contains the browser menus (File, Edit, Help, etc.). On Windows Vista and 7, the Menu Bar is hidden by default, and its features are contained in the Firefox button. If the Menu Bar is hidden, you can temporarily show it by pressing the Alt key.
    
       Tab Strip: This is where your tabs are displayed. You can't hide it.
       Navigation Toolbar: This toolbar contains your web site navigation buttons, the Location Bar, the Search Bar, the Home button and the Bookmarks button.
       Bookmarks Toolbar: This toolbar contains your Bookmarks Toolbar Folder bookmarks. For more information, see Bookmarks Toolbar - Display your favorite websites at the top of the Firefox window. On new installations of Firefox, the Bookmarks Toolbar is hidden by default.
       Add-on Bar: This toolbar at the bottom of the Firefox window contains buttons associated with your extensions (if they are made available by the add-on developer). See The Add-on Bar gives you quick access to add-on features for more information.
    

    Toolbars - win1
    How to customize or rearrange items on the toolbar?

       Right-click an empty section of the Tab Strip and select Customize.... The Customize Toolbar window opens.
       Change the toolbar items as necessary. For an explanation of what each item does, see Customize navigation buttons like back, home, bookmarks and reload.
           To add an item, drag it from the Customize Toolbar window onto the toolbar where you want it to appear.
           To remove an item, drag it to the Customize Toolbar window.
           To rearrange an item, drag it to the spot where you want it.
       When finished, click Done.
    

    Toolbars - win2

    Try it: experiment with different arrangements. You can always restore the default toolbar settings by clicking on restore the default value defined in the window to customize the toolbar.
    Icon appearance options

    There are additional options to change the appearance of your icons in toolbar at the bottom of the window to customize the toolbar:

       Show: From the Show dropdown menu, you can choose what to display in the toolbars: icons, text, or icons and text together. By default, Firefox shows icons only.
       Use Small Icons: Check this option to make the toolbar smaller.
    

    How can I add additional toolbars?

       Right-click an empty section of the Tab Strip and select Customize.... The Customize Toolbar window opens.
       At the bottom of the Customize Toolbar window, click Add New Toolbar. The New Toolbar window opens.
       In the New Toolbar window, enter a name for your toolbar and click OK.
       Add items to the toolbar as described above. If you don't add any, Firefox won't create your toolbar.
       When you're finished adding items, click Done.
    

    Your new toolbar appears under the Navigation bar.

    Try it: make a new toolbar. You can always remove additional toolbars by clicking on restore default set in the window to customize the toolbar.
    I ran out of toolbars, toolbars or unwanted toolbars that reset itself

  • How can I make my Windows Media scramble to the top of my playlists so that they are not executed in alphebetical order?

    I have a Windows Vista system. How can I make my Windows Media read something other than the alphebetical order music? It is very annoying to listen to the artist even twenty times before it goes to someone else! Help?

    Hello

    It should provide useful information.

    Shuffle and repeat items in Windows Media Player
    http://Windows.Microsoft.com/en-us/Windows7/shuffle-and-repeat-items-in-Windows-Media-Player

    Create or change a regular playlist in Windows Media Player
    http://Windows.Microsoft.com/en-us/Windows7/create-or-change-a-regular-playlist-in-Windows-Media-Player

    I hope this helps.

  • How can u make a mc in this framework the main timeline is on

    How can u do mc change this frame of the main timeline is on?

    For example


    onClipEvent (enterFrame) {}
    If (_root.mc1.hitTest (this) == true) {}
    Play();
    }
    }

    I want as the mc to play the main script not his own screenplay

    Thank you for your time
    Rbr1234

    address thr main scenario as 'this ._parent.

  • How can I make a button in the Muse that inserts bookmarks page, the user is on?

    I want visitors to be able to press a button that inserts bookmarks page in their web browser. Is this possible in Muse? Or do I have to use the third-party code?

    Hello

    As pnoypie suggested, you can use html for this.

    You can directly insert the html code that would create a favorite link on the page or insert the HTML inside the widget button and define States.

    Here is an example:

    http://StackOverflow.com/questions/10033215/add-to-Favorites-button

    Thank you

    Sanjit

  • How can I have a button that will show/hide one area of text and images on the same page?

    I have a page like below:

    4ef3986b768c1642dac40a3eb1d534dc.png

    I want to make sure these 3 buttons display text different under them when they are pressed. How can I achieve this?

    Thank you.

    Hello

    Please try to use the Widget for Composition of ToolTip to achieve this...

    You must customize the trigger as long as the button and you can use the target to insert images or the desired text area.

    You can find it in library of Widgets Panel > composition

    Please let me know in case you need further details on that.

    Concerning

    Vivek

Maybe you are looking for

  • Why can't I burn my recent purchases?

    Ive just bought some new music for Christmas and I can not burn to disc. They are not even give me an option to burn! ??

  • Why Search beginning of Labview VI?

    Hello Given that I deleted a «...» VI \Support directory", originally created during deployment of Teststand, whenever I start LabVIEW 8.6 as a search for several VI is executed. These VI is NOT planned and was initially located in the Support direct

  • DNS error any

    I copy and pasted the exact message, I got as to weather or not it's just my computer, or thing network my mother and I are on a modem/router in shared connetion sometimes does affect my PC and sometimes both not shure what to think relly. Im running

  • TouchSmart 15-4010nr is no LONGER to START - Code BCD error 0xc0000034

    Cannot start Windows 8. I get the BCD 0xc0000034 on a blue screen error code. System Restore does not restore, and I also tried an auto repair in the limited options given to me, nothing helps. Recently I had turned off the dynamic scale in an elevat

  • Lost sound, how do I get it back

    Lost its Windows 7 how I get it back