Button code problems

Running CS3. Have menu system with buttons. Click button and
it take you to a frame with a label. This I can do but when you
click on a button twice the movie goes to the wrong frame.
Here's my code:
function homepage(event:MouseEvent):void {
gotoAndPlay("home");
function woodpage(event:MouseEvent):void {
gotoAndPlay("wood");
function carpetspage(event:MouseEvent):void {
gotoAndPlay("carpets");
homebtn.addEventListener(MouseEvent.CLICK, homepage);
woodbtn.addEventListener(MouseEvent.CLICK, woodpage);
carpetsbtn.addEventListener(MouseEvent.CLICK, carpetspage);
stop();
If I click home twice it goes to wood, if I click wood twice
it goes to carpets!
Whats wrong with the code?

First, thank you for the feedback, we will consider implementing 'display only' type in a future release.
Second, for 3.0.8, which will be released with the next version of iAS, "insertable" and "updatable" checkboxes were added to all "data-driven" item types. Hopefully this will make life easier, no tricks.
Thanks,
Dmitry

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.

  • Code problem

    Hey i've this button on my applet that when clicked passes text entered in a textArea to a seperate class,then shows the result (after the class is finished with it), at least thats what its supposed to do. What happens is that a flock of errors occur. Can anyone spot the problem
    Here's the button code
    public boolean action (Event e, Object o)
         if (e.target == b1)
         first = text1.getText();
         ParseMe parser = new ParseMe(first);
            if( parser.answer()==1){
           showStatus("Answer was" + parser.answer());
           return true;
         }else{
           showStatus("Answer was" + parser.answer());
           return false;
       }and this is the class that the info's bein passed to
    package test.pkg;
    public final class ParseMe {
            //----------------- public interface ---------------------------------------
            public ParseMe(String definition) {
                    // Construct an expression, given its definition as a string.
                    // This will throw an IllegalArgumentException if the string
                    // does not contain a legal expression.
                    parse(definition);
            public double answer(){
              return this.value(1.0,1.0,1.0)+ this.computeStackUsage();
            public double value(double x) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, 0, 0);
            public double value(double x, double y) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, y, 0);
            public double value(double x, double y, double z) {
                    // Return the value of this expression, when the variable x
                    // has the specified value.  If the expression is undefined
                    // for the specified value of x, then Double.NaN is returned.
                    return eval(x, y, z);
            public String getDefinition() {
                    // Return the original definition string of this expression.  This
                    // is the same string that was provided in the constructor.
                    return definition;
            //------------------- private implementation details ----------------------------------
            private String definition;  // The original definition of the expression,
            // as passed to the constructor.
            private byte[] code;        // A translated version of the expression, containing
            //   stack operations that compute the value of the expression.
            private double[] stack;     // A stack to be used during the evaluation of the expression.
            private double[] constants; // An array containing all the constants found in the expression.
            private static final byte  // values for code array; values >= 0 are indices into constants array
                    PLUS = -1,   MINUS = -2,   TIMES = -3,   DIVIDE = -4,  POWER = -5,
                    UNARYMINUS = -6, VARIABLE_X = -7, VARIABLE_Y = -8, VARIABLE_Z = -9;
            private double eval(double variableX, double variableY, double variableZ) {
          // evaluate this expression for this value of the variable
                    try {
                            int top = 0;
                            for (int i = 0; i < codeSize; i++) {
                                    if (code[i] >= 0)
                                            stack[top++] = constants[code];
    else if (code[i] >= POWER) {
    double y = stack[--top];
    double x = stack[--top];
    double ans = Double.NaN;
    switch (code[i]) {
    case PLUS: ans = x + y; break;
    case MINUS: ans = x - y; break;
    case TIMES: ans = x * y; break;
    case DIVIDE: ans = x / y; break;
    case POWER: ans = Math.pow(x,y); break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    else if (code[i] == VARIABLE_X) {
    stack[top++] = variableX;
    else if (code[i] == VARIABLE_Y) {
    stack[top++] = variableY;
    else if (code[i] == VARIABLE_Z) {
    stack[top++] = variableZ;
    else {
    double x = stack[--top];
    double ans = Double.NaN;
    switch (code[i]) {
    case UNARYMINUS: ans = -x; break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    catch (Exception e) {
    return Double.NaN;
    if (Double.isInfinite(stack[0]))
    return Double.NaN;
    else
    return stack[0];
    private int pos = 0, constantCt = 0, codeSize = 0; // data for use during parsing
    private void error(String message) {  // called when an error occurs during parsing
    throw new IllegalArgumentException("Parse error: " + message + " (Position in data = " + pos + ".)");
    private int computeStackUsage() {  // call after code[] is computed
    int s = 0; // stack size after each operation
    int max = 0; // maximum stack size seen
    for (int i = 0; i < codeSize; i++) {
    if (code[i] >= 0 || code[i] == VARIABLE_X
    || code[i] == VARIABLE_Y || code[i] == VARIABLE_Z
    s++;
    if (s > max)
    max = s;
    else if (code[i] >= POWER)
    s--;
    return max;
    private void parse(String definition) {  // Parse the definition and produce all
    // the data that represents the expression
    // internally; can throw IllegalArgumentException
    if (definition == null || definition.trim().equals(""))
    error("No data provided to Expr constructor");
    this.definition = definition;
    code = new byte[definition.length()];
    constants = new double[definition.length()];
    parseExpression();
    skip();
    if (next() != 0)
    error("Extra data found after the end of the expression.");
    int stackSize = computeStackUsage();
    stack = new double[stackSize];
    byte[] c = new byte[codeSize];
    System.arraycopy(code,0,c,0,codeSize);
    code = c;
    double[] A = new double[constantCt];
    System.arraycopy(constants,0,A,0,constantCt);
    constants = A;
    private char next() {  // return next char in data or 0 if data is all used up
    if (pos >= definition.length())
    return 0;
    else
    return definition.charAt(pos);
    private void skip() {  // skip over white space in data
    while(Character.isWhitespace(next()))
    pos++;
    // remaining routines do a standard recursive parse of the expression
    private void parseExpression() {
    boolean neg = false;
    skip();
    if (next() == '+' || next() == '-') {
    neg = (next() == '-');
    pos++;
    skip();
    parseTerm();
    if (neg)
    code[codeSize++] = UNARYMINUS;
    skip();
    while (next() == '+' || next() == '-') {
    char op = next();
    pos++;
    parseTerm();
    if (op == '+')
    code[codeSize++] = PLUS;
    else
    code[codeSize++] = MINUS;
    skip();
    private void parseTerm() {
    parseFactor();
    skip();
    while (next() == '*' || next() == '/') {
    char op = next();
    pos++;
    parseFactor();
    if (op == '*')
    code[codeSize++] = TIMES;
    else
    code[codeSize++] = DIVIDE;
    skip();
    private void parseFactor() {
    parsePrimary();
    skip();
    while (next() == '^') {
    pos++;
    parsePrimary();
    code[codeSize++] = POWER;
    skip();
    private void parsePrimary() {
    skip();
    char ch = next();
    if (ch == 'x' || ch == 'X') {
    pos++;
    code[codeSize++] = VARIABLE_X;
    else if (ch == 'y' || ch == 'Y') {
    pos++;
    code[codeSize++] = VARIABLE_Y;
    else if (ch == 'z' || ch == 'Z') {
    pos++;
    code[codeSize++] = VARIABLE_Z;
    else if (Character.isDigit(ch) || ch == '.')
    parseNumber();
    else if (ch == '(') {
    pos++;
    parseExpression();
    skip();
    if (next() != ')')
    error("Exprected a right parenthesis.");
    pos++;
    else if (ch == ')')
    error("Unmatched right parenthesis.");
    else if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^')
    error("Operator '" + ch + "' found in an unexpected position.");
    else if (ch == 0)
    error("Unexpected end of data in the middle of an expression.");
    else
    error("Illegal character '" + ch + "' found in data.");
    private void parseNumber() {
    String w = "";
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    if (next() == '.') {
    w += next();
    pos++;
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    if (w.equals("."))
    error("Illegal number found, consisting of decimal point only.");
    if (next() == 'E' || next() == 'e') {
    w += next();
    pos++;
    if (next() == '+' || next() == '-') {
    w += next();
    pos++;
    if (! Character.isDigit(next()))
    error("Illegal number found, with no digits in its exponent.");
    while (Character.isDigit(next())) {
    w += next();
    pos++;
    double d = Double.NaN;
    try {
    d = Double.valueOf(w).doubleValue();
    catch (Exception e) {
    if (Double.isNaN(d))
    error("Illegal number '" + w + "' found in data.");
    code[codeSize++] = (byte)constantCt;
    constants[constantCt++] = d;
    /*public static void main(String args[])
    ParseMe me = new ParseMe("1");
    System.out.println(me.value(1,1,1) + ", " + me.computeStackUsage());
    any help would be well appreciated.
    cheers
    podger

    It looks like it parses a mathematical expression represented as a String with up to three variables (x, y, z), and will substitute x, y, and z with whatever values you give it. What is your "text" (value of "first") that you are trying to parse?
    Eventually, you probably want to have text fields for the user to enter x, y, and z, parse those text values as doubles, and pass those to your ParseMe instance by calling: parser.value(x, y, z);
    What happens if you type the following in the text field named "text1"?
    x + y + z

  • 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

  • Facing duplicate button press problem.

    Hi,
    I am a beginner to JSF technology. I am working on a project that uses JSF 1.1 specification. I am facing "*duplicate button press problem*". Most of the links and submit buttons do not respond. With a lot of search I found that this problem was fixed in JSF 1.2.
    I want to know whether upgrading to JSF 1.2 will work or not ? Also will it require code changes in existing code or simply upgrade will do?
    - Sax

    I'm not sure why you are focused on 1.1 vs 1.2 on this issue. For both versions you need the POST-REDIRECT-GET pattern, facilitated by the <redirect/> directive in the navigation rules.

  • Dreamweaver CS3- Add this button code help

    Hi, I have a problem in Dreamweaver CS3. The problem is that when I insert my add this button code, in to the codeing area, it does not work.
    When I open my page in chrome, it simply says 'more shraeing services'. I will copy the code, in to this discussion. I would be greaftful if someone
    can help me resolve this problem, so I can get the add this button to work on my site. The final bits of code are as follows-
    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    <!-- Place this tag where you want the +1 button to render -->
    <g:plusone></g:plusone>
        </div>
       </form>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
    <script type="text/javascript" src="http://www.google.com/cse/t13n?form=cse-search-box&t13n_langs=am%2Cel%2Cml%2Cpa%2Cta%2Car% 2Cgu%2Cmr%2Cru%2Cte%2Cti%2Csa%2Cne%2Chi%2Cbn%2Cen%2Ckn%2Cfa%2Csr%2Cur"></script>
    <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
    <script type="text/javascript" src="http://www.google.com/cse/query_renderer.js"></script>
    <div id="queries"></div>
    <script src="http://www.google.com/cse/api/partner-pub-5783950232732081/cse/4522012035/queries/js?oe=UT F-8&callback=(new+PopularQueryRenderer(document.getElementById(%22queries%22))).render"></script>
      </div>
      <div align="center"></div>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    Is there anything in this piece of code I should edit in order to make the add this button work? Many thanks

    A link to your page would be the best possible way to get help with this. 
    Code fragments don't tell the whole story.
    Nancy O.

  • IOS 6.1.3 WIFI button disable problem on iPhone4S - It is definitely a BUG

    Hi Apple Fans
    I have a full house of Apple products from iPhone -> iPAD -> iPod -> Mac -> AirPort, and I am suffering from WIFI button disable problem after upgrade to iOS 6.1.3, without any clue after calling Apple Support, factory reset and reload iPhone for more than 10 times.  I also try all tips on Apple Support Communicties except put it into a freezer, still no any luck.  Apple Support suggests that my iPhone may be factly!
    Tonight, I can get my WIFI back in below sequence:
    1. Switch to English language from Chinese
    2. Turn Cellular Data Option to off
    3. Reset Network Setting
    After the phone reset, the WIFI row show 'Not Connected', and I can select my home WIFI (Airport Express) without trouble.  To prove my finding is workable to all case, can you try the same and update here if it works for you?
    Good Luck!
    PS: I always believe it is a BUG.

    Hi,
    I sympathise with you as my iPhone 4s is 7 months old and is also greyed out.  I tried everthing except the potentially stupid one of putting the iphone in a freezer!  I took the phone back to the vendor who sent it away and repaired it.  But alas after a month it is greyed out again.  I have again returned to the vendor and he will repair it again.  I asked him how and he told me it is a software conflict and he has to spend around 9 hours downloading a patch repair.  Apple are aware of this issue and I feel completely let down because they have not posted a fix on the net.  Presently I am living and working in Dubai, back in the UK I am sure my iPhone would have been exchanged for a new one.  I need my iPhone for my work and cannot afford to just buy a new one so I have been let down and despite for years being a supporter of Apple and their products I shall think twice before investing in any more Apple products.

  • Standard button image problem

    Hi,
    I've got a problem when I try to set Image to the button from standard components.. I can set it up, but than I didn't see the image in the browser.
    With the button from basic components there is everything working fine, unfortunately I need that component from standard.. any advice?
    thx.

    Hi,
    I've got a problem when I try to set Image to the button from standard
    components.. I can set it up, but than I didn't see the image in the browser.
    With the button from basic components there is everything working fine,
    unfortunately I need that component from standard.. any advice?
    thx.Standard button has problems with images due to a JSF issue. To work around the issue, remove leading / from the buttons image property and re-deploy. This should cause the standard button image to display correctly.
    Hope it helps,
    Lark

  • 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.

  • Paypal button code

    Hello,
    I have Paypal code that allows me to sell 3 books, listed on one menu, all for the s.ame price, $17
    I need to add another book that costs $22.
    Please, can someone help me with the code?
    Thanks
    Alida

    If the block of code for the paypal button is basicly unreadable, then it is encrypted and you need create the button in the PayPal account. If you go to the account, you will see that it's all pretty intuitive. Then copy/paste the code PayPal generates into your web page in code view.
    If the button code is readable, then you can create a new button just by changing the obvious values, such as
    <input type="hidden" name="amount" value="22.00"/> for the amount.
    . . . or, you can also create a non-encrypted button in PayPal, just like an encrypted button, and paste the code into your page (in code view of course).

  • TS3274 If my iPad home button got problem?

    If my iPad home button have problem but my iPad still under warranty can i use the warranty to take service for my iPad?

    Yes the home button problem would be covered by the warranty as long as you didn't do something accidentally to cause the home button to fail. If it is a hardware failure - it will be covered under the warranty.
    Is the home button no longer working? Have you tried to calibrate the home button?
    Calibrate the home button
    1. Open a stock iOS app, such as Contacts
    2. Press & hold the sleep/wake button at the top of your device until the red slider control appears.
    3. Immediately release the sleep/wake button and press & hold the home button. Hold until the red slider disappears.

  • IPhone 5 on off button having problem

    my iPhone 5 on off button having problem which sometimes i have to press several times, and sometimes i have to press it hard. Did anyone having the same problem here? beacause i just use for 5 months

    Take a Visit to an Apple Store or AASP (Authorized Apple Service Provider) and have the Device evaluated...
    Be sure to make an appointment first...

  • Simple button background problem

    Good day,
    I'm new to flex and MXML. I've gone through the initial difficulties of getting familiar with the IDE and programming language. Now that this is done, I'm really starting to enjoy it.
    I'm currently facing what is probably a basic problem. I've created an MXML Button component. When I instanciate it somewhere in another component, it comes up with a weird square background under my button, like this :
    My button is a single line component, like this :
    <s:Button label="Measure" skinClass="skins.MeasureDistanceSkin" width="70" height="25" click="OnClick(event);" creationComplete="Init(event);" />
    My button instanciation line looks like this :
    <MeasureButton map="{map}" left="110" top="42" width="80" height="33" id="MyButton" />
    Can anyone give me a hand with this?
    Thanks,
    Bruno

    You couldn't have made trillions of buttons that work using that code in AS3.  It would have to be something more like the following to work in AS3...
    stop();
    btn_page2.addEventListener(MouseEvent.CLICK, gotoPage2);
    function gotoPage2(e:MouseEvent):void {
         gotoAndPlay(99);
    Switched places in the btn_page2 line and changed Void (AS2) to void (AS3)

  • Simple Button Code

    I have a .fla movie with 4 frames containing a different
    movie clip each - In my "Actions" pane I have a script written as
    such:
    home.services.enabled=false;
    about.services.enabled=false;
    contacts.services.enabled=false;
    the "home" movie clip is located in frame 1
    the "about" movie clip is located in frame 2
    the "contacts" movie clip is located in frame 3
    The home code works and disables the "services" button in the
    movie clip / but the other two do not disable for some reason in
    the other movie clips.
    Can anyone shed some light on the problem - do I need to tell
    the code to look in Frame 2 and 3 or . . . ?
    Thanks In Advance!

    execute the code on the frames where your movieclips are
    instantiated or put your movieclips on frame 1 where your code
    exists.

Maybe you are looking for