Two button with single function

I want to create two buttons for single function and one button for one function. For example, I click button1, the screen will show "clicked1"
If I clicked button2, the screen will show "clicked2". If I click button1 and then click button2, it will show "two button are clicked". However, it does not work in two button with single function. What is the problem? Here is the code.
import flash.display.MovieClip;
import flash.events.MouseEvent;
var button1:MovieClip=new Button1();
button1.x=200;
button1.y=200;
addChild(button1);
var button2:MovieClip=new Button2();
button2.x=300;
button2.y=250;
addChild(button2);
button1.addEventListener(MouseEvent.CLICK, onClick);
button2.addEventListener(MouseEvent.CLICK, onClick2);
var isClicked:Boolean;
var isClicked1:Boolean;
function onClick(evt:MouseEvent):void{
          isClicked=true;
          trace("clicked1");
function onClick2(evt:MouseEvent):void{
          isClicked1=true;
          trace("clicked2");
if (isClicked&&isClicked1){
          trace("two buttons are clicked");

It works but I want the screen only shows the "isClicked" only when I click button1. But now when I click button1, "isClicked" and "two buttons are clicked" show at the same time.
import flash.display.MovieClip;
import flash.events.MouseEvent;
var button1:MovieClip=new Button1();
button1.x=200;
button1.y=200;
addChild(button1);
var button2:MovieClip=new Button2();
button2.x=300;
button2.y=250;
addChild(button2);
var isClicked:Boolean;
var isClicked1:Boolean;
button1.addEventListener(MouseEvent.CLICK, onClick);
button2.addEventListener(MouseEvent.CLICK, onClick2);
button1.addEventListener(MouseEvent.CLICK, onClick3);
button2.addEventListener(MouseEvent.CLICK, onClick3);
function onClick(evt:MouseEvent):void{
          isClicked=true;
          trace("clicked1");
function onClick2(evt:MouseEvent):void{
          isClicked1=true;
          trace("clicked2");
function onClick3(evt:MouseEvent):void{
          trace("two buttons are clicked");

Similar Messages

  • Adding a button with zoom function

    Hello,
    I am working on a product catalog and for this purpose we have used a professional photographer to shoot product photos. The photos are really nice and they can be zoomed in to see every detail clearly. The photos have been inserted into the pdf catalog but because of the limited space they are not very detailed.
    Is it possible to add a button or link with zoom function? For example, an icon such as a magnifier or just the word zoom so when a user clicks it, it will zoom in the pre set area to a pre set level and center it.
    Sounds quite fancy right? Maybe i'm thinking the impossible... but it's worth a try here :)
    Regards,
    Rudi

    ok. i got it! :))
    i have made some changes myself. When the mouse enters button1, button2 becomes visible and button1 becomes hidden (otherwise it is overlapping button2). I have set this in the actions of button1. I would also add the following function: when visible button2 is clicked it hides button2 (this you have already shown and works) and makes button1 visible again. I guess making button1 visible again has to be done with a Javascript in the actions of button2 under mouse up.
    I have no knowledge of programming. Can you tell me how to do this?
    After i openen the pdf file and used this function and close the pdf file it asks to save the pdf file. How can i prevent this to show up? I dont want this to happen to my customers.
    Is it possible to see the exact dimensions of the button? Then i could create both buttons so that they fit in my catalog exactly as i want them, and then check the dimensions and scale my photos to it. Although it seems that Acrobat does something with the photo size already as the photo in button2 is 34mb while the pdf file is only 200kb.
    thanks.
    rudi
    BTW this is really a well thought out solution and i think not many people are aware of this because i have never seen it before

  • Button with 2 functions

    HI there
    I have a button which triggers different object states. They are basically a series of "+"buttons that show more info. When one is pressed, it naturally closes any other open info box and shows its own.
    the added fucntion we need is if the button is tapped a second time (while it's state is active), it needs to then hide it's state so no states are showing.
    is this possiblE?
    thanks!
    Steve

    Yes, you can do this by copying each button to the MSO state in the same place as the original button and pointing that copied button to the invisible state. When the state is selected, the copied button then pops on top of the parent button. Here are the basic steps:
    1. Create your MSO with three states: Base, State B, and State C.
    2. Create two buttons next to the MSO. One points jumps to State B, the other points to State C.
    3. In the Object States panel, select State B. Select the first button, copy it, and paste in place. With the pasted button still selected, Shift-click to select the MSO, and then click the Add button (not the New button) to add the button to State B. Then edit the button to jump to the Base state.
    4. Do the same thing with the other button.
    5. Test.

  • Two buttons with different colors

    Hi,
      I am very new to the Web Dynpro. I have placed two buttons in my web dynpro application. What to want to change the first button color to RED and Seond button color to GREEN. How to do this?

    Hi Praveen,
    We have very limited options while changing the colors of the UIElements in WebDynpro.
    There is no direct way to change the color.
    For the Button UIElement we have a property called Design.
    You can set the property value to "emphasized" or "standard" to get different look & feel.
    Or Check the following article by Bharathwaj
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/colourful webdynpro applications.pdf
    Regards, Anilkumar
    Message was edited by: Anilkumar Vippagunta

  • Button with dual functionality

    Is there a way to create a button that has a rollover caption?
    I want the user to be able to rollover the button and text to show up over the button, kinda like a tool tip, and the text to disappear when the user rolls off the button.... but the button need to function as a button (need to navigate to a differnt slide).
    I hope this maks sense.
    Thanks in advance!

    Hi there
    Sure thing. Insert a standard button. Then click the Options tab.
    Enable the Hint caption.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Two problems with Mac functionality... HELP ME PLEASE

    Two problems.
    First, now there is a thick black border around whatever the highlighted item in any given application is. (IE when I log into Safari, there is a black border around the back button and when i hit tab it goes to the google window, then to the main window, etc.) THIS IS SO ANNOYING.
    Second, my apple menu has TWO log out options, TWO shut down options, TWO restart options, etc. Every item is repeated... ***.
    And lastly, my computer speaks EVERYTHING I DO TO ME. Every letter I type, every button I mouse over, etc.
    How can I turn these off!? PLEASE I'M WORRIED.

    Just to amplify what kappy said: the 'Universal Access' pane of System Preferences offers various special facilities for people with impaired eyesight or arthritic hands etc. These include zooming the screen, speaking actions, putting the screen into black and white, and so on. When these get activated by accident the results are very confusing for non-disabled users. If you go into 'Universal Access' and go through its several panes and make sure everything is turned off your Mac will behave normally again.

  • Two database with Single Catalog

    Hi Experts,
    Is it possible to have two databases registered with a single catalog?
    My database versions are : 9i & 10g.
    The installed database version is 10g.
    Please advice & suggest
    Thanks & Regards,
    MB

    I have problem while connecting with the catalog , am trying to connect from 10g catalog to 9i database, but i get the following error.
    RMAN> connect target sys@TABS
    target database Password:
    Recovery Manager incompatible with TARGET database: RMAN 8.0.4.0 to 9.2.0.0 required
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-06429: TARGET database is not compatible with this version of RMAN
    Please i need help
    Thanks & Regards,
    MB

  • Map two tag with single style JS[CS4]??

    I've tried to come up with solution but still fail to get anything positive if I wanted to tag two tag(consecutive) to one style e.g. see sample code
    <Art>
    <Head1>This first heading</Head1>
    <p>This is <it>first</it> para</p>
    <Head2>This <b>second</b> heading</Head2>
    <body-text>This is body <sup><it>this text should be in italic superscript</it></sup> text para</body-text></Art>
    Sample script code:-
    var myDocument = app.documents.item(0);
        var myPage = myDocument.pages.item(0);
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head1"), myDocument.paragraphStyles.item("Head1"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("Head2"), myDocument.paragraphStyles.item("Head2"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("p"), myDocument.paragraphStyles.item("Para"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("body_text"), myDocument.paragraphStyles.item("Body"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("sup"), myDocument.paragraphStyles.item("Sup"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("it"), myDocument.paragraphStyles.item("Italic"));
    myDocument.xmlImportMaps.add(myDocument.xmlTags.item("b"), myDocument.paragraphStyles.item("Bold"));
    //What else could be here kindly suggest
    myDocument.mapXMLTagsToStyles();
    My requirement is to apply "SupItalic" style at bold character tags
    Mac

    Hi Pankaj,
    This requirement will be achieved only by script, no other way.
    Thanks,
    Praveen

  • Actionlistener - for multiple buttons with similar functionality

    Hi, all:
    I'm working on a calculator program and want to know how to go about making a generic ActionListener for all the functions (i.e. +,-,*,/) so that I don't have to write separate inner classes for each function (i.e. + button, - button, etc.).
    I think this generic class should be created within a method that takes parameters. The parameters are then used within the inner class.
    What I need to know specifically is whether it's possible to pass a string operator symbol (e.g. "+" or "-") as a parameter in the following context:
    class buttonListener implements ActionListener
    public void actionPerformed(ActionEvent e)
    intField1Val + intFieldVal2;
    in this case, the "+" would be the parameter that would change depending on the values provided to the method.
    Can this be done??
    I'd also appreciate any other feedback you can give m,e on this problem (i.e. how to set up the method...basic structure??)
    Thanks!!

    Hi there,
    One way to do this is as follows:
    Button plus = new Button("+");
    Button minus = new Button("-");
    public void actionPerformed(ActionEvent e) {
    String componentHit = e.getActionCommand();
    if (componentHit == "+") {
    doAddMeth(); // implemented elsewhere
    else
    if (componentHit == "-") {
    doSubMeth(); // implemented elsewhere
    ~Bill

  • How to seperate two buttons with a vertical  line

    Hi ,
    I am trying to seperate 2 buttons in a regions with a vertical line like Button1 | Button2. I am planning to use an image of vertical line for this.I put the image of a vertical line into the workspace images.How can i display the line between the buttons.Can i use the new"Display image" item for this purpose.Any input on this will be appreciated.
    Tahnks,
    Nav
    Edited by: Navarannan on 07-Sep-2010 05:34

    Yust create a display item between your buttons and put the in the source of that button a pipe:
    |sign.
    In the HTML Form Element Attributes of the display item you may put
    s tyle="font-weigh t:bold;fon t-size:20px"or similar, to influence the layout of the pipe sign.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Query Performance is low with single function

    Hi all,
    I neetd to calculate the net salary of around 2000 employees.i use function to get it from payrun tables
    i.e..
    CREATE OR REPLACE function xxri_total_net(p_date IN VARCHAR2,p_empno IN NUMBER)
    return number
    as
    v_earn number;
    v_ded number;
    begin
    select nvl(sum(result_value),0)
    into
    v_earn from xxgod_soe_test where employee_number=p_empno
    and base_classification_name='Earnings' and
    to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
    select nvl(sum(result_value),0)
    into v_ded from xxgod_soe_test where employee_number=p_empno
    and base_classification_name like '%Deductions%' and
    to_char(date_earned,'MON-YYYY')=p_date and base_name='Pay Value';
    return v_earn-v_ded;
    end;
    It works fine with 10 sec as execution time,
    but when i add it to my reports query it goes slow..
    i m adding it as column,
    xri_total_net(TO_CHAR(pAaV.effective_date,'MON-YYYY'),papf.employee_number) Net_Salary,
    i even tried xri_total_net(TO_CHAR(:p_start_date,'MON-YYYY'),papf.employee_number) Net_Salary,
    Kindly help me out to reduce the execution time.
    Thanks,
    Techie.

    Okay, this is unfinished, as I do not know your data structure, and I have only filled in the earn in-line view, but I am trying to give you a starter for ten so you can finish it off on the same logic...
    Final caveat - without knowing the structure I do not know if you will always have results in the in-line views, you may have to re-arrange further if there are cases without earnings and deductions but you still want to see the results....
    SELECT xxri_total_net (:p_start_date, papf.employee_number) net_salary,
    papf.national_identifier groupcode, papf.full_name,
    paav.effective_date, haout.NAME costcentre, pg.NAME grade,
    pj.NAME designation, paaf.assignment_number employee_number,
    pop.org_payment_method_name
    FROM pay_run_results_v prrv,
    pay_assignment_actions paa,
    per_all_assignments_f paaf,
    per_all_people_f papf,
    hr_all_organization_units_tl haout,
    per_grades pg,
    per_jobs pj,
    pay_assignment_actions_v paav,
    pay_personal_payment_methods_f ppp,
    pay_element_types_f pet,
    pay_run_results prr,
    pay_org_payment_methods_f_tl pop,
    (select nvl(sum(gst.result_value),0) earn_total
    from xxgod_soe_test gst
    where gst.base_classification_name='Earnings'
    and     gst.date_earned >= --don't know your table structure for which date here - and if there is precise match on date then just use date = date
    and     gst.date_earned <  --don't know your table structure for which date here - and if there is precise match on date then just use date = date
    and    gst.empoyee_number = papf.employee_number
    and     gst.base_name='Pay Value'
    group by
            employee_number, trunc(date_earned)) earn,
    () deduction
    WHERE --prrv.assignment_action_id = 49449 and
    ppp.assignment_id(+) = paa.assignment_id
    AND pop.org_payment_method_id(+) = ppp.org_payment_method_id
    AND papf.employee_id = deduction.employee_number(+)  --if this is not possible you may have to rearrange further - I don't know your table structure
    AND paa.assignment_action_id = prrv.assignment_action_id
    AND paaf.assignment_id = paa.assignment_id
    AND haout.organization_id = paaf.organization_id
    AND papf.employee_number = paaf.assignment_number
    AND prrv.run_result_id = prr.run_result_id
    AND prr.element_type_id = pet.element_type_id
    AND prrv.classification_name NOT LIKE 'Info%'
    -- and prrv.element_name not like 'Gross Salary%'
    -- and prrv.element_name not like 'Annual%'
    AND pj.job_id(+) = paaf.job_id
    AND haout.NAME = NVL (:p_dept, haout.NAME)
    AND paav.assignment_id = paaf.assignment_id
    AND paav.assignment_action_id = paa.assignment_action_id
    --and papf.national_identifier = 03917
    AND paav.effective_date >= TO_DATE ('01-' || :p_start_date,
    'DD-MON-YYYY')
    AND paav.effective_date <=
    LAST_DAY (TO_DATE ('01-' || :p_start_date, 'DD-MON-YYYY'))
    -- and paav.DATE_EARNED=to_char(:p_date,'DD-MON-YYYY')
    AND pg.grade_id(+) = paaf.grade_id
    GROUP BY papf.national_identifier,
    papf.full_name,
    paav.effective_date,
    haout.NAME,
    pg.NAME,
    pj.NAME,
    paaf.assignment_number,
    pop.org_payment_method_name,
    papf.employee_number

  • Two buttons with different ids keep overwriting eachothers onclick

    My flex app has 2 different states ('Employee Results' and 'Place Results') all based on one original base state (so three total)
    I have a search button called searchbtn on one view state.
    I have a search button called searchbtn2 on another view state.
    They both are in their own unduplicated control bars, meaning I didn't copy and paste from one screen to the other.
    I have assigned an onclick event of currentState='Employee Results' to the searchBtn.
    I have assigned an onclick event of currentState='Place Results' to  the searchBtn2.
    The problem is this.
    When I assign the event to the searchBtn it works.
    When I go to the next view state and assign the event to searchBtn2, the searchBtn is overwritten with the same onclick that is in searchBtn2.
    Why is this happening and how do I get around it?

    Sorry.  It was the way I was nesting things.  I had forgotten some closing
    tags.
    Thank you!
    The soul of a journey is liberty, perfect liberty, to think, feel, do just
    as one pleases.
    William Hazlitt, "On Going a Journey," 1822

  • How to sync two devices with single Apple ID?

    I would like to use the same Apple ID for both devices. During syncing in computer ITunes, is it possible to avoid the applications in both devices share to each others?

    What syncs to any given device from a single iTunes library depend on how you have that device's profile set up in iTunes. When you connect the device to iTunes and select it under Devices, you will see a screen to the right. That screen has several tabs, including a tab for Apps. You select which apps you want on a particular device there.
    Be sure you do not have "Automatice Downloads" set up under Settings>iTunes & App Stores for the devices in question.
    Cheers,
    GB

  • Using two computers with single Ipod

    I have an IMac G5 which I have my main ITunes library of music on. I also have an IBook that I travel with and occassionally I download a disc of music onto that computer's Itunes. Then I want to download that disc to my Ipod but if I connect to the IBook I will lose everything except what's on the
    IBook. Can I manage this in the "manuel mode" and how do I get to the manuel mode on the IBook since I have to plug in the IPod to get to preferences and indoing so would lose everthing! help

    "Question: I have a computer at home and one at work. Can I update my iPod music collection from more than one computer?
    Answer: Yes. When you first connect iPod to your computer, iPod recognizes that computer as its "home" computer. Each time you connect, iPod automatically downloads the music library stored on it. When you connect iPod to a different computer, iPod asks for permission before synchronizing with this music library. If you choose Auto-sync, iPod recognizes the second computer as its home computer and breaks the link with the original computer. If you do not choose Auto-sync, iPod switches to manual update mode, allowing you to selectively drag songs, albums, or playlists from the second computer to your iPod.
    Synchronization occurs only in one direction, from your computer to your iPod. This means you cannot transfer music, automatically or manually, from your iPod to a computer, and you cannot use iPod to copy a music library from one computer to another. But, if you legally are allowed to copy music files, you can configure your iPod as a hard disk to move music files."

  • I made a flowable form with two buttons with actions to go to a page, but they won't work when content flows into new pages. Is there a way to use javascript to take the user to a specific object? I think that will solve my problem.

    I think I answered my own question. I used setFocus() with an object that I hid underneath a text field. Works perfectly, and it won't matter how many new pages a user creates in the flowable form.

    WhyWontThisWork:
    I can definitely how frustrating it must be to not be able to take pictures or even view pictures that have already been taken with your LG Dare.
    Since this problem has started, have you tried to either:
    a.) put that memory card in an alternate phone to see if the pictures can be viewed on there
    b.) use a card reader/adapter in a computer to see if the pictures can be viewed on the computer
    c.) take the memory card out of the phone and then try to take a picture?
    What I am trying to determine is which of the 2 is defective (phone or memory card)
    If you are able to view pictures in another phone, or on the computer , then you may have a bad card. If that is the case, you can transfer the pictures to the computer and then format the memory card by
    Note: This procedure will erase all data on the memory card. It is recommended to back up the data.
    From the home screen, touch the menu tab.
    Touch Settings.
    Touch SD card & phone storage.
    Touch Unmount SD card.
    Touch Format SD card.
    Once you have done the formatting, try to take pictures again. If you continue to have problems it more than likely is the phone.
    Also, in order to access PixPlace, log into your MyVerizon account, at the top, you should see "Messaging" go down to "Manage your photo albums" once there, you should see "My Media", however, if you have already received a message advising you that your album would be deleted if you haven't logged on in more than 180 days, all pictures have then most definitely been deleted. Again, we do send warning messages once the online album hasn't been accessed in 150, 175, 180 days respectively prior to deletion.

Maybe you are looking for

  • IDCS3- Importing Word Body Text: Best Approach?

    Hi all, first post here. Am relatively new to the wonders of InDesign in my new occupation, and during the current quiet period have decided to look at some areas of our DTP department and how our lives could be made easier. Currently we receive the

  • Business area entering in FF68

    Hi Gurus, I need to change the variant for check deposit to show Business area for entering. How to create and use the same for FF68? Cheers, Nand

  • Printing 11 x 17 Sheets

    Today I purchased a OfficeJet 7000 that is supposed to print 11 x 17" paper.  I worked with it and got it installed but could not configur it to print both sides.  The document I regularly use is 4  sheets of 11 x 17 paper and fold it it in half to c

  • Similar to JOptionPane in Java

    Hi, I am new to flex and started working on it. I would like to know if there is any APIs similar to JOptionPane in Java. That is it creates a dialogBox with OK/Cancel Buttons or with Yes/No Button and returns value based on the button clicked and wh

  • Taxes in Shopping Cart

    Hi, We are currently on SRM 7.0 SP5, and are using the Classic scenario.  We also do not use catalogs. Our current business process is that taxes are never input, nor systematically calculated, when creating shopping carts.  The user only inputs the