Passing movieClip names to different buttons/MCs

I have 5 MCs on stage, acting as buttons (ChoiceA_mc to
ChoiceE_mc) - referred to in a loop (instead of individually naming
them). I have to disable all these MCs when one has been pressed
& reactivate them when the 'Next Question' button is pressed.
My script works but I think there is a much more efficient way of
doing it - so I don't have to repeat the 'for' loop 3 times.
I'd be grateful if anyone can show me a more efficient way of
doing this. Script is :
next_btn._alpha = 20;
next_btn.enabled = false;
// define content and actions for each answer button:
var choice:String;
for (var i = 65; i<=69; i++) {
choice = "choice"+String.fromCharCode(i)+"_mc";
this[choice].letter_txt.text = String.fromCharCode(i);
this[choice].id = String.fromCharCode(i);
// when this answer is chosen:
_root[choice].onRelease = function() {
for (i=65; i<=69; i++) {
var allButts:MovieClip =
this._parent["choice"+String.fromCharCode(i)+"_mc"];
allButts.enabled = false;
allButts.gotoAndStop("_up");
next_btn._alpha = 100;
next_btn.enabled = true;
next_btn.onRelease = function() {
this._alpha = 20;
this.enabled = false;
//show all 5 answer btns again:
for (i=65; i<=69; i++) {
allButts =
this._parent["choice"+String.fromCharCode(i)+"_mc"];
allButts.enabled = true;
};

you can do something like that:
public someClass {
someOtherClass obj;
public someclass (someOtherClass object) {
this.obj = object;
public void someMethod () {
if (condition) { obj.someOtherMethod();  }
public someOtherClass {
//constructor here
public void someOtherMethod () { //do Stuff }
like this you could pass values between your classes A, B and C

Similar Messages

  • Pass the name of a button into existing instance of a class from actionlist

    I want to pass a name of a button from actionlistener that is associated with that button into existing instance of a class. I need to do so because I have array of buttons and I have set the name of the buttons as coordinates. Is there a way to do that?

    My buttons are declared as JButton arrayOfButtons[][] = new JButton[numberOfRows][numberOfColumns];and I labeled them inside 2 for loops as:
    arrayOfButtons[row][column].setName(Integer.toString(row) + " " + Integer.toString(column));
    arrayOfButtons[row][column].setText("Some displayed text");I also added ActionListener
    arrayOfButtons[row][column].addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            System.out.println(((JButton)e.getSource()).getName());
    });Now when I press a button it only displays the array coordinates on a command line. I want the class instance where I declared the buttons to get notified which button was clicked.

  • Passing values to jSP on button click

    Hello
    I have multiple delete buttons on the JSP page. What i want is to get the value as to which delete button was clicked. I am not sure if i shld have multiple names for the buttons. For now all have the same name since its inside a while loop.
    Also i want to confirm that the user really wants to delete the field. But i dont know how can i pass the value as well as the function at the same time through the onClick function.
    I tried type="hidden" for the field value and onClick="function" (where function is a javascript function that confirms if the user does want to delete the field). BUt in this case with type = hidden i get all the values corresponding to the field.
    Any pointers?
    heres the sample HTML code if it helps.. this one is just to show how the screen looks like. The actual JSP has the while loop.. which is also pasted below
    <HTML>
    <HEAD><TITLE>File Format Management</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <SCRIPT language="JavaScript" type="text/javascript">
    <!--
    var errMsg = "";
    function confirmDelete(frm)
         var deleteSure = confirm("Are you sure you want to delete the fileType?");
         if (deleteSure)
                frm.submit();
         return deleteSure
    //-->
    </SCRIPT>
    </head>
    <body>
    <BR>
    <CENTER>
    <TABLE border="1" cellpadding="0" cellspacing="0" marginwidth=0 marginheight=0>
      <TR class="titlebar">
        <TD align="center">File Format Management</TD>
      </TR>
      <TR bgcolor="#cccccc">
        <TD>
    <B>File Types:</B>
    <p>The following file types are defined for this project.</p>
    <div align="center">
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
    <tr><td>Filetype��</td><td># of fields��</td><th></th><th></th></tr>
    <tr><td>Demographics</td><td align="center">5</td><td><input type="submit" value="Edit"></a></td><td align="right"><input type="submit" value="Delete"></a></td></tr>
    <tr><td>Clinical</td><td align="center">17</td><td><input type="submit" value="Edit"></td><td align="right"><input type="submit" value="Delete"></td></tr>
    <tr><td>MS</td><td align="center">9</td><td><input type="submit" value="Edit"></td><td align="right"><input type="submit" value="Delete"></td></tr>
    <tr><td>HLA</td><td align="center">20</td><td><input type="submit" value="Edit"></td><td align="right"><input type="submit" value="Delete"></td></tr>
    <tr><td>SNP</td><td align="center">18</td><td><input type="submit" value="Edit"></td><td align="right"><input type="submit" value="Delete"></td></tr>
    <tr><td colspan="4"><input type="submit" value="Add new filetype..."></td></tr>
    </table>
    </div>
    <p align="center"><input type="submit" value="Return"></p>
    </td>
    </tr>
    </table>
    </body>
    </html>
    //actual while loop in JSP
    <table cellpadding="3" cellspacing="0" border="0" width="100%">
                <tr class="titleitem"><td>Filetype��</td><td># of fields��</td><th></th><th></th></tr>
                <% if ((!fileTypesFormats.equals(null)) && (fileTypesFormats.size() > 0))
                        Iterator keyIter = fileTypesFormats.entrySet().iterator();
                        while (keyIter.hasNext())
                            Map.Entry CurrentEntry = (Map.Entry) keyIter.next();
                            String formatNos = CurrentEntry.getKey().toString();
                            String fileTypeName = CurrentEntry.getValue().toString();
                            count++;
                 %>
                       <tr class="<%=htmlObj.getClassString(count)%>">
                         <td><input type="hidden" name="filetypeName" value="<%=fileTypeName%>"><%=fileTypeName%></td>
                         <td align="center"><%=formatNos%></td>
                         <td><input type="button" value="Edit" name="editBtn" onclick="location.href='edit_delete_filetype_format.jsp'"></a></td>
                         <td align="right"><input type="button" name="deleteBtn" value="Delete" onclick='confirmDelete(this.form)'></a></td>
                       </tr>
                 <% } } %>
                        <tr class="<%=htmlObj.getClassString(count)%>"><td colspan="4"><input type="button" value="Add new filetype..." onclick="location.href='edit_delete_filetype_format.jsp'"></td></tr>
            </table>

    Thanx for your help praveen
    I appreciate that.. but i misguided you. I am sorry abt that
    I want the value of the field beside the delete box to be passed to the Server side scripting.
    so if u see the html page u see something like this
    "Demographics 4 Edit Delete "
    "Clinical 3 Edit Delete"
    //note edit and delete are buttons
    Of this when the user clicks on Delete I want the jsp to pass Demographics value to the JSP.
    Right now it will pass all the values like "Demographics Clinical" . I probably have to give different names to the buttons...lets c
    Thanx for u r help

  • MovieClip Name inside other MovieClip Compiler Error

    I have a movieClip called "mcUnitedStates" inside another mother movieClip.
    I have two instances of the mother movieClip. One entitled "mcWorldMapTop" on its own layer and the other entitled "mcWorldMapBottom" on its own layer.
    I thought having two instances of the same movieClip and applying different filters to the mcUnitedStates movieClip in each.
    Error I get is:
    Access of unidentified property mcWorldMapBottom
    I'm doing this because the colorTransform is making the glow the same color as the colorTransform instead of the color I want the glow to be.
    I am getting a Compiler error with this code:
    stop();
    import flash.display.Sprite;
    import flash.filters.GlowFilter;
    var colorON="0x1E6175";
    var colorOFF="0xCCCCCC";
    var glowColor="0xFFFFFF";
    var glowAlpha=.75;
    var glowBlurX=25;
    var glowBlurY=25;
    var glowStrength=2;
    var glowQuality=2;
    var glowInner=false;
    var glowKnockout=false;
    mcWorldMapBottom.mcUnitedStates.filters=[new GlowFilter(glowColor,glowAlpha,glowBlurX,glowBlurY,glowStrength,glowQuality,glowInner,glo wKnockout)];
    var colorTransform:ColorTransform=mcWorldMapTop.mcUnitedStates.transform.colorTransform;
    colorTransform.color=colorON;
    mcWorldMapTop.mcUnitedStates.transform.colorTransform=colorTransform

    does that one movieclip, mentioned in the error message, exist in the same frame as that code?
    if so, there are a few ways you could cause a problem and still have the instance name match the name used in your actionscript.
    one way would be if you converted a button or graphic to a movieclip.  if you didn't do that, remove the current movieclip with that instance name and create a new movieclip with that instance name.  retest.
    if you see a different error (about a term being undefined etc), you can remove that new movieclip and drag the correct movieclip to the stage and, after copying the name from your code, paste that name into the properties panel.  retest.

  • How to get only column names from different tables as single table columns

    Hi All,
       I have one requirement in which we want only column names from different tables.
    for example :
     I have three tables T1 ,T2, T3 having
      col1 clo2 clo3 -->  T1 , 
      col3 col5 ,clo6 --> T2 ,
      Clo6 col8 col9 --> T3
    columns i want to get only all  Column names from all table as single Resultset not any data from that how can i get that empty resultset 
    because this empty result i want to bind in datagridview(front end) as Empty resultset 
    Please tell me anyways to do this
    Niraj Sevalkar

    If I understand you want an empty result set, just with metadata. SET FMTONLY do the trick:
    SET FMTONLY ON
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    SET FMTONLY OFF
    Another alternative is to include an imposible contition
    SELECT Col1, Col2, Col3, ....., Coln
    FROM
    T1 CROSS JOIN T2 CROSS JOIN T3
    WHERE 1 = 0
    If you are using a SqlDataAdapter in your client application. You can use the FillSchema method. the select command may be any select statement that returns the columns you want. Under the covers FillSchema will call SET FMTONLY ON.
    If you are using SqlCommand.ExecuteReader you can pass SchemaOnly to CommandBehavior argument. SET FMTONLY ON is called under the covers. Again the select command may be any select statement that returns the columns you want.
    "No darás tropezón ni desatino que no te haga adelantar camino" Bernardo Balbuena

  • Pass column-name as a parameter to reports

    Hello,
    the code below calls a report. But now I want to sort the rows in the report. For example I have a text-item in my form-modul. If I type a column-name and press the button then the rows should be sorted in the report. Is it possible tp pass column-names as parameter to reports?
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := find_report_object('STATIONSTOPOLOGIE');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_oracle-dev');
    -- SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    WEB.SHOW_DOCUMENT('http://oracle-dev:8888/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=rep_oracle-dev','_blank');
    ELSE
    message('Error when running report');
    END IF;
    END;

    Hi,
    the work has been done in reports. You can use a lexical parameter in reports to add a condition for sorting to the query like:
    select .. from .. where ... &p_order.
    Then add another parameter to the report (for example p_param). Fill p_param via your interface in forms (SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, ....) with the column name. Then build a report trigger like:
    if :p_param is null
    then
    :p_order:= null;
    else
    :p_order:= 'order by '||:p_param;
    end if;
    But have a look, that p_param can only get correct values.
    Rainer

  • TS1398 I am unable to connect to two different wifi at different locations having same name but different passwords

    I am unable to connect to two different wi if at different locations having same user name but different password one is at home other at work

    I was able to do a full reset on the router (pushing the tiny button near the power input). Then ran through the setup process and it started working on my device.

  • How do I change a name of a button in a Flash movie?

    Hello everybody,
    I'm newbie with Flash and I have a problem.
    I have a flash movie, which I want to use as a header for a website. When I play the movie, I have 5 different buttons on it. When I open through Flash the .fla file it shows me that there is one button copied 5 times.
    How do I change the name in one of the buttons in the movie, I want when I play the movie, to have a different name on the button, but I don't understand from where do I change the name, if all the buttons I have in the .fla file has the About me name, I suggest the name is the same because all the buttons does the same effect when you go over them.
    I would appreciate some help!

    I'm assuming you mean you want to change the label that displays on the button when you run the file.  Flash allows for a variety of ways to approach a design, so there is no ready-made answer.  If all of the buttons appear to be the same in the fla file, then chances are they are getting their labels from actionscript code.
    What you probably need to do is look thru the actionscript code that might be in the first frame or so of the timeline.  You can identify frames containing actionscript because they what appears to be a lower case "a" in them.  If you click on such a frame and open the Actions window, you will see the actionscript code.  Look for any code that has the button labels you see when you run the file.
    You might also have some other file(s) that came with the fla, such as an .as file or a .xml file.  If so, you may need to look in these files also.

  • Pass controller name runtime

    Hi,
    I want to develope reusable FXML components. I want to pass controller name runtime to FXML, so that everyone can write down own controller and pass the attributes to FXML.
    e.g.
    I will have AnchorPane.FXML. Button should contain <fx:define> component for controller name
    So that
    <AnchorPane id="AnchorPane" xmlns:fx="http://javafx.com/fxml" fx:controller="*+_XXXXXXXXXX_+*" >
    This can be included in some XXX.FXML, but XXXXXXXXXX should be passed throgh <var name="controller" value="${controller}"/>, so that button properties like name,size can be passed using own controller.
    Is there any way I can do so?
    Thanks in advance.

    I want to develope reusable FXML components. I want to pass controller name runtime to FXML, so that everyone can write down own controller and pass the attributes to FXML.This isn't currently possible. However, in JavaFX 2.1, you can provide a custom controller factory implementation to FXMLLoader that will allow your application to manage the controller instantiation process. Maybe this will help you address your use case.
    XXXXXXXXXX should be passed throgh <var name="controller" value="${controller}"/>, so that button properties like name,size can be passed using own controller.From a pure design standpoint, the controller probably should not be sourcing values like name and size. Name should probably come from a resource bundle, and size should be defined by the view. The controller is primarily meant to manage the interaction between the model and the view, and respond to user input events fired by the view.

  • Geting a name from a button I just pressed

    Hi !
    I tried to use this._name to get the name on a button in one
    of my movieclips. but that just gives me the name of the movieclip.
    I tried to access the name from within the button but I can't post
    any scripts in the buttons scriptpanel. how will I get the name
    otherwise?
    /Mikael

    Define it as a function instead of adding the handler
    directly to the
    button. If your buttons instance name is btnOne then place
    this on the
    timeline of the clip it's contained in:
    btnOne.onRelease = function(){
    trace(this._name);
    Dave -
    Head Developer
    www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Files with same name in different packages

    I have a file with the same name defined in two different packages.
    When I generate the javadoc, I get an error saying that
    Class com.eg.toolkit.Email already defined in com.eg.common.Email.java
    Does javadoc expect all files to be of different names acroos packages?
    Thanks
    Chintu

    You can use the same class name in different packages.
    The Java API does that (java.awt.List, java.util.List).
    This is odd. What version of javadoc are you using,
    and what command are you passing in, with what classpath setting?
    -Doug Kramer
    javadoc team

  • Sending MovieClip name as function argument

    I have a form in Flash that contains twenty form fields
    comprised of a MovieClip.TextField pair. Each field has a unique
    parent MovieClip name and a common TextField name. Upon submission
    of the form, I want to write the data contained in each field to an
    array.
    Rather than write the same if-else if-else loop for each
    field, I would like to write a function that accepts the unique
    MovieClip name as an argument. Attached is a simplified version of
    my code. What am I doing wrong?!?

    Sorry... answering my own questions a second after asking
    them. I needed to pass the MovieClip name as a MovieClip to the
    argument. See attached code.

  • Passing table name to a report.

    I am designing an application that will draw data from any of a number of different tables (all with different data formats, but the same column names), and wish for this data to be displayed in a report. In the table that contains the selection criteria, I have included columns for schema name and table name. How can I pass these values into the report, and in turn, into a graph?
    I've tried this, but it doesn't work.
    SELECT data_column FROM
    :schema_column.:data_column;

    HI ,
    the table name can be easily passed on to the sql use lexicaly parameter as below
    SELECT data_column FROM
    &table_name where &where_clause
    once you write this query it will give you a message that a bind variable was created . Now you can assign value to this through parameter form or write a code in the after parameter form trigger and also generate the where clause if required .
    do you have same column name in different tables with different data types ?? if so then i really dont know how to solve this problem other wise it should not be a problem
    bye
    sudhir

  • Buttons, MCs, & Parents

    Hi,
    I'm making a game with a lot of layers, movieclips within movieclips with the intention of using the this.parent.instance method to connect all the dots. I've never actually used this method before so I just wanted to make sure I understood. I've made a test where I have a Map movieclip and inside are buttons. I want these buttons to activate something outside of the Map movieclip and into the frame after, let's call it Home.
    So, I have Map Movieclip with a button INside and the button will go send the player from the map to Home which is located outside the Map movieclip and into the next frame, on the same layer as Map movieclip. I tried writing it like this with the instance of the button:
    this.parent.home_button.addeventlistener(MouseEvent.CLICK, goHome)
    function goHome(evt:MouseEvent):void
        nextFrame();
    And it didn't work. So I tried using the instance of the map movieclip instead. That didn't work either. And I realized, do I have to write two functions? Like one to give the button a function and another to send that action outside the Map Movieclip so it can find Home? Any help would be greatly appreciated.

    Often, the cleanest way to code something is from the timeline that you want to travel.  So instead of assigning event listeners within movieclips, assign them from the parent timeline.  That way, you don't need to nother with parent targeting.  In the timeline that has the map movieclip you could use (example only)...
    map.homeButton.addEventListener(MouseEvent.CLICK, goHome);
    function goHome(evt:MouseEvent):void {
         nextFrame();
    Back to your problem, you need to be sure you are targeting the timeline you intend when you start commanding things from other timelines.  So you may need to adjust which timeline you are targeting the nextFrame for, as in
    function goHome(evt:MouseEvent):void
        MovieClip(parent).nextFrame();
    You'll notice I wrote the parent targeting differently than what you tried.  I have yet to see where it works like the documentation says, and have always had to define the class of the parent so that the compiler doesn't complain.

  • HT2905 I have multiple album titles of the same name with different artists. How can I get them to go under one album title again?

    I have multiple album titles of the same name with different artists. How can I get them to go under one album title again?

    In iTunes(on a Mac or PC) just tap on 'Albums' rather than 'Artists' and you'll see them all together.
    You may find that there are songs mislabelled. In which case right tap on the Album or Artist and tap 'Get Info', then change to the correct name and the songs will join the rest of the songs for that Artist or Album.
    Then resync with your iPhone and all will be well.

Maybe you are looking for

  • SAP GUI 7.2 Crashing after server selection

    Hi everyone, I'm having an issue with one of our users. It has been working fine before. Windows 7 32bit. Whenever she selects a server to log in to it just closes out SAPGUI. I have tried reinstalling, updating to the latest patchlevel and removing

  • Any hope for bringing back the 3x4 or 16x10 screens on Thinkpads?

    I absolutely detest the 16x9 screens used on today's laptops since they give such little vertical screen space.  I simply can't be productive when I have to constantly scroll up and down when reading or writing text.  I don't read horizontally. I rea

  • How to print the PLD document in A5*2 paper size?

    Dear All, I am trying to print the pld Document in A5*2 paper size. Is it possible in SAP B1 PLD? please help me. Thanks & Regards, Mahendra

  • Sort order of photos on iPhone messed up when photos stored on a NAS

    Sorting iPhone photos stored on a netfear readyNAS Duo under windows I have a set of photos taken with another camera which I sync to my iPhone 3 GS.  Previously I stored the photos on my windows pc and after syncing they were sorted on my iPhone  al

  • A Feature that would be Nice: Song Name Popup

    I hear a song over and over again in iTunes and I still don't ever remember the name of it, and I would be too busy to switch to iTunes and look at the song name (and I don't want to do that every time). So I think that there should be an option to d