If the current image == 1 dosomething... else (currentFrame == 2) do something else. Does not.

Im having a bit of trouble trying to do a button give me different results depending on which frame the main timeline is on.

I'm trying to get a button to access a link different based on which frame the main scenario is on.  If I'm on the 5 framework it will trace back "4"... It's good but the other frames trace number of the framework and also 4.

Click on button box 2 tracks 1 and 4

on chassis 3 button redraws the 2 and 4

Click on button frame 4 tracks 3 and 4

Click on button frame 5 traces back 4

Thanks for your advice.

function buttonClicked(e:Event):void
{
     if(currentFrame == 2)
     {
          trace("Clicked 1");
     }
     else if(currentFrame == 3)
     {
          trace("Clicked 2");
     }
     else if(currentFrame == 4)
     {
          trace("Clicked 3");
     }
     else (currentFrame == 5)
     {
          trace("Clicked 4");
     }
}

You have an another misstake (currentFrame == 5) do nothing, but it is used for something else. After this trace ("clicked 4"); is simple command

or in other words:

another (currentFrame == 5)
{
trace ("4 click");

}

is equal to

another (currentFrame == 5)

trace ("4 click"); It will always be executeds

Tags: Adobe Animate

Similar Questions

  • trigger events based on the current image of the flash animation

    I have a Director with video qt project where are trigger actions based on specific times in the video (movietime and/or duration). I update this project in order to use flash instead of quicktime video.

    To facilitate the development and coding changes minimal if all goes well, I would like to keep this similar functionality, but I can't figure out how to capture the current image of the flash movie sprite.

    Can anyone help? or provide a workaround solution?

    I can't figure out how to capture the current image of the flash movie sprite.

    You were near. Try one of these:

    put sprite("flash").currentFrame
    -- or
    put sprite("flash").frame
    
  • Dynamic text box to show the current image not workng

    Please could someone help me. I wish that my area of dynamic text to display the current image of roots. I triedthis with no luck

    frameNumberText_txt.text = currentFrame;

    I'm pretty sure that the problem is because the field requires a string value. I'm not sure how to do that heh

    Try...

    frameNumberText_txt.text = String (this.currentFrame);

    This assumes that the textfield object lives on the root timeline.  If that's not solve it, and you get an error message, include the error message in your ad.

  • My editing in Adobe animate CC don't show me the current image, frame rate, or give me playback options.  How can I enable that?

    Hello

    My editing in Adobe animate CC don't show me the current image, frame rate, or give me playback options.  How can I enable that?

    Thanks for any help you can offer. I'm off to work, but you come back tonight.

    Julie

    screenshot.jpg

    Hello

    Can you please scale your system to 100% in the Panel text and see if that helps?

    Thank you!

    Mohan

  • Stop the flv playback when you exit the current image

    I searched countless forums (here and other sites) and have yet to find the solution I'm looking for (if all goes well, if it exists).

    I have an flv file is loaded by the flv playback component.  Everything works except that the video (and audio) continue to play even after you leave the frame on which is the instance of the component.

    I found a solution that stops the audio using: SoundMixer.stopAll ();

    But the video is still streaming and affect the performance of the site.

    I want to stop the audio and video, which means using the: playbackInstance.stop ();

    However, all of the solutions I've met basically say to add the stop function to all buttons that potentially could borrow the framework with the instance of reading.

    This seems completely tedious and bulky, especially because I have visible navigation buttons from my 'main' swf and MULTIPLE instances of reading I have are found within a swf loaded with its own navigation as well.  By the nature of the design, instances of reading will not always be on the scene calling references will probably trigger errors.  Of course, there are ways to do this with conditional statements, etc.  But it just seems like a waste of time.

    Is there a simple way to call playbackInstance.stop () to navigate away from the current image?  An event to listen to?  I forget one obvious answer?

    I really want to think that there is a more elegant solution than adding so much in bulk to each eventHandler for button on my site.

    Add an event listener for the removedfromstage event.

  • Projection Shockwave Flash as v16.0.0.287's plugin check but he updated the current 16.0.0.305 and restart Firefox (v36.0) do not change the situation.

    Shows a check as v16.0.0.287 Shockwave Flash plugin, but it updated the current 16.0.0.305 and restart Firefox (v36.0) do not change the version number or status when rechecking the plugins. Control of Adobe and the Flash Control Panel website confirms 16.0.0.305 is installed. All the solutions to this?

    I noticed in the information in the topic: plugins page under Shockwave Flash, path: line was showing.

    < path: C:\WINDOWS\SysWOW64\Macromed\Flash\NPSWF32_16_0_0_287.dll,C:\WINDOWS\SysWOW64\Macromed\Flash\NPSWF32_16_0_0_305.dll >

    For outdated version 287 .dll file was still there and listed before the current version of 305. I deleted the 287 .dll version and restart Firefox and check the plug-ins again the problem seems to have been resolved.
    Greetings - Spindrift

  • How to create a custom control for a button where the look apply to everyone else but not the Boolean text?

    Hi all

    I would like to create a button custom as a master, so that if I change the look of the master all other buttons are changed.

    I did it with a custom control, such as a 'type strict def' otherwise the look will change , BUT if I do this as a strict type def I can't change the Boolean text more which should be different on each button.

    How to create a master control of a button where the look apply to everyone else but not the Boolean text?

    Steve Chandler wrote:

    I don't think that you can do. I just looked and as I suspected the Boolean property text is read only for strict typedefs, you cannot use the nodes property to change the text.

    As a just solution make it a typedef. When you want to change the open look the typedef and strict rendering, make your changes, then make no strict again. You will need to update the text Boolean yet once for all instances. Kind of pain. This is perhaps something for the exchange of ideas.

    Alternatively, remove Boolean text and replace with legend

  • In my old photoshop, I clicked on the rectangle tool and then left click on image free transform and tilt.  my new photoshop does not allow this.  I tried edit - free transform, but it does not have to be.  What should I do?

    In my old photoshop, I clicked on the rectangle tool and then left click on image free transform and tilt.  My new photoshop does not allow this, I tried edit - free transform as well, and this is also not allowed.  What should I do?

    Thank you Trevor.  Discovered that I tried to tilt the bottom and not a new layer.  All sorted now.

  • I installed the beta version of lightroom 5 when he was 1, it does not open, I installed the current version through creative cloud, it will not open either.

    I installed the beta version of lightroom 5 when he was 1, it does not open, I installed the current version through creative cloud, it will not open either. I tried to delete the preferences.agprefs file, did not help. Lightroom 4 runs normally. I use Windows 8.1

    They said that nothing happens when they begin to LR.  It is a symptom that began with LR 5.5 or whatever the first version which was installed after that, where for me deletion of content but do not delete the folder SLCache, itself, is what worked for me:

    Different things to try are listed here, where the Solution 4 is what worked for me:

    https://helpx.Adobe.com/Lightroom/KB/unable-launch-Lightroom-55.html

  • A friend gave me his iPad 5.1.1 iOS.  I plugged on my desktop to load (I have also 2 iPod Touch from my iTunes library), but the iPad indicates there is no SIMcard (?) and that it does not load.  That pasa?

    A friend gave me his iPad 5.1.1 iOS.  I plugged on my desktop to load (I have also 2 iPod Touch from my iTunes library), but the iPad indicates there is no SIMcard (?) and that it does not load.  That pasa?

    The iPad does not have a SIM card. Most are wifi only.  The USB jack on the side of a machine very likely does not provide enough current to recharge an iPad. Use the power supply provided 2.1 watts (if you have one - if it isn't get a).

  • Running win XP pro sp2 mouse moves, but everything else does not

    Running win XP pro sp2 mouse moves, but everything else does not respond after a certain time. Just started doing this last month. Had Xp for several years without ANY problems at all.

    Hi BobM202,

    1. did you of recent changes on the computer?

    2. you receive an error message?

    3. do you have security software installed on the computer?

    4. are you referring to freezing except office mouse movement?

    It is possible that some third-party programs installed on the computer is causing the problem.

    I suggest that you put the computer in a clean boot state and check if it helps.

    To help resolve the error and other messages, you can start Windows XP by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    See section to learn more about how to clean boot.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    (a) click Start, type msconfig in the search box and press ENTER.

    (b) If you are prompted for an administrator password or for confirmation, type your password or click on continue.

    (c) under the general tab, click the Normal startup option, and then click OK.

    (d) when you are prompted to restart the computer, click on restart.

  • Error: One of the USB devices attached to this system has malfunctioned, and windows does not recognize it.

    tried already everything written here. When I plug my USB device (3 of them) my Windows a sad of the USB devices attached to this system has malfunctioned, and windows does not recognize it. I tried plugging it into another winXP machine, it won't work. Can you help me?

    Original title: usb malfunction

    His salvation,

    Thanks for posting your query in Microsoft Community Forum.

    1. What are the troubleshooting steps you have tried so far?
    2. If it works much earlier? If so, did you do changes on the computer before this problem?
    3. What type of USB device you are using?

    As you mentioned that the USB device does not work when plugged into a WinXP machine, it may be a problem with the device itself. In addition, the question may also arise if the currently loaded USB driver has become unstable or damaged or if your PC requires an update for problems that could conflict with a device USB and Windows.

    Therefore, I suggest you try the following methods (skip the ones that you already tried) and check if the problem persists.

    Method 1:

    Please try the fixit (s) provided below which will help you solve common problems associated with devices and USB ports.

    If method 1 does not work, try Method 2.

    Method 2:

    Remove and reinstall all USB controllers.

    1. Open Manager devices by clicking the Start button, click Control Panel, click system and security, and then, under System, clicking Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. In the list of the categories of equipment, locate and expand Bus USB controllers.
    3. Right-click every device under the Bus USB controllers node and then click Uninstall to remove them one at a time.
    4. Restart the computer and let the USB controllers get reinstalled.
    5. Plug in the removable USB device and test to make sure that the problem is solved.

    If the problem persists, go to method 3.

    Method 3:

    This method will install the latest drivers from device to your USB device.

    1. Click the Start button, type Windows Update in the search box, and then click Windows Update in the results pane.
    2. Click find updates. When the scan finished, click optional review updates.
    3. Click the check box next to the update, and then click install updates.
    4. If you are prompted, read the license agreement, then click I agree.
    5. Follow the instructions on the screen to download and install updates.
    6. If you are prompted, restart your computer.

    More information: Update a hardware driver that is not working properly

    If the device fails after updating the driver, you can try to roll back the driver with its previous version.

    Restore a driver with its previous version

    Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.

  • One of the USB devices attached to this computer has malfunctioned and Windows does not recognize it. The location is the root (2 ports) USB hub: 1-unknown device and Port 2-not used

    Original title: USB device not recognized

    Over the last 2 weeks, I get a message on a USB device.  The message said that one of the USB devices attached to this computer has malfunctioned and Windows does not recognize it.  The location is the root (2 ports) USB hub: 1-unknown device and 2-unused Port.  I have no idea what it means.  I hesitated to first click the icon (it does not last very long) thinking it could be a scam.  Can someone help me?  Thank you.

    Hello

    (1) is the specific question of specific USB devices?
    (2) did you of recent changes to the computer before the show?
    (3) have you tried plugging the USB stick on another computer?

    (4) what is the brand and model of the computer?

    I suggest to refer to the following methods and check if it helps to solve the problem.

    Method 1: Hardware devices do not work or are not detected in Windows

    Run Microsoft Fixit mentioned in the article.

    http://support.Microsoft.com/mats/hardware_device_problems/en-us

    Method 2: USB Port may stop working after you remove or insert a USB device

    http://support.Microsoft.com/kb/817900

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: 322756 How to back up and restore the registry in Windows

    Reference:--

    Advanced troubleshooting tips for General USB for Windows XP problems: http://support.microsoft.com/kb/310575

  • one of the usb devices attached to this computer has malfunctioned and windows does not recognize it

    I get the following message when I join my computr "one of the usb devices attached to this computer has malfunctioned and windows does not recognize," my nokia C3
    kindly help

    Most often when a device is not it's because of a driver.  Try reinstalling your.

    It works for win 7 & 8

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly? SignedIn = 1

    http://captaindbg.com/how-to-update-drivers-on-Windows-7/

  • Recently, I ran an anti-virus and learned that my netBT.sys file was corrupted. The anti-virus software installs this file but now my internet does not work.

    netBT.sys replacement files viruses

    Recently, I ran an anti-virus and learned that my netBT.sys file was corrupted.  The anti-virus software installs this file but now my internet does not work.  I guess I have to replace this file, but don't know how.  I see that I need to use my windows XP CD but my CD drive is broken.  How can I go about replacing this file?

    Thanks in advance

    Hi DonMendigo,

    Follow the suggestions below for a possible solution:

    Method 1: Try the SFC (System File Checker) scan on the computer.

    To run the System File Checker tool, follow these steps:

    a. click Startand type cmd in the box start the search.

    b. right click on cmd in the list programs, and then click run as administrator.

    c. If you are prompted for an administrator password or a confirmation, type your password or click on continue

    d. at the command prompts, the following line and press ENTER:

    sfc/scannow

    See also:

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

     

    File system (CFS) Checker

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/system_file_checker.mspx?mfr=true

     

    Method 2: If you are still unable to connect to the internet, then follow the article in the Microsoft Knowledge Base and check.

    Programs Internet in Windows XP cannot connect to the Internet via a connection to wide band

    http://support.Microsoft.com/kb/307164

     

    I hope this helps.

Maybe you are looking for

  • Untitled library STILL opens or is created at the opening of FCPX

    Every time this happens and it is extremely annoying and frustrating because I have to go and delete every time. Why Final Cut continue to create this library Untitled empty and how can I stop doing that. PS GIVE US COLOR CURVES! FCP IS NOT EVEN A SU

  • iPhone updated to 9.2.1 iTunes says update to 9.2.1

    I encountered this weird error. I updated my iPhone to 9.2.1 but when I plugged into my Mac, iTunes asked me to update the same 9.2.1. What should I do? Does anyone know about this error?

  • Satellite L750 system hangs after disconnecting the WLan

    I bought Satellite L750 series laptop I have connected Wifi. If I disconnect the Wifi system get hooked. I can't do anything to that. I've updated the driver software and I checked all the possibilities that my knowledge.

  • Press and hold the TAB key too long?

    It is news to me. Customer was an email without realizing that he was now pressed the tab key. He got a pop message indicates that the TAB key has been held down too long. Now, the keyboard no longer works. Whenever we press any key, all we get is a

  • Internal Error 2343

    Hello. I've updated my office 2000 to office 2007, when you try to save word files I get a message "Internal Error 2343" how to solve this?