Code Problem or Bug?

I have a problem that seems simple to the core.  I can easily duplicate it and I am not sure why it's happening.  Here's the steps:
1. Drag a button to the stage and give it an instance name (btnHello).
2. Create a new layer (for Actions).
3. On frame 1 (of the Actions layer), put in the following code:
     btnHello.addEventListener(MouseEvent.MOUSE_UP, goHello);
     function goHello(event:MouseEvent):void{
     gotoAndPlay(5);
     stop();
4. On frame 5, put in the following code:
     trace("Frame 5");
     stop();
5. On frame 10, put in the following code:
     trace("Frame 10");
     stop();
Pretty straight-forward.  It is a button that is hard coded to go to Frame 5 when clicked, which it does do.  However, if I am already on Frame 5 when I click it, it jumps to Frame 10.  If I click it again, it junmps back to Frame 5, click again, Frame 10.
This is causing some serious issues with my navigation / flow.  Does anyone know why it's happening and what I can do to preevent it?
Thanks.
Dave

I tested this to know for sure my inclination was correct.
When you are on frame 5, and you call a gotoAndPlay(5); - you are essentially just telling the playhead to play, since its already on that frame.  So, what happens is it goes to frame 6, where there are no stop actions, plays through to 10, and fires that trace and stop().
You can do one of two things.
1. Use gotoAndStop(5) instead of gotoAndPlay - which will only fire the trace once, since the playhead won't leave the frame if you are already on it.  But it will fix your jumping issue.
2. Check the current frame and only call the gotoAndPlay if you are not on that frame.
     function goHello(event:MouseEvent):void{
          if(currentFrame != 5){
               gotoAndPlay(5);
          }else{
               trace("Frame 5 again");

Similar Messages

  • Messy code problem while translating XString to String in OfficeControl

    Hi Expert,
        I have messy code problem while translating XString to String in XML-Format Word Doc in OfficeControl.
    I upload an XML-Format template Word Doc to server as a MIME Object.
    When OfficeControl is started in Web Dynpro, OfficeControl automatically open the XML-Format template.
    For the first time, I get the XString-type Context attribute bind to the content of the Word Doc,
    then translate it to string, I got the XML-format content, it's great!
    However, after the first time, when I input any new contents in MS Word in Web Dynpro,
    no matter I execute "Ctrl + S" or click the "savedocument" button,
    when I translate the XString Context attribute to String, I got messy code. (but the first time, it is good plain text)
    I use the function module: ECATT_CONV_XSTRING_TO_STRING (good for first time, dump after first time),
    SCMS_XSTRING_TO_BINARY, SCMS_BINARY_TO_STRING (good for first time, messy code after first time).
    My Demo source code is in: (system) SMV --> (local object) zhaode --> (Dynpro Component) ztest_office_control
    core source code is as:
    clear itab.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
    BUFFER = lv_datas
    IMPORTING
    OUTPUT_LENGTH = lv_length
    TABLES
    binary_tab = itab.
    CALL FUNCTION 'SCMS_BINARY_TO_STRING'
    EXPORTING
    input_length = lv_length
    mimetype = 'text/plain; charset=utf-8'
    IMPORTING
    text_buffer = lv_datas_string
    output_length = lv_data_len
    TABLES
    binary_tab = itab.
    Can you give me some advice?
    Many thanks in advance.
    Best Regards,

    You have already posted this same question several times (and some very similiar questions) within the forum.  Please do NOT multiple post your questions. This is against the forum rules of engagement. SAP employee or not, you will find yourself banned from the forums if you don't follow the rules.

  • My iTunes won't detect my iPhone that has to be restored via iTunes *because if pass code problems* and its running iOS 7.2

    my iTunes won't detect my iPhone that has to be restored via iTunes *because if pass code problems* and its running iOS 7.0.4

    If itunes is comming up and saying it can't read the device because it's locked with a passcode, you may have to put your device into recovery mode first.
    To put your device in recovery mode: (Following these steps will erase your device and reset everything to factory defaults)
    1) press and hold the power button until you see the slide to power off option
    2) swipe to power off
    3) Press and hold the home button while the device is off and connect it to your computer. Continue holding the home button until you see a graphic with the iTunes logo with a picture of a USB cable below it.
    4) iTunes should give you a message that it has detected a device in recovery mode. Click ok and then select Restore iPhone. iTunes will download a fresh copy of iOS and then wipe the device and restore it. Depending on the speed of your computer's internet connection this may take a while. Just leave the iphone connected to your computer until it's finished.
    If itunes is not detecting it at all or is Not giving you the message that the phone is locked with a passcode, you may end up having to reinstall itunes. This seems to be a fairly common problem after the most recent itunes update (11.1.5)
    If this is the case and you happen to be running a windows based computer you will have to uninstall itunes in this order from your programs and features option in control panel:
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Then download and reinstall itunes from itunes.com try putting your device into recovery mode again and restore.
    Hope this helps.
    Cheers.

  • Visual basic code problem

    Hello!
    I want to use visual basic to build a htm which can control labview throght datasocket, i set the switch
    as " Swithc until release " in visual basic, the code is
    Private Sub CWButton1_Click()
    CWDataSocket1.Data = CWButton1.Value
    End Sub
    but the led of labview can't light on.
    is the code problem?
    thanks!

    The problem is most likely because you have the code in the Click() event handler. The click event in VB is a left mouse down AND mouse up over the controls. If you are wanting it to send out the value when you press and hold the button down, change the event handler to the ValueChanged event.
    Best Regards,
    Chris Matthews
    National Instruments

  • Copy and paste adjustment  problem/ possible bug.

    Hi all
    I have just encountered a very strange problem/ possible bug.
    I have been working on a file in photoshop cs5 that had come from lightroom 5.3. This was then saved (automaticaly becomes tiff file in Lightroom). I then wanted to make some more adjustments to it in lightroom (using local adjustment clarity). I then tried to copy the settings of the adjustment brush  from the tiff to the original raw file. This is where it gets very strange. The adjustments are copied but they are rotated ccw by 90 degrees!  I can replicate this every time.
    Could someone else try to see if this problem exists on their catalogs or if its a corrpution problem my end.

    Noted on the bug, thanks.
    1762hd wrote:
    Hi Geoff
    Heres the summary for bug report - please note this bug also affects radial filter/healing brush and crop
    Scenario
    1 open a portrait raw image in photoshop using render using lightroom (I am using cs5)
    2 back in lightroom make a change using the - adjustment brush/ radial filter/healing brush or crop - to the newly created tiff image.
    3 copy and paste this adjustment to the original raw file.
    problem
    all effects are rotated.

  • KMS 9.0 trial code problem

    First of all i want so say sorry for my bad english.
    I,m from germany and i installed the file "kmsecurity9379eu2_129945.sis" from ovi store.
    My mobile phone is Nokia 5230 NAVI.
    After the trial i want to uninstall the app.
    But now i need a code to uninstall KMS 9.0.
    I've never set any code at installation and it's not my pin-code or something like 0000.
    I tried to ask the people from kaspersky to help me with that problem.
    At their forum there is an guy named Viktor "Head of Mobile Development" who want's the imei nummers from the people with that code-problem.
    But i cannot contact him, cause his inbox is always full.
    So what can i do?
    Don't want to hard reset my phone, cause there are many apps i payed for.
    And please remove the app from ovi store, cause many people have that problem.

    At first, I thought I have the same problem. I am trying to uninstall the App but it's asking for a code. But after searching for an answer online. It come to m mind that I entered an 8 digit code. I tried to enter the code. And bingo! I was able to remove it from my nokie e5-00.  Definitely, you entered a code as you cannot continue to install the trial version without creating your own code. No need to hard reset your phone.

  • [svn:osmf:] 15979: Second code submission for bug FM-760, add unit tests to increase code coverage.

    Revision: 15979
    Revision: 15979
    Author:   [email protected]
    Date:     2010-05-09 16:26:09 -0700 (Sun, 09 May 2010)
    Log Message:
    Second code submission for bug FM-760, add unit tests to increase code coverage.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-760
    Modified Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/OSMFTests.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/MockHTTPNetStream.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastDVRT rait.as
    Added Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPNetStreamMetrics.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamRequest.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingFileHandlerBase .as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingIndexHandlerBas e.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingUtils.as

    Revision: 15979
    Revision: 15979
    Author:   [email protected]
    Date:     2010-05-09 16:26:09 -0700 (Sun, 09 May 2010)
    Log Message:
    Second code submission for bug FM-760, add unit tests to increase code coverage.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-760
    Modified Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/OSMFTests.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/MockHTTPNetStream.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastDVRT rait.as
    Added Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPNetStreamMetrics.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamRequest.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingFileHandlerBase .as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingIndexHandlerBas e.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/TestHTTPStreamingUtils.as

  • [svn:osmf:] 15956: First code submission for bug FM-760, add unit tests to increase code coverage.

    Revision: 15956
    Revision: 15956
    Author:   [email protected]
    Date:     2010-05-07 10:42:13 -0700 (Fri, 07 May 2010)
    Log Message:
    First code submission for bug FM-760, add unit tests to increase code coverage.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-760
    Modified Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/OSMFTests.as
    Added Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/MockHTTPNetStream.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestDVRInfo.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastDVRT rait.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastTime Trait.as

    Revision: 15956
    Revision: 15956
    Author:   [email protected]
    Date:     2010-05-07 10:42:13 -0700 (Fri, 07 May 2010)
    Log Message:
    First code submission for bug FM-760, add unit tests to increase code coverage.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-760
    Modified Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/OSMFTests.as
    Added Paths:
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/MockHTTPNetStream.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestDVRInfo.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastDVRT rait.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/httpstreaming/dvr/TestHTTPStreamingDVRCastTime Trait.as

  • Strange problem with select options, problem in my code or standard bug?

    I have a selection screen with no intervals.
    In my select option When i give a range for example
    BT(Between) 1 to 3 and then if i  remove 3 (s-high) value and press enter the BT changes to EQ automatically which is correct.
    Suppose i select BT as my operator and just give 1 in S-low and keep S-high as blank.
    It behaves wiered and the data selected is not correct.  BT now should have changed to EQ but it doesnt happen.
    Same case occurs with NB ie not in between.
    Can experts please give there advice on this behaviour of selection screen

    wht u can do is.....
    u can keep these two input fields as two diff attributes....
    consider it as A , B
    then on various possibilities....fire select queries...
    for eg:
    if A & B not initial.
    then select data between A and B
    if A is not initial B is initial
    then select data = A
    and all possiblities to can think

  • Query of queries problem or bug

    Hello Everyone,
    I have used cfdirectory to get a list of files. As the result
    I receive query with the files.
    Then I want to search it using query of queries. I' ve found
    a problem and I wonder if it is a bug of Coldfusion or perhaps
    wrong usage of QoQ. The thing is that the files that I have are
    using '_' and then are followed by number of week. It seems that
    searching something like this '%_6' returns results *_*6. See
    attached code.
    Thanks for all answers in advance.

    > I think you'll find "_" is a single-char wildcard when
    used with the LIKE
    > operator.
    Found out how to escape it:
    WHERE Name LIKE '%[_]6%'
    I'm glad you brought this up... I didn't know about this
    until I looked @
    your issue. That's my new thing learned for the day: I can go
    to the pub
    now ;-)
    Adam

  • DIV STYLE Region layout problem. Bug?

    Hi guys, I believe this is a bug but need clarification.
    I have created some regions based on the html code:
    div style="border: 1px solid rgb(153, 153, 153); height:300px; width:970px; overflow:auto;">#BODY# /div
    Now, this works fine, in the region I have a standard report. The propblem is when I open a NEW browser window, any website. Then go back to the page, a huge gap appears between the region this code is in, and the previous region.
    I am using IE7 and Apex 3.0.1
    Any help?
    Thanks
    Sam
    Message was edited by:
    Spam
    Message was edited by:
    Spam
    Message was edited by:
    Spam

    I wouldn't see that as a problem, as this is the use case described in the overflow spec: "...This avoids any problem with scrollbars appearing and disappearing in a dynamic environment."
    If it is that important, can you control sending "overflow: hidden" or "overflow: scroll" depending on the number of rows, using ApEx mechanisms and conditional comments?

  • Is there a problem or bug in locking video clips together?

    Hi, I have 3 movie tracks masked with one track underneath all 3 for a total of 4 movie tracks. I seem to be having a problem locking down the 4 video layers so things "added" into my masks match up with the main video track outside the mask(s). I've tried using guides and grids and when I get the center point circular X on the yellow t-bar for all 4 lined up, I click on these 4 tracks and use the object lock feature (in the object menu), but it doesn't seem to "lock" for the duration of my entire edit, which is about 2000 frames.
    Any idea what I'm doing wrong?
    rita

    Hi Kim,
    There have never been any reports of bugs or problems with our serial communication VI's with the specific ASCII character "i". Also no reports about that character in general.
    1. All the serial VI's are based on VISA, so you can always make sure that you have the latest VISA driver from our website:
    http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=132060_US
    2.You say that you have version 6.0? Did you install the 6.0.2 patch? If not, that would be a good idea too. There were some problems with String and Array functions that got fixed.
    Download the patch from this link:
    http://digital.ni.com/softlib.nsf/websearch/168AAE428563A9E8862569EC005C5856?OpenDocument&node=132070_US
    3. What do yo
    u mean with "the serial ASCII output is giving you problems"? What kind of problems? What do you mean with bad lookup? What LabVIEW functions do you use? You need to be more specific.
    4. If this is a serial issue,.. Do you have the same problem when doing a serial loopback test with the letter i? Try with the specific ASCII code or just with a normal string.
    5. Can you attach a little program that reproduces the problem on your MAC? Please also send specific information about your OS, installed software,...
    Regards.
    Joris Vanderschrick
    Applications Engineer
    NI Belgium

  • Cost Code problem in Contract Manager 12.0

    Has anyone encountered problem creating a Cost Code? When
    we tried to create one with the "Planned to Commit" value
    greater than 999, it simply refuse to work.
    It
    states that the field would not accept comma, but Contract
    Manager automatically puts a comma in there when the value
    is greater than 999.
    It essentially makes
    Contract Manager 12.0 useless to us. I am wondering if
    Contract Manager 12.0 is a Beta release.

    This was a bug in v12. Fixed in v12 SP2.

  • E63 Lock Code Problem After Update

    I recently checked for a firmware update for my E63. I got excited when i found out that there was an availabla one, the 510 .21 .010 and I immediately started the update process. Everything went ok but when i switched On the phone  it asked me for the lock code after 3 or 4 seconds. I tried the default one , 12345 but it showed a code error message. I can't do excatly nothing but the weird thing is that buttons Calendar,Contacts and Mailbox work but i still can't do nothing else.The Home button does not work. It doesn't seem a normal behaviour.Could it be a bug? I read a lot of posts about this problem so this means I'm not the only one having this problem. Please help me. I really need my E63 back as it is my do-everything tool. Maybe a new firmware with this bug fixed would be best.
    Thank You in advance

    hello, you will need to contact your nearest Nokia Care with proof of purchase/ownership, for them to reset your security code.

  • I/O Error result code -36: Logic bug, or Mac OSX bug?

    Hello-
    I encountered a problem in Logic Pro 8 today that severely damaged one of my audio files in my session. I was working in the sample editor, and I went to copy and paste an audio fragment. When I tried to paste the audio, this error came up:
    "I/O Error, result code = -36"
    After that, the cursor turned into a black and white spinner, and the audio file that I was working with suddenly was altered in a way that somehow erased a portion of it in the song. I had to ability to undo, view the changes in the audio file, etc, etc. It was damaged irreversibly, and I had to end up re-recording that segment. Does anyone know why this happens, and is it a bug in Logic?
    BTW, I have over 500 gigs free on the external drive that I am recording to, and nothing has changed, hardware-wise on my system in over 6 months... Any help would be greatly appreciated.

    Adam Nitti wrote:
    Hello-
    I encountered a problem in Logic Pro 8 today that severely damaged one of my audio files in my session. I was working in the sample editor, and I went to copy and paste an audio fragment. When I tried to paste the audio, this error came up:
    "I/O Error, result code = -36"
    After that, the cursor turned into a black and white spinner, and the audio file that I was working with suddenly was altered in a way that somehow erased a portion of it in the song. I had to ability to undo, view the changes in the audio file, etc, etc. It was damaged irreversibly, and I had to end up re-recording that segment. Does anyone know why this happens, and is it a bug in Logic?
    BTW, I have over 500 gigs free on the external drive that I am recording to, and nothing has changed, hardware-wise on my system in over 6 months... Any help would be greatly appreciated.
    This sounds like one of two things that I have seen with this error :
    1.- your external hard drives' connection to the computer is not 100% stable (loose cable...dusty environment...)
    2.- Your audio device, is ti FireWire too? Is it daisy chained to this external hard drive? Maybe the order of the daisy chaining needs to be looked at.
    Cheers

Maybe you are looking for