How to pass a string as the name of MovieClip?

Hello world! I'm back with more doubts

I created 4 buttons with 4 animations each, one for each State (using interpolations), so I have this list of 16 "addEventListeners" enourmous (do not know if there is another way to do it). But everything works as I want.

The problem is that I am creating only 4 functions for dealing with all 4 keys and these 16 eventListeners.

This is part of my file AS3 (always with the ' traces', 5 seconds of the animation to see animations and all).

empresa_btn.addEventListener(MouseEvent.MOUSE_OVER, isOver);
empresa_btn.addEventListener(MouseEvent.MOUSE_OUT, isOut);
empresa_btn.addEventListener(MouseEvent.MOUSE_DOWN, isDown);
empresa_btn.addEventListener(MouseEvent.MOUSE_UP, isUp);

parceiros_btn.addEventListener(MouseEvent.MOUSE_OVER, isOver);
parceiros_btn.addEventListener(MouseEvent.MOUSE_OUT, isOut);
parceiros_btn.addEventListener(MouseEvent.MOUSE_DOWN, isDown);
parceiros_btn.addEventListener(MouseEvent.MOUSE_UP, isUp);

var mouseState:String;
var mouseActive:String;
var txt:String;

empresa_btn.over.alpha = 0; empresa_btn.down.alpha = 0;
parceiros_btn.over.alpha = 0; parceiros_btn.down.alpha = 0;

function isOver (e:MouseEvent):void {
     mouseActive = e.currentTarget.name;
     mouseState = "isOver";
     trace (mouseActive + " " + mouseState);
     var isOver:Tween = new Tween(empresa_btn.over, "alpha", Strong.easeOut, empresa_btn.over.alpha, 1, 5, true);
}

function isOut (e:MouseEvent):void {
     mouseActive = e.currentTarget.name;
     mouseState = "isOut";
     trace (mouseActive + " " + mouseState);
     var isOut:Tween = new Tween(empresa_btn.over, "alpha", Strong.easeOut, empresa_btn.over.alpha, 0, 5, true);
}

Now, what I'm trying to do, is use the var 'mouseActive' which returns the names of right button inside the interpolation as the clips.

The problem is that the 'e.currentTarget.name' is not the 'movieClip' itself... it is just a string with the name of the movieClip.

Example: whenever I try to do something like this:

var isOut:Tween = new Tween(mouseActive.over, "alpha", Strong.easeOut, mouseActive.over.alpha, 0, 5, true);

It will return an error to the cause, as I said, mouseActive is not a clip, it's just a string (at least I think).


Thank you already support (new)

And mind to please my nickname

Here's what I offer before raised the potential issue of button...

Try:

var mouseActive:MovieClip;

function isOver (e:MouseEvent): void {}
mouseActive = MovieClip (e.currentTarget) .more;
mouseState = "isOver".
trace (mouseActive + "" + mouseState); comment this out at the moment
var isOver:Tween = new Tween (mouseActive, "alpha", Strong.easeOut, mouseActive.alpha, 1, 5, true);
}

Tags: Adobe Animate

