Trouble with a custom button

Hey guys, I made a nice menu to the search, but I can't seem to finish the code correctly. Basically, I want the button do is:


Click once on the button: Menu shows upwards and the form changes button.


Click again: Menu disappears and the button returns to its original shape. Do this with a playReverse(); in the menu and the button.


The button and the menu has a nice animation. I can also do well show and hide animations on the button and the menu of work at the same time perfectly. But I don't know how to do the toggle button, as it should.


The button and the menu are symbols with their own calendars.


My button code is something like this:


See the:

var mySymbolObject = sym.getSymbol ("menu");

mySymbolObject.play ();

var mySymbolObject = sym.getSymbol ("button");

mySymbolObject.play ();

Hide:

var mySymbolObject = sym.getSymbol ("menu");

mySymbolObject.playReverse ();

var mySymbolObject = sym.getSymbol ("button");

mySymbolObject.playReverse ();

Replace the code with this:-Sorry I had an error due to the fact, I wrote the code on my iphone and it's small enough for my eyes to see where the error was!

var estadoMenu = 0;

SYM. $("boton1") .bind ('click', function() {}

If (estadoMenu == 0) {}

show

var mySymbolObject = sym.getSymbol ("menu");

mySymbolObject.play ();

var mySymbolObject = sym.getSymbol ("boton1");

mySymbolObject.play ();

estadoMenu = 1;

} else {if(estadoMenu==1)

cars

var mySymbolObject = sym.getSymbol ("menu");

mySymbolObject.playReverse ();

var mySymbolObject = sym.getSymbol ("boton1");

mySymbolObject.playReverse ();

estadoMenu = 0;

}

});

Tags: Edge Animate

