What am I doing wrong with the visibility _ property?

I have an object that is a clip, and I want this object to disappear when you click on him, but also the button that makes the object appears to be also subject to disappear. Anyway, when you click on the object or on the button for the second time, the same object to disappear.  I managed to do it, but the first time when you click the button to display the object it doesn't work, you have to click twice. What I am doing wrong? The object, it's a clip named frez1, and the button is named fr1. I put this code in the main scenario: for the clip: frez1.onPress = function() {_root.frez1.gotoAndStop (2);}                                      _root.frez1.gotoAndStop (1);                                           } button: frez1._visible = false;                                     FR1.onRelease = function() {frez1._visible =! frez1._visible;}                              } Button and the object are on different layers.  Thank you for your help.

The first thing you can do is avoid the unnecessary use of _root references.  If the code is in the scenario where the object exists, there is not need to refer to the timeline (i.e. in this case the _root).

Saying the movieclip to go to box 2 immediately followed up by saying to go to frame 1 will always be in frame 1.

If you want to be able to click the movieclip to make it visible, then you can make invisible because the invisible objects do not interact with a mouse.  You will have to modify its _alpha rather property.  Try to replace all the code show you by what follows and to eliminate the appearance frames of frez1...

frez1._alpha = 0;

function toggleMC() {}

If (frez1._alpha == 0) {}

frez1._alpha = 100;

} else {}

frez1._alpha = 0;

}

}

frez1.onRelease = fr1.onRelease = toggleMC;

Tags: Adobe Animate