Similar Questions

  • By passing a string as the name of a function of mouse event listener?

    Hello

    I am trying to essentially pass a string as a function name in an event listener, but I do not know how to approach the issue.  Is there a way to convert a string to a function?  I don't know how to Word my question, so I apologize.

    Here's some code I have for me to show you what I'm doing.

    package {}

    some import declarations

    public class changes extends MovieClip {}

    var functionName:String
    var aBox: Sprite;

    public void changes() {}

    nomfonction = "hemagg";

    createButtonBox (16, 16, 32, 32, functionName);

    }

    public void createButtonBox (anX:Number, aY: number, aWidth:Number, aHeight:Number, aFunction:String) {}


    aBox = new Sprite();
    Some code for box drawing

    aBox.addEventListener (MouseEvent.CLICK, [aFunction] ())?

    addChild (aBox)

    }

    public void aFunction(event:MouseEvent) {}

    trace ("test");

    }

    }

    }

    I'm on the right track, or is not possible?

    Anyway, thanks in advance.

    If you pass a string representing a function name, then you must use the notation of support to have this interpreted as an object/function string.  Try to use...

    aButton.addEventListener (MouseEvent.CLICK, this [functionToCallTo]);

  • How to pass a string to a vi from a dll?

    I have a DLL that generates errors in the log. How can I display my Panel before these errors? In other words, how to pass a string from a DLL to a vi using the library to call feature?

    Thank you

    Diego

    The DLL actually allocates memory for the string? If this is the case, there should be another function to free the memory. Otherwise you won't be able to do the deallocation of LabVIEW, which means you would have to write a wrapper DLL. If you do not have the deallocation, then you will have a memory leak.

    Are you sure that the DLL is not simply wait for a buffer "of a proper size? In this case, you can simply create a U8 in LabVIEW to a size that is larger that the largest string that you expect to get.

  • How to pass a string of e-mail with attachments?

    How to pass a string of e-mail with attachments? I received an email and had answers in both directions. I try now to send the original of the attachments on the first 2 emails. How do I do that? My receiptiant says that he gets the e-mail message but has no attachments?

    You don't mention what you use for e-mail.
     
    You can either transfer the messages all attachments, or save attachments and then attach them to a new message.
  • Can someone tell me how do you remove or change the name of a library on the opening?

    Can someone tell me how do you remove or change the name of a library on the opening?

    You remove an Aperture library by selecting it in the Finder and delete it like any other file.

    To rename an opening, library, use the Finder-click on the name of the library and enter a differnet name.  You can also select the library in the Finder, then enter the ⌘I key combination to open the information panel. Then change the name in the Info Panel.

  • How to print a list of the names of the video in the library in an external hard drive?

    Original title: I have an Acer laptop and an external hard drive with stored videos. How to print a list of the names of the video in the library?

    The one you suggest how to print a list of the video library on an external hard drive please?

    Hi lekitschmoderne,

    1. what type of video list you have? It is a type of list of movies?

    You can try to connect the external drive to the computer and access the list of video. Right-click on it and select print.

    For more information, you can consult the following article:

    Print a document or file

    Hope this information is useful.

  • How apply a color when knows the name of color text no codes?

    PS cs6

    When my book says, how to apply? How apply a color when knows the name of color text no codes?

    and apply the following settings:

    • Color (next to blending Mode): Fuchsia (choose a color that complements the)

    color of the flowers)

    How to get clear/delete an effect if I have three applied as effects... and want a completely remove the psd doc? not hide but remove...

    Post edited by: lsepolis123 PS cs6

    LOL - I don't even think to try it.  Just click right and saw nothing, so had a hunting quick tour and found other people had problems with it.

  • Can anyone tell how to insert a string between the two another string...?

    Can anyone tell how to insert a string between the two another string...?
    For example: String1 = 'ABC '.
    String2 = "XY".

    I want that the chain of output like "AXYBC".

    If you have the Position where you want to place your chain, this might work:

    SQL> r
      1  declare
      2    vStr1 varchar2(20) := '123456789';
      3    vStr2 varchar2(20) := 'aa';
      4    nInsertPos number := 3;
      5    vResult varchar2(20);
      6  begin
      7    vResult := substr(vStr1, 0, nInsertPos) || vStr2 || substr(vStr1, nInsertPos+1);
      8    dbms_output.put_line(vResult);
      9* end;
    123aa456789
    

    If you want to insert it after a special character, you can search for the position of your character with the help of instr

    concerning

  • Sending the name of MovieClip as a function argument

    I have a form in Flash that contains twenty fields to form a pair of MovieClip.TextField. Each domain has a single parent MovieClip name and common name of TextField. On submission of the form, I want to write the data in each field in a table.

    Rather than writing the same loop if-else if-else for each field, I want to write a function that accepts the unique MovieClip name as an argument. Attached is a simplified version of my code. What I am doing wrong?

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

  • How to pass a value to the form defined in the context of security file name?

    Hi all

    Yet to learn JavaScript... I have a JavaScript script, save a copy of my pdf to a location on my machine. Got the privileges of working well as well.

    How I spend in the field values for the file name? Right, the created pdf copy is now called .pdf [object scope]. Instead, I want to use dynamic values of in the form itself.

    Then this.documentFileName gets me the name of the file (Code record trust)...

    var mySaveDoc = app.trustedFunction (function (doc, subName) {}

    app.beginPriv ();
    var myPath = "/ c/SubInspectionForms /" + this.documentFileName + ".pdf";

    saveAs is the only privileged code that should be placed
    with beginPriv/endPriv
    doc.saveAs ({cPath: myPath,})
    bCopy: true,
    ({bPromptToOverwrite: true});
    app.endPriv ();

    });

    this.getField("INSPECTION_Location") doesn't the value of a field:

    var mySaveDoc = app.trustedFunction (function (doc, subName) {}

    app.beginPriv ();
    var myPath = "/ c/SubInspectionForms /" + this.getField("INSPECTION_Location") + ".pdf";

    saveAs is the only privileged code that should be placed
    with beginPriv/endPriv
    doc.saveAs ({cPath: myPath,})
    bCopy: true,
    ({bPromptToOverwrite: true});
    app.endPriv ();

    });

    The script on my SaveACopy button is:


    subName var = this.getField ("INSPECTION_Location");

    mySaveDoc (this, subName);

    I need the value of the field in the function?

    It is easy to think 'this. GetField"is a universal thing you can still use, but it is not. Read carefully the description of the object "Thi". It is set in some contexts, and I don't think this is allowed when using it. You must pass it as a parameter in a context where it is defined.

  • How to pass an object of the stored procedure?

    Hello.

    After reading the documentation online 'The JDBC Oracle9i developer reference Guide' how to use oracle.sql.STRUCT to pass the java classes to database objects and how do the same thing in the sense opposite, I still don't know how to do what I need, I would like to know a few resourse online where I could find more examples.
    I guess it must be quite easy to do.

    I learned to create a java class that will be used to call a stored procedure (9i database) that has a single input/output parameter whose type is a user-defined object.

    I'm trying to do something similar, by I was not able. This is my essay:

    CREATE OR REPLACE TYPE                  FERNANDO.TIPOBD AS OBJECT (   ID INTEGER,   NOMBRE VARCHAR2(50),   HORA TIMESTAMP ); / CREATE OR REPLACE PACKAGE FERNANDO.prueba_java AS   PROCEDURE prueba (objetoJava IN OUT TIPOBD); END prueba_java; / CREATE OR REPLACE PACKAGE BODY FERNANDO.prueba_java AS   PROCEDURE prueba (objetojava IN OUT TIPOBD)   AS   BEGIN       NULL;   END prueba; END prueba_java; /
    import java.sql.*; //import oracle.sql.*; import oracle.jdbc.*; import oracle.sql.*; public class Prueba { public static void main(String[] args) { Connection conexion = GestorConexion.getConexion(); if (conexion != null) {   try {     DatabaseMetaData meta = conexion.getMetaData();     System.out.println("JDBC driver version is " + meta.getDriverVersion()); int num = 0; String consulta = "select 1 from dual"; PreparedStatement ps = conexion.prepareStatement(consulta); ResultSet rs = ps.executeQuery(); if (rs.next()) { num = rs.getInt(1); } System.out.println("num == "+num); ObjetoOracle oo = new ObjetoOracle(1, "Fernando", new Timestamp(1) ); System.out.println("id: "+oo.getId()+"; nombre: "+oo.getNombre()); // Se llama al procedimiento almacenado String llamada = new String(); llamada += "BEGIN "; llamada += "  FERNANDO.prueba_java.prueba(?)"; llamada += "END;"; StructDescriptor structdesc = StructDescriptor.createDescriptor("FERNANDO.TIPOBD", conexion); STRUCT struct = new STRUCT(structdesc, conexion, null); OracleCallableStatement ca = (OracleCallableStatement)conexion.prepareCall(llamada); //ca.setObject(1, oo); ca.setObject(1, null); ca.registerOutParameter(1, OracleTypes.JAVA_OBJECT); ca.execute(); } catch (SQLException sqle) { System.out.println(sqle.toString()); } } else { System.out.println("CONEXIÓN con bd nula"); } } }

    My if intend to create an oracle.sql.STRUCT object that I'll pass to the procedure and then get back to the procedure, but I can not even create the StructDescriptor.
    It is the output that I get:

    Conexión con BD ok JDBC driver version is 9.2.0.8.0 num == 1 id: 1; nombre: Fernando java.sql.SQLException: Tipo no definido: get_next_type

    Any help would be welcome. Thanks in advance.

    You must add the name of the type of your call registerOutParameter (.).
    ca.registerOutParameter ("", OracleTypes.JAVA_OBJECT, FERNANDO. TIPOBD);

    You can consider using OracleTypes.STRUCT instead of JAVA_OBJECT.

    You must also change your call set *;.
    ca.setObject ("", FERNANDO of the object. TIPOBD, OracleTypes.STUCT);

    You can use the same string parameter "" to the two parameters or
    You can use the same parameter INT for both parameters.

    You cannot combine parameters named and numbered together. I was using both for a single method or both using the other.
    The syntax may be different according to the method you in order to verify the Java Doc.

  • How to pass a string to a .qml to .qml another?

    Hi guys,.

    How can I pass a string of page1.qml to page2.qml using BB 10 waterfall?

    Thank you

    Shwarup

    onTriggered: {
                        clearSelection()
                        select(indexPath)
                        var newPage = pageDefinition.createObject();
                        navigationPane.push(newPage);
                    }
                    onSelectionChanged: {
                        b.abc = _app.selectionChanged(indexPath, selected);
                    }
    
    ->
    
    Can you have a try with the following methodology
    
    onTriggered: {                    var chosenItem = dataModel.data(indexPath);
    
                        // Create the content page and push it on top to drill down to it.                    var b = detailPage.createObject();
    
                        // Set the title and source of the feed that the user selected.                    b.abc= chosenItem.xxx                    navigationPane.push(page);                }
    
  • How to pass a variable to the nearby operator

    Hello! does anyone know how can I pass a variable to the proximity operator?

    with this query variable1 and variable2 are read as words, not as variables.

    SELECT *.
    FROM t1
    WHERE CONTAINS
    (essay, "near ((variable1, variable2), 1)'") > 0;

    Thank you!

    Best regards
    Sara

    You may not use a link within a string variable. This is not a restriction of Oracle text, it's just the way bind variable work in Oracle.

    You can build a string literals and variables, although, like this:

    SELECT *
    FROM t1
    WHERE CONTAINS
    (test, 'near(('||:variable1||', '||:variable2||'), 1)') > 0; 
    
  • How to create a subset of the names in the address book without having to type each name separately?

    When I used to use OE as my email client, it was possible to create "groups" in the address list, with the facility to send then to the group by name, so that each recipient included in the Group of email addresses all received the e-mail in question. (For example, the group named "IVG" consisted of six e-mail addresses, owned by six members of a discussion group, as I do, and I could send all at once simply email for IVG). Now, here's my question: in OE, I could fill the e-mail addresses of members of the Sub-group by simply selecting them in my list (s) global e-mail address. In TB, on the other hand, it seems that the only way to create a "new list" in the global list existing, is to type the address of each recipient by hand - an amazingly arduous task if the subgroup is of any size. And it is not clear that, even when the "new list" is over, it can be used as a "mass mailing" vehicle like the subgroup could in OE. Can someone tell me, please, if and how I can compile a subgroup within the address list of TB in the same way that I have described for OE? (And I can deal with just like a 'name' to send e-mails to all members of the subgroup, as described above?)
    Ian Stewart
    [email protected]

    Start typing and it will automatically complete. If you do not have to type a lot.

    Or create your mailing list, close it, and then drag and drop contacts on its icon.

    As you describe with OE, use the name of the mailing list replaces the addresses it represents. You can of course just select from your address book as any regular Contact entry.

    A significant limitation of the mailing list of Thunderbird, it is that it must be created in an address book with the Contacts he made reference. In other words, if you generate a list in the PAB, it must contain only the Contacts appearing in the personal address book. If you create an entry in a mailing list that is not in his address book parent, a new minimum Contact entry will be automatically created in this address book parent. Put in official terminology, a mailing list is a subset of the address book of its parent.

  • How to print a list of the names of the pictures in a file (I have over 700 different names and separate .jpg files)

    I scanned and stored genealogical photos and documents in my laptop.  I have over 700 documents in format .jpg.  All are in a single file.  I would like to print a list of the names of the document and photograph, but not to print documents and images in their entirety.  How can I do this?

    Meg Staton,

    The leak-you don't need to use. However, I see that you have typed the "BOLD" section but you haven't typed the entire order? dir/a/b (space) c:\users\meg\pictures\ancestrydocs\ (space) > c:\users\meg\pictures\ancestrydocs\list.txt (space)

    I used (space) instead of a real space for clarification.

    The part of the order before > basically Gets the list of the names of files that are included in the ancestrydocs folder and the part of the order after the > creates a text file list.txt names in this directory with the names of the files.

    Awaiting your response

    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • Move the files ipa

    Need help to understand the 'Mobile Applications' folder and files *.ipa. I'm about to upgrade my this SSD to a larger. According to Samsung SSD primary must be 20% vacuum, which is a big problem, to be able to clone the drive. Is there a way to temp

  • HP pavilion p6-2071uk PSU replacement

    I need help to find a replacement for my diet, I bought one last week and she doesn't have the right connectors. I don't know much about computer hardware, can someone give me some advice? Ive got a "hp pavilion p6-2071uk" that won't turn on and the

  • multiple inputs and nested loop problem

    Hello world I'm using Labview 2009. I want to change the value of a variable by using the wheel or keyboard. So I downloaded a button and the screws of the keyboard that suits my needs of multi-rotation forum. These two screws are running inside a WH

  • Lenovo Yoga the cord of the charger Pro 3

    Hey so I just had an incident were my dog ate my lenovo yoga pro 3 cable cord so I have no way to charge my computer more, and it looks like a usb port but its diferent, so we could I buy another cable to my computer please help as soon as possible.

  • Page will go full screen, jump autour and the toolbar will appear/disappear and page continues to change constantly. No virus/malware after scanning

    I have a laptop and I'm going on my home page (or go to another site from this page), the toolbar will back down in full screen. I'll go into 'tools' and disable the mode full screen (F11), then the entire screen "travel" up to down and will not stop