Similar Questions

  • Trouble with the customer email campaign dynamic report.

    I created an email campaign with a list of dynamic customer relationship and which shows that 0 emails went out to recipients 0. I followed the instructions in the knowledge base of a t-shirt. When I look at the list of clients that I created there are 37 names. What am I doint evil?

    Thank you!

    It seems that the report generated, customers were not fully opted in the mailing list.

    In this case, I did a master opt - in in your site updated for all contacts who have not already unsubscribed.

    Please create a new campaign from the list as it should resolve now.

    Kind regards

    -Sidney

  • Problem with fieldChanged() and custom button field

    Hello

    I created a custom button class by extending LabelField.  I chose LabelField over field because the LabelField contains desirable properties that are already being implemented.  The only problem I'm having has to do with the change listener.  It seems to 'steal' the event click on other areas in my application.

    For example, when I click on the custom button, a popupscreen with a listfield opens. When I click on an item in the listfield, then the fieldChanged() of custom button is called again...

    Can you see anything wrong with my code?

    package com.rantnetwork.fields;
    
    import com.rantnetwork.app.Constants;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    import net.rim.device.api.ui.decor.BorderFactory;
    
    public class CustomButtonField extends LabelField {
    
        private boolean highlighted = false;
    
        public CustomButtonField(String text, long style) {
            super(text, style | Field.FOCUSABLE | LabelField.ELLIPSIS);
    
            setPadding(10, 0, 10, 5);
    
            setFont(Font.getDefault().derive(Font.BOLD,
                    Constants.DEFAULT_FONT_SIZE, Ui.UNITS_pt));
    
            setBackground(BackgroundFactory.createLinearGradientBackground(
                    0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
            setBorder(BorderFactory
                    .createBevelBorder(new XYEdges(1, 1, 1, 1), new XYEdges(
                            Color.BLACK, Color.BLACK, Color.BLACK, Color.BLACK),
                            new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                    Color.BLACK)));
    
        }
    
        public int getPreferredWidth() {
            return Display.getWidth() / 3;
        }
    
        protected void paint(Graphics graphics) {
            graphics.setColor(Color.WHITE);
            super.paint(graphics);
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
            // Do nothing
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return true;
        }
    
        protected void onFocus(int direction) {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        protected void onUnfocus() {
            if (!highlighted) {
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
        }
    
        public void showHighlighted(boolean focus) {
            if (focus) {
                highlighted = true;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x4bb7df, 0x4bb7df, 0x1b96da, 0x1b96da));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            } else {
                highlighted = false;
                setBackground(BackgroundFactory.createLinearGradientBackground(
                        0x163d7c, 0x163d7c, 0x03162d, 0x03162d));
                setBorder(BorderFactory.createBevelBorder(new XYEdges(1, 1, 1, 1),
                        new XYEdges(Color.BLACK, Color.BLACK, Color.BLACK,
                                Color.BLACK), new XYEdges(Color.BLACK, Color.BLACK,
                                Color.BLACK, Color.BLACK)));
            }
            invalidate();
        }
    
        public boolean isHighlighted() {
            return highlighted;
        }
    
    }
    

    behrk2 wrote:

    Now, I'm not sure why customButton.setText (calling) would trigger the fieldChanged().  Can anyone think of a reason why he can do?

    Thank you!

    Can you think of a reason why we can't do that? The field has changed, after all! Of course, the context (second argument to fieldChanged) will be PROGRAMMATIC in this case, that might be a pretty good indication for you. But not invoke fieldChanged at all would be wrong.

    This is why I don't like the idea of extending LabelField and not just the field for your custom badges - you have much less control over his behavior. If you want an example showing how to create abstract off-screen buttons, take a look at BaseButtonField and his descendants in managers, fields and advanced buttons.

  • CP 9 CC switch with custom button?

    Hello

    How to use a button image / custom on-screen for DC switch on and outside? I Don t want to do through the play bar.

    Is it possible to do?

    Thanks for your help!

    If you like with the PlayBar, you need a programmer. If you want to do it with a custom navigation and other buttons, take a look at:

    1 share = 5 buttons toggle - Captivate blog

    Here's an additional button that is not available on the default reading bars:

    Replay (slide) button - Captivate blog

  • I want to use a custom button photoshop with my composition and have the substitution effect

    I'm trying to put a button in photoshop in a blank publication widget trigger. When I cut an paste the image into the trigger, he loses his robot and switches are no longer the colors during the reversal. It works very well in the composition of the lightbox, but the problem with lightbox composition, is there no working capital options to display click only target. How to work around this problem. I want to have my own custom button with the effect of composition within the cc muse.

    You should check the design layout and defined States for relaxation, if the State is set correctly then it should show the rollover State, but the container target corresponding to the relaxation is on the page, then it could show you the active State not the rollover State.

    Thank you

    Sanjit

  • JDialog with options and custom buttons

    I can't seem to find a builder for custom buttons and drop-down menu items. I wanted to do was add custom buttons this text simply nothing complicated. 'Connect' and 'Cancel '.
    /**
     * Dialog window for new connection.
     */
    protected String NewConnectionDialog()
    {
         Window win = SwingUtilities.getWindowAncestor(mainPanel);
         String[] databases = {"Oracle", "Access", "MySQL", "PostgreSQL"};
         Object[] options = {"Connect", "Cancel"};
    
         String s = (String)JOptionPane.showInputDialog( win, 
                   "Select Database:", "New Connection Wizard.", 
                   JOptionPane.OK_CANCEL_OPTION, icon, databases, 
                   "MySQL" );
    
         String nullStr  = ""; // no exceptions thanks
         return (s != null ? s.toUpperCase() : nullStr);
    }

    javax.swing.JOptionPane.showOptionDialog ()...

    JPanel pea = new JPanel();
    JLabel jl = new JLabel("Select DB");
    JComboBox jcb = new JComboBox(...stuff here..);
    pea.ad(jl);
    pea.add(jcb);
    
    JButton conButton = new JButton("Connect");
    Object[] buttonRowObjects = new Object[] {
      conButton, "Cancel"
    };
    
    int result = JOptionPane.showOptionDialog(
      Component parentComponent,
      Object message,//<- pea right here
      String title,
      int optionType,
      int messageType,
      Icon icon,
      Object[] options,//<- buttonRowObjects here
      Object initialValue
    );
    

    There now, your patience has paid off. And don't forget to eat your vegetables.

  • Trouble with conversion email from POP to IMAP Comcast: Code: 800ccc0f

    Original title: POP IMAP conversion

    Trouble with conversion email from POP to IMAP Comcast:

    Code: 800ccc0f
    Your server suddenly put an end to the connection. Your IMAP command could not be sent to the server, due to non-network errors.

    I'm on Windows 7 Home edition, Service Pack 1.

    Using e-mail with Comcast Email Client programs
    http://customer.Comcast.com/help-and-support/Internet/email-client-programs-with-Xfinity-email/

    Instructions for:

    Outlook Express
    Outlook 2003
    Outlook 2007
    Outlook 2010
    Windows Mail or Windows Live Mail
    Windows 8
    Mozilla Thunderbird
    Mail for Mac
    Eudora

  • How to add and delete custom buttons

    Hello world

    I have two field of custom button with different colors of red and white button.

    And I want to add and remove both button in the same place each other.

    I mean when I click on the red button, red button remove the screen and the same when I click on the white button to remove white button must be appear and red button should appear. Both button must be exposed to the same place.

    Please any idea...

    Thank you.

    public void add (field)
    survey
    IllegalStateException - if the field has already been added to a Manager.

    Public Sub delete (field)
    IllegalArgumentException - if the field to delete does belong to this Manager.

    So check with the field.getManager () function to make it work properly...

  • Custom button field has two tops?

    I am trying to create a field of custom button so that I can have two lines of text - but I'm getting a second top so say (a second box with the shading/etc that has the top of a field of button).

    Here's a screenshot of it

    The bottom button is just a normal button.

    Field of custom button code:

    package com.smartmech.bb;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.component.ButtonField;
    
    public class _customButtonField extends ButtonField {
            private int setWidth;
            private int setHeight;
            private boolean disabled = false;
            private String lblTxt1;
            private String lblTxt2 = "";
    
            _customButtonField( String text, int Width, int Height, long setStyle) {
                super(text, setStyle);
                setWidth = Width;
                setHeight = Height;
                lblTxt1 = text;
            } //customButtonField
    
            _customButtonField( String text, String text2, int Width, int Height, long setStyle) {
                super("",setStyle);
                setWidth = Width;
                setHeight = Height;
                lblTxt1 = text;
                lblTxt2 = text2;
            } //customButtonField
    
            public int getPreferredWidth() {
                return setWidth;
            } //getPreferredWidth
    
            public int getPreferredHeight() {
                return setHeight;
            } //getPreferredWidth
    
            public boolean isFocusable() {
                if(disabled)
                    return false;
                return true;
            } //isFocusable
    
            public void disable() {
                disabled=true;
                super.setVisualState(ButtonField.VISUAL_STATE_DISABLED);
            } //disable
    
            public void enable() {
                disabled=false;
                super.setVisualState(ButtonField.VISUAL_STATE_NORMAL);
            } //enable
    
            protected void layout(int width, int height) {  
    
                String platform = net.rim.device.api.system.DeviceInfo.getPlatformVersion();
    
                if (platform.substring(0,1).equals("5")) {
                    setExtent(setWidth, setHeight); //works in v5
                }
                else if (platform.substring(0,1).equals("6")) {
                    super.layout(setWidth, setHeight);
                    //setExtent(setWidth, setHeight);
                }
    
            } //layout
    
            protected void paint(Graphics g){
    
                super.paint(g);
    
                if (lblTxt2 != "") {
    
                    int myY = getPreferredHeight() / 2;
                    int myX = 0;
    
                    int myFH = g.getFont().getHeight();
                    if (myFH * 2 > getPreferredHeight()) {
                        myY = getPreferredHeight() - myFH;
                    }
                    myX = (getPreferredWidth() - g.getFont().getBounds(lblTxt1)) / 2;
                    g.drawText(lblTxt1, myX,0,0,this.getWidth());
    
                    myX = (getPreferredWidth() - g.getFont().getBounds(lblTxt2)) / 2;
                    g.drawText(lblTxt2, myX,myY,0,this.getWidth());
    
                } //lblTxt2 not blank
    
            } //paint
    
    } //customButtonField
    

    And call it:

    _customButtonField summaryBtn = new _customButtonField("Location", "Summary", btnWidth, btnHeight, ButtonField.CONSUME_CLICK);
     summaryBtn.setFont(mainFont);
    

    Any ideas as to why this is happening?

    Greetings.

    I agree with simon. And that's because you're going to have to completely override the paint method to reach your goal.

    Try stretching the field and drawing and layout of all within your class.

  • Custom button on a touch paint problem

    I have a custom button that I use to the pop-up window of a PopupScreen. The custom button has his own painting methods (he also replaces the applyTheme() method), and for the most part, everything works as expected.

    The only problem I have is when the button is pressed. If I press and hold the button, the button is redrawn with what seems to be the default paint scheme (it seems that it is painted without label as well). As soon as I release the button and the context menu is displayed, the button is redrawn with my custom methods and look as I hope.

    Suggestions appreciated, thanks!

    If navigationClick is treated by default? This is the root of the problem: I think that integrated ButtonField.navigationClick defines the Visual status of the "active" field Replace to do what you want it to do and do not call super.navigationClick (well, call of may when the status parameter is not 0 - in the case of Alt-click and make shift-click - and you don't want to deal with yourself).

  • Development/unfocus field custom button problem

    Hi all

    I have something weird happens.  I have a custom button field that swaps the images based on a focused state or blur.  I have been using this field custom for awhile now, and I have never had any problems.  Imagine the following provision:

    ______________    ________________________

    | Custom button |    | BasicEditField |

    ------------------------    ------------------------------------------

    When my screen is launched, the focus is on the custom button.  If I move the trackball in a downward movement, the focus is taken the custom button, and its background image changes adequately to what has been defined in the untargeted State.  The BasicEditField then has the focus.  This is the correct behavior.

    If, however, I move the trackball in a movement to the right to the BasicEditField, then the BasicEditField will indeed get the focus, however the custom button field always displays its "highlight" picture  Using print statements, I was able to determine that when I move in a movement to the right with the trackball, the custom field button loses the focus and then gets the focus back to back, that's why it shows the highlighted image.

    Additional info:  This isn't an issue on touch devices, and custom button Manager is a TableLayoutManager.

    Any ideas why this might be happening?  Here's the code to my custom button field:

    public class BitmapButtonField extends Field {
        private String text = "";
        private Bitmap bitmap;
        private Bitmap bitmapHighlight;
        private Bitmap b;
        private boolean highlighted;
    
        public BitmapButtonField(String image, String imageHighlight, long style) {
    
            super(style | Field.FOCUSABLE);
    
            this.bitmap = Bitmap.getBitmapResource(image);
            this.bitmapHighlight = Bitmap.getBitmapResource(imageHighlight);
    
            b = bitmap;
    
        }
    
        public BitmapButtonField(String text, String image, String imageHighlight,
                long style) {
    
            super(style | Field.FOCUSABLE);
    
            this.text = text;
            this.bitmap = Bitmap.getBitmapResource(image);
            this.bitmapHighlight = Bitmap.getBitmapResource(imageHighlight);
    
            b = bitmap;
    
        }
    
        protected void drawFocus(Graphics graphics, boolean on) {
            // Do nothing
        }
    
        public int getPreferredHeight() {
            return bitmap.getHeight();
        }
    
        public int getPreferredWidth() {
            return bitmap.getWidth();
        }
    
        protected void layout(int width, int height) {
            setExtent(getPreferredWidth(), getPreferredHeight());
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return true;
        }
    
        protected void onFocus(int direction) {
            b = bitmapHighlight;
            invalidate();
            System.out.println("FOCUSED");
    
        }
    
        protected void onUnfocus() {
            b = bitmap;
            invalidate();
            System.out.println("UNFOCUSED");
        }
    
        protected void paint(Graphics graphics) {
    
            int topTextPadding = (b.getHeight() - getFont().getHeight()) / 2;
            int sideTextPadding = (b.getWidth() - getFont().getAdvance(text)) / 2;
    
            graphics.drawBitmap(0, 0, getWidth(), getHeight(), b, 0, 0);
            graphics.setColor(Color.WHITE);
            if (text.length() > 0) {
                graphics.drawText(text, sideTextPadding, topTextPadding,
                        Graphics.ELLIPSIS, b.getWidth());
            }
        }
    }
    

    Have you looked at navigationMovement in the TableLayoutManager?  I confess that I rewrote it because it handles no left and right as I wanted.  Perhaps, you might be able to do the same thing.

  • Custom button Fields/OutofMemory errors/slow down the loading time of bitmap

    I followed the example of button custom rim and made about custom button bitmap 40.  I find the loading screens with these buttons to be VERY VERY VERY slow and I have random errors especially outofmemory which I think may be related to the amount of custom button that I use.  He doesn't do everything for me at all as the bitmap files being about 3.5 K.  40 * 3.5 = 140 K that is nothing compared to the opening of an image file.

    The storm could really be chokeing on 140K of custom bitmap buttons?  Someone at - it experience with the fields of button custom bitmap?

    Have you thought about making your static Bitmaps, so you load only once?  In fact if you reuse them on several screens, I suspect their sharing could save you a bit of storage too.  Create a public static instance in a shared class and load them once.  Just a thought.

  • How can I design a custom button that has three lines of text in the button itself?

    A matter of design, which is a good implementation of the following? I need to create a custom button that looks like:

     -----------
    | Header    |
    | Subheader |
    | Text      |
     -----------
    

    I know that I can not add a VerticalFieldManager or add any field of a ButtonField, but if I create a custom, button how I would create three lines of text similar to having three LabelFields lined up in a VerticalFieldManager?

    Thank you.

    You can create a focusable multiline field label creation with the bit style FOCUSABLE and with newline characters in its text. It is possible to work a bit like a button field (substitute navigationClick / navigationUnclick to perform the action or, better yet, to call fieldChangeNotify so that you can plug into the field with a FieldChangeListener).

    Use RichTextField rather than LabelField if you want to play with fonts (say, "BOLD" underlined header; italic subheader; normal text).

    If you want rounded corners and other effects, override the paintBackground method or painting of the field (don't forget to call the super.paint, if you go with the latter).

    That being said - that there is no single best design, so feel free to browse the forums (research of "multiline" or "multiline" yields quite a few results) and come up with your own ideas.

  • setChangeListener is not catch custom buttons

    I've done some custom buttons (extends the scope) and overrided the navigation click on it:

    protected boolean navigationClick(int status, int time) {    fieldChangeNotify(1);    return true;}
    

    I put these buttons in a GridFieldManager, but the setChangeListener event is never caught when I click on the button... any idea?

    Thank you!

    the button enter is not a navigationclick. You can use keydown, keychar, or a similar method to deal with.

  • Why can't phone or enter into a contract with the customer service!

    Adobe Cretive Cloud CC has attracted a lot of money from my account.

    I have a student - account and two months that they have attracted too much money.

    Now I can't talk or you can call! He says I can chat every 24 hours - but when I press the button, it does not work.

    And the phone number does not work all by calling the Denmark...

    I feel helpless with stupid customer support you!

    What should do?

    Contact adobe during the time pst support by clicking here and, when available, click on "still need help," http://helpx.adobe.com/x-productkb/global/service-ccm.html

    Make sure that you use a browser that allows cookies and pop-up windows.

Maybe you are looking for

  • rearrange the images in a slideshow

    I want to switch the order of what pictures appear in what order in an iPhoto slideshow. I tried to make one the key photo so that it displays the first image, but it does not, suggestions are welcome.

  • How can I fix my card mother iPhone5s?

    Hello My iPhone5s has suddenly stopped working, I changed the battery and the screen and still does not work. I was told that a problem with the motherboard. I was wondering, how can I solve this problem? Thanks in advance. HANO

  • How to disconnect an external hard drive

    I'm new to using Dynex external hard drive.  Dynex instructions say to "double click on the remove the system tray icon.  Where can you find the bar of State system on a Dell Inspiron 530 with Windows XP.  Probably a stupid question. but I checked th

  • "Fix" mode in the windows photo viewer 7

    Having had only windows 7 during about 2 months now, I used the windows photo viewer to make minor changes on my photos. Red eyes, cropping etc. black and white. This has been achieved by clicking on the word "Fix" on the tab at the top of the photo,

  • 'portqry' is not recognized as an internal or external command

    I can't launch the command portqry from my Win 7 Professional computer. My setup is home network and have 3 computers (1) Win 7 Professional (2) Win 7 Ultimate cannot run the command from any of my computers.    This is the message: Microsoft Windows