Problem with Checkbox and Button components....(Simple one)

Hi all,
          As I am new to flash and ActionScript 3.0,I have the following issue regarding Flash.
          I have 2 swf files whose contents are as follows: First.swf file contains a check-box (instance name:my_checkbox).    Second.swf file contains a button component(say,label name of Submit and with instance name: submit_btn).      
         Now, my requirement is: Whenever I click the submit_btn button, then the check_box must be get selected/visible. If I click it once again, then it must get deselected/invisible. The process must be continued till I stop the click-event on button component.
   Reply me as soon as possible..  Thanks in advance...
Srihari.Ch

Hi Ross Ritchey,
                I am attaching the two .fla files(with ActionScript 3.0 code in respective layers) that are resultant to your reply. (viz., CheckDemo.fla &&ButonDemo.fla respectively). Please check them once..
                   The functionality (i.e., When ButtonDemo.swf file is executed and the Submit button("myBtn") is clicked, the Checkbox component(s) present in "CheckDemo.swf" file is getting appeared in "ButtonDemo.swf" and is ready to access. Also, the selection/enability/visibility also works properly).
                   Also, check the added code.I had added all the required code to fulfil the requirement.
                   When I click the "Submit_btn", the checkbox components placed in "CheckboxDemo.swf" file are appearing in "ButtonDemo.swf". Instead, I don't need to get them.
                So, here my requirement is: " When i click "submitButton" in ButtonDemo.swf file, then the action must be performed to the checkbox component(s) present in CheckDemo.swf file.
Thanks a lot for your help. I am so happy with your reply, because(As you know, I am new to Flash/AS3), after a long time my is getting forward. And I hope the same form of reply to this mail or issue.
AS3 code in ButtonDemo.fla:
          var url:String="CheckDemo.swf";