Similar Questions

  • What am I doing wrong with this simple table?

    I have a table that I need to add unique characters to slowly.

    If the table is wordToCheck and I have a few "drop places" to check and see if a letter "fell off the coast." An index is assigned to each point of fall and I just want to add the letter to the appropriate index of the table so that I can push in a string.

    This is my code:

    wordToCheck [currentBlank.register] = currentLetter.letter.toLowerCase ();

    So you can see that if 'A' has been abandoned to the empty spot with the 2 register it would return "-a".


    The problem is that it is remove each time that I add a letter. If I put 'A' in the registry and then 2 "M" save 3 it returns '-m '.

    How do it do not replace itself every time?

    1. to the original post: If you use the same instance of table - it shouldn't happen. Looks like whenever you add letter - it's a new instance of the wordToCheck table.

    2. If you want to convert the string table - use Array.join () method.

  • Can someone tell me what I'm doing wrong with C5180

    Thank you for reading my post. I have a Photosmart C5180 all-in-one printer. I do calendars for my children. I have a PC with Windows Vista. I've been printing these for two years using the HP Photosmart Essential software. I am trying to print a picture of 'full page' on 8.5 "x 11" photo paper. I get a message saying that the image size is too large for the paper. I'm going goofy trying to get this image full-size to print. I have done many times before and can't happen now. Any suggestions?

    Thank you very much

    Smurfsdad

    Thanks Matmaria for your suggestion. This does not, as did nothing else I could think of. I think that sort of 'Vista' was behind all this. I was pulling my hair out. Finally, I downloaded an updated version of the Photosmart Essentials and it allows me to do what I was trying to do. Thank you again... Smurfsdad

  • What am I doing wrong with this idea of menu?

    Hi team,

    I am trying to build a menu but have two problems, as you can see on the vid when I press one of my button fly, closing at all (which could be authorized)

    Quen worst is that even if I have the names of instance for all the steps and the target tool allows you to find the path to these buttons, I can't access it from the main timeline.

    Here's the code...

    import flash.events.MouseEvent;

    import flash.display.MovieClip;

    GSmain.gsshape.gss1.gssr1.addEventListener (MouseEvent.CLICK, page2go);

    function page2go(e:MouseEvent) {}

    gotoAndStop (2);

    }

    and the error...

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

    to aavar / frame1 () [aavar::frame1:4]

    aavar is the document class associated with this file

    If

    GSmain.gsshape.gss1.gssr1.addEventListener (MouseEvent.CLICK, page2go);

    is frame 1/4, GSmain.gsshape.gss1.gssr1 does not exist when this code runs.

    you have also nested named functions which is always problematic:

    function whatever() {}

    function whatevernested() {}

    }

    }

    should be

    function whatever() {}

    }

    function nolongernested() {}

    }

  • What am I doing wrong with this loop?

    It drives me crazy! I am trying to create 100 triangles, like a little challenge for me, in random positions.

    import flash.display.MovieClip;

    addEventListener (MouseEvent.CLICK, 100Tri)

    function 100Tri() {}

    for (var i: int = 0; i > 100; i ++ ;)) {}

    var positonX:int = Math.random () * 550;

    var positonY:int = Math.random () * 400;

    var triangle: MovieClip = new Triangles();

    triangle.x = positionX;

    triangle.y = PositionY;

    addChild (triangle)

    }

    But he returned as a constantly

    Scene 1, Layer 'AS', frame 1, line 21084: syntax error: expected rightparen before sorting.
    Scene 1, Layer 'AS', frame 1, line 31084: syntax error: expecting identifier before 100.

    There is a class named 'Triangles', which is related to a movieclip of a triangle. It contains nothing, but what is in all classes.

    Help? I'm sure it's just a little thing miss me, but its annoying me. >. <

    Hello

    There are a few stupid errors in your code. Use it below:

    import flash.display.MovieClip;

    stage.addEventListener (MouseEvent.CLICK, triangles)

    function triangles(e:MouseEvent)

    {

    trace ("click handler")

    for (var i: int = 0; i > 100; i ++)

    {

    var positonX:int = Math.random () * 550;

    var positonY:int = Math.random () * 400;

    var triangle: MovieClip = new tri();

    triangle.x = positonX;

    triangle.y = positonY;

    addChild (triangle)

    }

    }

    Kind regards

    Vipul

  • A few days, I bought a mac mini which I transferred the data and programs with time machine: programs have been updated except for iMovie, and now it seems that I have to pay for the update: possible? What I am doing wrong?

    A few days ago, I bought a mac mini and I transferred all my data and programs with time machine: all programs have been updated but iMovie (7.1.4)... However, it seems that, to update to the latest version, I have to pay to download on Appstore: is it possible? what I am doing wrong?

    If it were a new mac mini, you need already installed 10.1 iMovie.  Otherwise, but you already have iMovie 9 registered version to your Apple ID, you can upgrade to version 10 for free, but if (as it appears) is an earlier version then you have to buy version 10.

    Geoff.

  • Help! I did a movie with pictures on Movie Maker, played very well. Now, it's just to show Xs red in the photos of some, but not all. What I am doing wrong?

    I did a movie with pictures on Movie Maker and played very well.  Now, it's just to show Xs red in the photos of some, but not all.  What I am doing wrong?

    When you save your project, and then rename, move or delete a photo next time you open your project, you will see a red X where the photo was. Just a click with the right button on the X and select Remove then import your photo again under the new name or location and click on save project on the file menu.

    In the menu task under finished film click Save to my computer tracking instructions and your project will be saved as a movie.

  • I created a 'film' in Windows Movie Maker with audio. I'm now trying to burn on a DVD in windows DVD creation, but the program will change the order of my photos. What I am doing wrong?

    I took pictures of a Picasa folder and created a "slideshow" with audio in Windows Movie Maker. It's over, but when I try and save it to a dvd using windows DVD create, change the order of my photos are randomly. Am I missing a setting? What I am doing wrong?

    It may be interesting to try to publish (Save) project in the. Film WMV
    format in a folder on your hard drive. Then import them. WMV file in
    Creating Windows DVD.

    Windows Vista - publish a movie in Windows Movie Maker
    http://Windows.Microsoft.com/en-us/Windows-Vista/publish-a-movie-in-Windows-Movie-Maker

    Movie Maker Vista - Edition
    http://www.Papajohn.org/Vista-publishing.html

  • I got a Apple Watch yesterday and since put in place and paired him and everything, but now I can not unlock it or look at anything on the watch because it won't let me.  Any ideas as to what is wrong or what I am doing wrong?

    I got a Apple Watch yesterday and since put in place and paired him and everything, but now I can not unlock it or look at anything on the watch because it won't let me.  Any ideas as to what is wrong or what I am doing wrong?

    Hello

    If you have not already done so, it could be that you want to configure your watch with these settings:

    -On your iPhone, in the application of Eve, go to: My Watch (tab) > General > detection of wrist - it lights up.

    -On your iPhone, in the application of Eve, go to: Watch My > password > code turn on (choose a password Simple or more complex).

    -Also on the password settings screen, select Unlock with iPhone.

    After putting on your wrist, your watch don't unlock then after whatever you do first: unlock your watch manually (by entering the access code) or unlock your iPhone.

    Then, it will remain unlocked (including when the screen is idle) until you remove it from your wrist. When you remove your watch, it locks automatically.

    More information:

    https://help.Apple.com/watch/#/apd748b87e2a

  • I have type in a new web site in the address bar. Press enter, nothing happens? Went to internet expl. ORER and tried. It worked. Uninstalled Mozilla twice. reinstalled. Still, the address bar does not go to the new site. What I am doing wrong?

    I type in a new web site in the address bar. Press ENTER. Wait. Wait. type in the same new website in the search bar. It goes straight. Uninstalled Mozilla twice. Reinstalled. Tried to go to a new web site. you press on enter. Nothing. What I am doing wrong? I tried this procedure in Internet Explorer and the new address was excluded.

    Hi markehrmann,

    I'll try from Firefox Firefox to solve the issues in Safe Mode. If you do not have the issue so that all your modules, extensions, and themes are disabled, you can try adding them in one by one until you find the culprit. You should look at the guide to troubleshooting Extensions and themes and article troubleshooting issues with plugins like Flash or Java to solve common Firefox problems as well.

    Hope this helps!

  • My Airport Extreme is connected to a cable modem from Arris Surfboard, overtime, I try to set up it tells me that I am not connected to the Internet if I use a router TP - Link AC1750 can I connect is not my ISP. What I am doing wrong?

    I followed the instructions on how to set up my Airport Extreme, but he says that I am not connected to the internet.

    I can connect with a wireless router TP-Link is not a problem with my service provider. I want to connect with my Airport Extreme.

    What I am doing wrong?

    What exact model of the modem Arris do you have? Is your service provider Internet Cox, by chance?

  • The attached VI works when I run it initially to create the XML file, but by pressing once the XML file is created, it is not up-to-date. What I am doing wrong?

    The attached VI works when I run it initially to create the XML file, but when I change the data and run once the XML file is created, it is not updated with new data. What I am doing wrong?

    Thank you.

    It sounds like the logic that has been written in VI

    Internal decision of true / false:

    (file exists: false) write in the file XML, unflatten for display

    (file exists: true) read the XML file, unflatten for display

    At no time when the file exists (true case) is the XML file updated...

  • The short films that I do in Windows Movie Maker fail to run after about 1 minute, regardless of the format, I save in (WMV or AVI) any ideas why or what I am doing wrong?

    The short films that I do in Windows Movie Maker fail to run after about 1 minute, regardless of the format, I save in (WMV or AVI) any ideas why or what I am doing wrong?

    I'm just looking to add the opening titles to the pieces of film of aprox 3 Germans, but everytime I try and save files for uploading to Youtube, then fail shortly after a minute. The sound and picture freeze while the counter continues until the end of the file.

    am driven crazy by this so any advice would be welcome...

    Hello

    My friend John Papa - MVP - is the expert on Windows Movie Maker.

    PapaJohn.org
    http://Papajohn.org/

    PapaJohn - online tutorials
    http://www.Papajohn.org/mm2-online-tutorials.html

    Windows Movie Maker Tutorials - see the menu on the left and others on the main screen.
    http://www.windowsmoviemakers.NET/tutorials/

    Windows Live Movie Maker Forums are good sources of information:

    Windows Live Movie Maker that works on Vista and Windows 7, see the link under Windows Live Essentials.
    http://windowslivehelp.com/

    Windows Live - Movie Maker Portal - official support Site - see also the Forums of the right part of the page
    http://windowslivehelp.com/product.aspx?ProductID=5

    ====================

    These might help:

    Getting started with Windows Movie Maker

    Import video, photos and audio on Windows Movie Maker

    Import video from a videotape

    Get a movie in Windows Movie Maker

    Make a movie quickly in Windows Movie Maker (AutoMovie)

    Publish a movie in Windows Movie Maker

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • get the ora-01830, but cannot say what I'm doing wrong

    Hi, Oracle 11g R2.

    Could someone help me understand what I'm doing wrong in following select clause? I'm trying to convert the difference in seconds to hh.

    ISN.snapshot_ts and iobd.bd_handshake_ts are TIMESTAMP (6) WITH ZONE SCHEDULE

    Select to_date ((to_date (to_char (isn. )))) snapshot_ts , 'HH24:MI:SS DD/MM/YYYY'), ' MM/DD/YYYY HH24:MI:SS')

    - to_date (to_char (iobd. )) bd_handshake_ts , 'MM/DD/YYYY HH24:MI:SS'), 'MM/DD/YYYY HH24:MI:SS'))*60*60*24, 'sssss')

    Hello

    Back-and-forth conversion as

    TO_DATE (to_char)

    are almost never necessary in Oracle.  There are a lot of built-in functions and features that make everything you need more simply.

    If you subtract one TIMESTAMP on the other, the result is an INTERVAL DAY TO SECOND.

    If you view an INTERVAL DAY TO SECOND, it is formatted as

    + 00:01:10.879000 000000000

    which is what you want.  In fact, it's what you want and then some others, which can be a problem for you.  If you are certain that the difference will be less than 24 hours, you can display the number of days in the beginning, and you're neither to display fractions of a second at the end.  In this case, you can convert the INTERVAL DAY TO SECOND string and then use SUBSTR (or similar) to get exactly the parts you want.

    Try something like:

    SELECT isn.snapshot_ts - iobd.bd.handshake_ts AS diff

    ...

    If this isn't what you want (or close enough) then after a small example of data (CREATE TABLE and INSERT statements) and the accurate results you want from these sample data.

    Check out the Forum FAQ: Re: 2. How can I ask a question on the forums?

  • I'm trying to export multi-channel audio as apple pro res 422 HQ, but the tracks are all coming full joint rather than separately. I've implemented the multi Channel sequence already. What I am doing wrong?

    I'm trying to export multi-channel audio as apple pro res 422 HQ, but the tracks are all coming full joint rather than separately. I've implemented the multi Channel sequence already. What I am doing wrong?

    All 4 titles are coming as complete blends not divisions. I guess that's a problem with the entrenchment of the channels, but can't see how to fix. Andy

    Is what would you say to my quick thought without following through all the processes after the fact, the sequence settings? My thought is that the sequence settings must be multichannel as you show, but each Adaptive track, so this channel map is routed at your leisure. If this is not the case, already, it would create a new sequence with these settings.

    I try to upload the photo

Maybe you are looking for

  • HP Envy 4520: HP Envy 4520 power Angle

    I just got a new HP Envy 4520 but am find all results to be printing out at an angle so that from the top of the right-hand page is greater than the left of 2mm. I thought the paper could feed into a corner and I looked at the paper in the tray and t

  • HP Photosmart 7520 prints not the initernet more

    I installed a new keyboard and wireless Logitech mouse.  Since then, it seems that my HP 7520 does not print copy (letters and numbers) I copy / paste of the internet.  I am running Vistas on my desk.  This seems to happen if I go in through AOL or e

  • Lock shift.

    I can access Num Lock to caps lock shift. I can then switch between upper and lower case and the tone changes... for 5 minutes only. 5 minutes, I can switch between upper and lower case, but the tone disappears. The sound of the music remains. I can

  • &lt; qnx &gt; and &lt; application &gt;

    Hi all. In any doc available app is described with node . But when I use a such descripeion so that debugging adl throws an error, and it is normal because it is unclear which is the node. What should I do to use instead usual AIR Thank you in advanc

  • signal does not

    I have a sheet declared in my QML file, which has the id "splashscreen. When my application is performing a calculation task intensive, I signal of working(). I have this code attached to the main element of my QML file: onCreationCompleted: {}_encry