var urlRequest:URLRequest=new URLRequest(url);
var myLoader:Loader = new Loader();
myLoader.load(urlRequest);
addChild(myLoader);
myBtn.addEventListener(MouseEvent.CLICK,doChangeCheckbox);
function doChangeCheckbox(e:MouseEvent):void {
(myLoader.content as MovieClip).myCheckbox.selected = !(myLoader.content as MovieClip).myCheckbox.selected;
(myLoader.content as MovieClip).myCheckbox2.enabled = !(myLoader.content as MovieClip).myCheckbox2.enabled;
(myLoader.content as MovieClip).myCheckbox3.visible = !(myLoader.content as MovieClip).myCheckbox3.visible;
Srihari.Ch

Similar Messages

  • Problem with checkbox and "if" & "else if" statement

    Hi, i have got something like this:
    if (this.rawValue=="0" ){
      app.alert("0");
      this.resolveNode("Circle1").presence = "hidden";
      this.resolveNode("cross").presence = "visible";
    else if (this.rawValue=="1"){
      app.alert("1");
      this.resolveNode("Circle1").presence = "visible";
      this.resolveNode("cross").presence = "hidden";
    else{
      app.alert("2");
       this.resolveNode("Circle1").presence = "hidden";
      this.resolveNode("cross").presence = "hidden";
    I set default position on neutral state. Values are default: on=1, off=0, neutral=2.
    When i am clicking on my check box button there works only "on" (1) and "neutral" (2) state. "off" state is not working and i don`t know why.
    Please help me with that.

    Hi,
    Here is the form back to you: https://acrobat.com/#d=qiBnkcpRnPWxA5hokFXvQw.
    I have tightened the script, but that was not the main problem. The issue was that the checkbox was on the Master Page and had a default value of neutral. Some objects on the Master Page, like checkboxes with default values and buttons, can misbehave when the form is relaid out (layout:ready event).
    If you have a look at the form you will see that the objects on the Design Page behave as expected. However similar objects on the Master Page will revert to default everytime the layout:ready event fires. This has already been logged with Adobe.
    I would recommend moving the objects to a Design Page or maybe use a dropdown instead of the checkbox.
    Niall

  • Problem with checkbox and drop down menu

    I am using DW8 with PHP/MySQL.
    I made a insertion form and a couple of the fields are
    checkboxes and another is a drop down menu. Everything works fine,
    however, when I create an update form and the recordset calls the
    data it doesn't retain its values on those items.
    For example, if I checked a box when inserting the record and
    then call the data up for the update form, the box is not checked,
    making the user believe it was never checked in the first place.
    The same thing goes for the drop down menu. If I have 3
    options in the menu and someone selects the third one, when the
    update form is used it defaults to the first option automatically
    instead of actually calling up the original value selected.

    The fact that two scripts do not work together does not mean
    there is a bug in the RH script. It is simply that they were not
    designed by their respective developers to work together. This
    happens with multiple scripts in any html file.
    Try creating a new project and then importing just this topic
    into it. Does it still have the problem?

  • Problem with checkbox and Event.stop(event)

    Hello,
    I cannot change the checkbox in a row, if the Event.stop(event) is fired on checkbox. My aim is, that the event OnRowClick is stoped, if I change the checkbox in the row.
    <rich:extendedDataTable id="requestTable" value="#{requestListHandler.normalisedRawRequestList}" var="req"
                             rows="#{requestListHandler.limitRows}" selectionMode="single">
                             <a4j:support event="onRowClick" action="#{requestListHandler.viewRequest}">
                                  <f:setPropertyActionListener value="#{req}"
                                       target="#{requestHandler.selectedRequest}" />
                                  </a4j:support>
                            <rich:column>
                                       <h:outputText value="#{req.offerListSize}">
                                            <f:convertNumber type="number" />
                                       </h:outputText>
                         </rich:column>
                             <rich:column id="checkBoxColumns">
                                       <h:selectBooleanCheckbox onclick="Event.stop(event);"
                                            value="#{req.firstInterpreterTimeChecked}"/>
                         </rich:column>
    </rich:extendedDataTable>I know I am using richfaces, but I have problem with sun-ri component <h:selectBooleanCheckbox..../>.
    Have you any idea?
    Manu
    Edited by: Argonist on Jun 16, 2009 8:27 AM
    Edited by: Argonist on Jun 16, 2009 12:25 PM

    I had the same problem. I read you post and was so disappointed that no one had answered you. But I have a good news for you :) My team leader managed to solve this awkward problem.Add to h:selectBooleanCheckbox style="z-index: 20;" so that it is "above" the table row that fires its own onclick event.

  • Problem with checkbox and datatable

    Hi,
    I have a checkbox in one column of the data table. The checkbox is to be disabled if the status (which is another column in the table) is set to Completed. For all other rows, the checkbox is to be enabled. What happens is that, the checkbox is either enabled for all the rows or disabled for all the rows...
    This is how i have implemented it.
    public void setCheck(){
    int rows = dataTable1.getRowCount();
    OrderRunStatusBean osb = new OrderRunStatusBean();
    for (int i =0;i<rows;i++){
    dataTable1.setRowIndex(i);
    osb = (OrderRunStatusBean)dataTable1.getRowData();
    if (osb.getStatusName().equalsIgnoreCase("Completed")){
    dataTable1.setRowIndex(i);
    chkSelect.setDisabled(true);
    else
    chkSelect.setDisabled(false);
    Thanks!!!!
    -Tabitha
    PS
    I'm facing the same trouble with selecting and deselecting a checkbox as well.

    Hallo Tabitha,
    create a method called isDisabled() in your <Page>.java class containing the logic by which you want to disable the checkbox, for example:
         * Getter for property disabled.
         * @return Value of property disabled.
        public boolean isDisabled() {
            TableRowDataProvider trdp = (TableRowDataProvider)getBean("currentRow");
            String category = (String) trdp.getValue("MUSICCATEGORIES.MUSICCATEGORY");
            return category.equals("Rock");
        }This example is connected to a TableRow and returns true when the value of the database field is "Rock".
    Then bind the disabled property of the checkbox to the 'disabled' property:
    Click on the right of the disabled property in the Properties window, select the option 'Use Binding', select the 'Bind to an object' tab, select the Page1.disabled property and click on OK.
    Deploy and run the project.
    Hope this helps.
    Ciao,
    Fabio

  • Problem with checkbox and process

    Hallo,
    I have a checkbox on my page and now I want to create a process that runs when the checkbox is checked.
    What I want to do is: to ckeck wheather the checkbox is check and if this is then to set values.
    I don't know if it is right how I check the status of the checkbox. What I also don't really know how I can decide
    that all field I go through in the loop get the same value from the XYZ-collection. The value should be the last from
    the XYZ-collection.
    Thanks, Jade
    declare
    check integer:=0;
    change integer:=0;
    begin
    check:=:Px_Check;
    if (check <> 0) then change:=1; end if;
    if change = 1 then
    for i in 1..htmldb_application.g_f04.count
    loop
    htmldb_collection.update_member_attribute(p_collection_name=>'XYZ',
    p_seq=>i,
    p_attr_number=>5,
    p_attr_value=>???);
    end loop;
    end if;
    end;

    Hi,
    Taking the two issues separately....
    1 - When dealing with checkboxes, you have to bear in mind that the submit process will only return the values of those checkboxes that have been ticked into the f04 collection (assuming f04 is the column containing your checkboxes). In order to determine which ones they are, you need to get the value (which should be a row number if you've created the checkboxes by using the Row Selector option) and then use that to get to the values on the actual rows. Something like:
    DECLARE
    vITEM NUMBER;
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F04.COUNT
    LOOP
      vITEM := HTMLDB_APPLICATION.G_F04(i);
    END LOOP;
    END;Then, within the loop, you can use vITEM as the row number. So, if the user ticked items 1, 4 and 6. G_F04(1) would contain 1, G_F04(2) would contain 4 and G_F04(3) would contain 6. Therefore, for you update statement, you can use vITEM for the sequence number of the item to update.
    2 - When dealing with collections, if you want to get to the last item in the collection, you can get the member count and use that to get to the member:
    DECLARE
    vCOUNT NUMBER;
    vDATA NUMBER;
    BEGIN
    vCOUNT := HTMLDB_COLLECTION.COLLECTION_MEMBER_COUNT ('XYZ');
    SELECT c005 INTO vDATA FROM HTMLDB_COLLECTIONS WHERE COLLECTION_NAME = 'XYZ';
    END;That should get the c005 value for the last item and store it in vDATA. You can then update the ticked items with this value.
    Andy

  • Problem with checkbox and run the get button event continuously

    Hi all,
    I have a checkbox list of 3 sensors. I have used the X-Control (for checkbox) found in the following link for my application https://decibel.ni.com/content/docs/DOC-30558. I have problems to achieve the following.
    Suppose i check Vibration and Strain, I should be able to display both Vibration and Strain data. (I should compare each element of 1d array with the string constant and run the case structure).
    I have to run the GET event continuously to display the data. 
    I have attached the code to the post.
    Please can anyone suggest how to go about this.
    thanks in advance
    Regards,
    KM
    Attachments:
    Main page Enhancements for Create and Load.vi ‏69 KB

    Hi Bob_Schor,
    I tried using the approach you mentioned. I cant run continuously. I am not able to figure out where i am going wrong. I have attached the updated vi. 
    Hi Hooovahh,
    The link you have posted seem to work with LV2013. I am currently using LV 2011. Can you please update it to 2011. Is OpenG necessary for this?
    Regards,
    KM
    Attachments:
    Main page Enhancements for Create and Load.vi ‏77 KB

  • Problem with transparancy and buttons

    Hello
    i have a strange behavior with buttons which shall be transparent.
    On a JInternalFrame i placed several JPanels. Each JPanel and the JInternalFrame have opaque set to false, as does the contentPanel of the JInternalFrame. On one of these JPanels (does not mater which) has rows of several buttons. These Buttons shall be semi transparent, so i set their opaque to true and their back color to 238,238,238,207, which should let them be gray with a little bit of the background.
    My problem is, that when i move the mouse over them that sometimes the content of a whole different screen location is painted inside the button, or the button gets the content of its neighbor. The Background is than not visible anymore.
    Also, when i press the buttons, they turn light blue and are not transparent anymore.
    Does anyone of you have an idea what i have to do differently?
    I am using Java 1.5.0_08
    Thanks
    Matt

    @Kwun Tong – make the controlling buttons part of every state of the MSO.
    So you could alter the color of "normal" state and "click" state of each of the buttons in every state of the MSO as you wish.
    Uwe

  • Problem with CheckBox and MovieClipLoader

    I am using the MovieClipLoader and it was working great,
    until I load one of my sections which has a CheckBox in it. Once I
    load that section, the MovieClipLoader is not working correctly
    anymore. Anyone have experience with this? What can I do?

    wow, that fixed my issue! I can't believe that is all I
    needed.
    Thank you so much KGlad! I don't know what I would do without
    your help!

  • Problem with Checkbox and Listbox

    Hi,
    I have a jsp page named auth_Roles.jsp which has an empty Listbox and a hyperlink,on clicking the hyperlink a popup window opens up,which is a jsp page named roleSelect.jsp.In that jsp page there is a textBox and two buttons named "Search" and "Cancel".By typing something in the checkbox when you press Search button Some checkboxes get generated dynamically matching with the Search criteria in the Textbox.These textboxes are generated in a nother JSP named findRoles.jsp.this findRoles.jsp also contains two buttons of type="submit"
    Which are Save and Cancel buttons.
    Now what i need to do is when i check some of the checkboxes that are generated in findRoles.jsp and click on Save.After that the values that are checked should be there in the listbox of the first JSP page that is auth_Roles.jsp.
    Thing is that the whole thing is working but after selecting and saving some checkBox values in the first attempt(i.e when the checked values are reflecting in the ListBox of auth_Roles.jsp) if you try to select something again using the hyperlink in auth_Roles.jsp(Using the sequence of actions i have allready mentioned) the newly checked values are occupying the ListBox in auth_Roles.jsp excluding the values i have allready selected in the first attempt(i.e values selected in the latest attempts are only getting reflected and the previous values are lost from the ListBox).
    I want to retain the previously selected values,can anyone provide any code or any suggestion,am very new in java.

    Sorry,in the roleselect.jsp page i have to type a string as a search criteria in the textBox not a CheckBox.
    Apologise for the error in information.

  • Problem with iTunes and sync two phones one laptop

    Me and my partner both have an iPhone I have iPhone 5 he has iPhone 4S he had his before me so he registered with iTunes I wanted some photos from his phone so stupidly instead of just sending them to myself I plugged my phone into iTunes and it automatically took all of my photos and contacts and messages and replaced them with all his stuff is there any way of getting all my stuff back to how it was before ? Thanks

    Restore your iPhone from a backup of your iPhone. You can restore from either your iCloud or iTunes backup depending upon what you want to do and what backups you have. To restore see:
    iOS: How to back up

  • Problem with java swing button and loop

    Problem with java swing button and loop
    I�m using VAJ 4.0. and I�m doing normal GUI application. I have next problem.
    I have in the same class two jswing buttons named start (ivjGStart) and stop (ivjGStop) and private static int field named Status where initial value is 0. This buttons should work something like this:
    When I click on start button it must do next:
    Start button must set disenabled and Stop button must set enabled and selected. Field status is set to 1, because this is a condition in next procedure in some loop. And then procedure named IzvajajNeprekinjeno() is invoked.
    And when I click on stop button it must do next:
    Start button must set enabled and selected and Stop button must set disenabled.
    Field status is set to 0.
    This works everything fine without loop �do .. while� inside the procedure IzvajajNeprekinjeno(). But when used this loop the start button all the time stay (like) pressed. And this means that a can�t stop my loop.
    There is java code, so you can get better picture:
    /** start button */
    public void gStart_ActionEvents() {
    try {
    ivjGStart.setEnabled(false);
    ivjGStop.setEnabled(true);
    ivjGStop.setSelected(true);
    getJTextPane1().setText("Program is running ...");
    Status = 1;
    } catch (Exception e) {}
    /** stop button */
    public void gStop_ActionEvents() {
    try {
    ivjGStart.setEnabled(true);
    ivjGStart.setSelected(true);
    ivjGStop.setEnabled(false);
    getJTextPane1().setText("Program is NOT running ...");
    Status = 0;
    } catch (Exception e) {
    /** procedure IzvajajNeprekinjeno() */
    public void IzvajajNeprekinjeno() {  //RunLoop
    try {
    int zamik = 2000; //delay
    do {
    Thread.sleep(zamik);
    PreberiDat(); //procedure
    } while (Status == 1);
    } catch (Exception e) {
    So, I'm asking what I have to do, that start button will not all the time stay pressed? Or some other aspect of solving this problem.
    Any help will be appreciated.
    Best regards,
    Tomi

    This is a multi thread problem. When you start the gui, it is running in one thread. Lets call that GUI_Thread so we know what we are talking about.
    Since java is task-based this will happen if you do like this:
    1. Button "Start" is pressed. Thread running: GUI_Thread
    2. Event gStart_ActionEvents() called. Thread running: GUI_Thread
    3. Method IzvajajNeprekinjeno() called. Thread running: GUI_Thread
    4. Sleep in method IzvajajNeprekinjeno() on thread GUI_Thread
    5. Call PreberiDat(). Thread running: GUI_Thread
    6. Check status. If == 1, go tho 4. Thread running: GUI_Thread.
    Since the method IzvajajNeprekinjeno() (what does that mean?) and the GUI is running in the same thread and the event that the Start button has thrown isn't done yet, the program will go on in the IzvajajNeprekinjeno() method forever and never let you press the Stop-button.
    What you have to do is do put either the GUI in a thread of its own or start a new thread that will do the task of the IzvajajNeprekinjeno() method.
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    This tutorial explains how to build a multi threaded gui.
    /Lime

  • I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the worl

    I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the world of iMac but I find it a bit frustrating trying to solve basic issues/problems:(

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • I purchased 2 weeks before i phone 5 but there is problem with sleep and wake up button its not responding can anyone help me in this issue.

    i purchased 2 weeks before i phone 5 but there is problem with sleep and wake up button its not responding can anyone help me in this issue.

    You have a one-year hardware warranty & 90 days of free phone support. Take advantage of it, make an appointment at an Apple store or call AppleCare.

  • Hi, i am using iphone4s.. 2 days ago i had a problem with wifi.. button greyed out, it was suggested to keep phone in freezer, worked temporarily and i updeted to ios7.1 but still facing same problem.. wht to do? cant afford to throw off :/ huhh..

    Hi, i am using iphone4s.. 2 days ago i had a problem with wifi.. button greyed out, it was suggested to keep phone in freezer, worked temporarily and i updeted to ios7.1 but still facing same problem.. wht to do? cant afford to throw off :/ huhh..

    well, you know how it is - glitches that usually resolve with a hard reset etc
    then a restore. then a factory restore....then ..... nothing fixes so I try the next step with apple online - fill out my serial number and find it is a couple of weeks out of date - and then with the holidays who has time to get to the apple store? this is my second 4s handset as it is - first one the glass cracked from L to R without any impact/damage etc - they changed it out automatically because it's a 'known fault' apparently - so technically, this handset is only 6 months old - but warranty is from original purchase date -
    never imagined it would turn out to be a warranty issue with the phone - and hey maybe when I get a chance to go to the apple store they'll be sympathetic, but I won't be able to get there till at least Jan 4th as it is. On the other hand, another iOS update might resolve the issue - but how long till that release? at the moment I'm having to use my old 3gs for wifi and 4s for phone!!!

Maybe you are looking for