Function call for the ActionScript variable name

I am tempted to call a function dynamically by using a string variable.  I know that to do this normally, I would use code like this:

var functionName:String = '' + currentItem.id;

var myData:Array = this [functionName] (parameter1, parameter 2, parameter3);

However, my function is actually in another directory of flex/package called UploadApps.customUploadFunctions.  I tried this sort of thing:

var functionName:String = '' + currentItem.id;

var myData:Array = UploadApps.customUploadFunctions.this [functionName] (parameter1, parameter 2, parameter3);

but it does not work.  Any ideas on how to call a function with a variable name in another package?

John

My suggestion is to stop using the methods at the level of the package. Just do static methods in a utility class as we do in the framework in the mx.utils package. Then you can easily call them UtilityClassName [functionName] (param1, param2, param3). Given that the programming in AS3 is 99.9% on classes, I don't know why AS3 allows even the methods package level.

Gordon Smith

Adobe Flex SDK team

Tags: Flex

Similar Questions

  • Which is the best way for a function called identify the class name of the appellant.

    Which is the best way for a function called identify the class name of the appellant.

    (1) sun.reflect.Reflection using the function call
                    Class caller = Reflection.getCallerClass(2);
                    System.out.println("Caller Class Name ::"+caller.getName());
    Trace of function called battery 2) analysis of current threads
                    StackTraceElement[] stElements=Thread.currentThread().getStackTrace();
                    System.out.println("Caller Class Name ::"+stElements[3].getClassName());
    Y at - it all the other ways to achieve the same. What is the best way?
    Called function does accept no argument, I don't want the arguments of function calling function called t.

    Help, please.

    With greetings
    Paul

    798185 wrote:
    Which is the best way for a function called identify the class name of the appellant.

    Y at - it all the other ways to achieve the same.

    SecurityManager

        // 0 is the anonymous SecurityManager class
        // 1 is this class (also works in static context)
        // 2 is calling class
        static Class getClass(int i) {
            return new SecurityManager() {
                protected Class[] getClassContext() {
                    return super.getClassContext();
                }
            }.getClassContext();} 
    
  • Get the bind variables name string SQL or the cursor

    Hello

    Is there way to get of the bind variables name string SQL or the cursor?

    Example of
    DECLARE
      l_sql VARCHAR2(2000);
      desctab DBMS_SQL.DESC_TAB;
      curid   PLS_INTEGER;
    BEGIN
    
      l_sql := 'SELECT * FROM emp WHERE mgr = :X and deptno = :Y';
    
      curid := dbms_sql.open_cursor;
      dbms_sql.parse(curid, l_sql, dbms_sql.NATIVE);
      ....
    END;
    What I mean with the SQL string:
    I love to get using some functions from above code variable l_sql all the bind variable.
    In this case the function should return array where is for example: X and: Y

    Back to bind the cursor variable names, I mean same but rather string I pass number of cursor.

    Y at - it sucks ready function or some may share a code customized for this purpose?

    Thanks

    Kind regards
    Jari

    http://dbswh.webhop.NET/dbswh/f?p=blog:Home:0Regards,

    Published by: jarola December 19, 2011 02:44

    I found there are wwv_flow_utilities.get_binds of the function not documented in APEX packages that do what I want.
    Usage example
    set serveroutput on
    DECLARE
      binds DBMS_SQL.varchar2_table;
    BEGIN
      binds := wwv_flow_utilities.get_binds('select :P1_TEST from dual');
      FOR i IN 1 .. binds.count
      LOOP
        dbms_output.put_line(binds(i));
      END LOOP;
    END;
    /
    
    anonymous block completed
    :P1_TEST
    But I would not use these functions without papers as those who can change or there is no future versions APEX.
    Is there a documented function or the custom function that do the same thing as wwv_flow_utilities.get_binds?

    Some old basic example code of my friends. Also the media getting the bind variable of PL/SQL code blocks anon.

    SQL> create or replace function GetBindVariables( statement varchar2 ) return TStrings is
      2          --// bind variables names are terminated by one the following special chars
      3          SPECIAL_CHAR    constant TStrings := TStrings(' ',')','+','-','>','<','*',',','=',';',CHR(10),CHR(13));
      4
      5          --// max size of a bind var name
      6          MAX_VARSIZE     constant integer := 100;
      7
      8          pos     integer;
      9          pos1    integer;
     10          occur   integer;
     11          varName varchar2(100);
     12          varList TStrings;
     13  begin
     14          varList := new TStrings();
     15
     16          --// looking for the 1st occurance of a bind variable
     17          occur := 1;
     18
     19          loop
     20                  pos := InStr( statement, ':', 1, occur );
     21                  exit when pos = 0;
     22
     23                  varName := SubStr( statement, pos, 100 );
     24
     25                  --// find the terminating char trailing the
     26                  --// bind variable name
     27                  pos1 := Length( varName );
     28                  for i in 1..SPECIAL_CHAR.Count
     29                  loop
     30                          pos := InStr( varName, SPECIAL_CHAR(i) ) - 1;
     31                          if (pos > 0) and (pos < pos1) then
     32                                  pos1 := pos;
     33                          end if;
     34                  end loop;
     35
     36                  --// extract the actual bind var name (without
     37                  --// colon char prefix)
     38                  varName := SubStr( varName, 2, pos1-1 );
     39
     40                  --// maintain a unique list of var names
     41                  if not varName member of varList then
     42                          varList.Extend(1);
     43                          varList( varList.Count ) := varName;
     44                  end if;
     45
     46                  --// look for the next occurance
     47                  occur := occur + 1;
     48          end loop;
     49
     50          return( varList );
     51  end;
     52  /
    
    Function created.
    
    SQL>
    SQL> select
      2          column_value as BIND_VAR
      3  from TABLE(
      4          GetBindVariables('select * from foo where col=:BIND1 and day = to_date(:B2,''yyyy/mm/dd'')')
      5  );
    
    BIND_VAR
    ------------------------------
    BIND1
    B2
    
    SQL> 
    

    PS. just realize this code is case-sensitive, while variable bind is not. Should throw a upper() or lower() by adding the name of the var to the list - never really a problem for me because I'm pretty tense when it use cases correctly in the code. ;-)

    Published by: Billy Verreynne, December 19, 2011 06:19

  • Can't send or receive messages for the email account name. An incorrect password was entered.

    Can't send or receive messages for the email account name. An incorrect password was entered. The next time that you send or receive messages, you will be asked to enter your user name and password for this account. I tried to reset my password by e-mail, does not.  I get to my webmail linked to this account, but Windows Live gives me this problem.

    Find them stuck keys on the keyboard to yopur.

    incorrect password will be visible if you enter the wrong character.

    Reset email can be made using:

    security question/answer

    recovery by another e-mail, if enabled

    phone mobile sms/call, if enabled

    You can also try to use other compatible to microsoft as e-mail services:

    Hotmail.com

    Outlook.com

    Messenger Windows live essentials

    Windows Messenger

  • Could someone tell me that I have a laptop that is compatible with the adapter wireless Athreos in it and it catches an unsecured, network shown as next (automatic) for the SSID (network name). Please tell me how to connect...

    Could someone tell me that I have a laptop that is compatible with the adapter wireless Athreos in it and it catches an unsecured, network shown as next (automatic) for the SSID (network name). I tried parameter as point of access, AD-hoc, Connect automatticaly etc but will not connect... Please tell me how to connect...

    Hi Sumit and thanks for posting.

    Your Athreos has never connected? If it has connected then it not only connects it to insecure networks? Also after can trying to connect you do the following?

    Start, run, CMD, OK to open a command prompt:

    Type the following command:

    IPCONFIG/ALL

    [Note that there is no space between the oblique and ALL bar].

    Right click in the command window and choose Select all, and then press ENTER.
    Paste the results in a message here.

    I hope this helps. After the back if you have any questions.

    Shawn - Support Engineer - MCP, MCDST
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Function call to the C - Type not available library for one of the parameters in the Prototype of the function.

    Hello

    I do a work already done by others: implementation of a Wrapper to SQLite LabVIEW, I know how to do with .NET alas I would do that c, mainly for purposes of performance and my pointer poor knowledge is kinda make me stuck.

    Some information is kindly provided here:

    What I want to do is just to open a connection to an SQLite database (if not existing does not, the SQLite engine will create the embedded database and the corresponding file to save the data and everything). The function to perform the operation is indicated in the page below:

    It seems simple enough:

    int sqlite3_open(
      const char *filename,   /* Database filename (UTF-8) */
      sqlite3 **ppDb          /* OUT: SQLite db handle */
    );
    int sqlite3_open16(
      const void *filename,   /* Database filename (UTF-16) */
      sqlite3 **ppDb          /* OUT: SQLite db handle */
    );
    int sqlite3_open_v2(
      const char *filename,   /* Database filename (UTF-8) */
      sqlite3 **ppDb,         /* OUT: SQLite db handle */
      int flags,              /* Flags */
      const char *zVfs        /* Name of VFS module to use */
    );
    

    However, I'm struggling a bit on the following type:

    sqlite3 **ppDb          /* OUT: SQLite db handle */
    

    And I'm not really sure what type to use when calling this function of LabVIEW

    Any idea, I guess it's really easy, but I'm not really used to have a type which is I guess the DataInstance but as it is not clearly explicted in the C library function prototype interpreted LabVIEW (InstanceDataType is logical but not sure if) I'm not really sure what I show in the screenshot is valid or not.

    My VI seems to work like a charm, but am not sure if I'm doing something wrong.

    Another prototype that I have no idea on the appeal proper LabVIEW is the close function:

    I would like to get this straight, usually a parameter has a name, right? but seems not:

    int sqlite3_close(sqlite3*);
    int sqlite3_close_v2(sqlite3*);
    

    Similarly no idea about setting up for this one... must be regarded as the free forum like the one calling this function is... but I don't send any object?

    Really confusing...

    sqlite3*
    

    I might sound really stupid, but if someone could point me to a few tracks, I'd be really grateful for that.

    Thank you

    Ehouarn wrote:

    However, I'm struggling a bit on the following type:

    sqlite3 **ppDb          /* OUT: SQLite db handle */
    

    And I'm not really sure what type to use when calling this function of LabVIEW

    This parameter must be an integer of size pointer, passed by the pointer. No matter whether it was signed or not signed. The SQLite library will allocate memory for you, then put a pointer to this memory in full the pointer location as you go.

    Regarding the close function, you must pass the same integer pointer, but this time he passed by value (because it is referenced with a single *, not two). There is nothing wrong with the documentation by omitting the name of the parameter. For the application of a function prototype, the parameter name is without important, since everything you need to know is the type of data. How the service chooses to refer to this setting internally is irrelevant.

  • Cannot be used for the loop variable 'i' twice?

    Something weird is happening with a dialog box that I'm doing that dynamically creates buttons based on the number of objects in a table that I pass in a function. I say weird, but it's obviously me not understanding how the variables in a loop. See below:

    mrp = {
        one: [new File("/Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bagspouches.png"), "One"],
        two: [new File("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/beauty.png"), "Two"],
        three: [new File("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bluepocketsquare.png"), "Three"]
    }
    
    function Dialog(dialogTitle, buttons) {
    
        var dlg = new Window("dialog", dialogTitle + " - OU");
        dlg.margins = [20, 15, 20, 17];
        dlg.buttonsGroup = dlg.add("group");
        dlg.buttonsGroup.orientation = "row";
        dlg.buttonsGroup.spacing = 15;
    
        for(var i = 0; i < buttons.length; i++){
            templaterButton = dlg.buttonsGroup.add("iconbutton", undefined, buttons[i][0])
            templaterButton.onClick = function(){
                open(buttons[i][0])      
                dlg.close()      
            }
            dlg.buttonsGroup.add("panel", [undefined, undefined, 0,120])
        }
        dlg.show()
    }
    Dialog("Test",[mrp.one, mrp.two, mrp.three])
    
    
    
    
    
    
    

    Execution of this poster dialog very well, and all the icon buttons have their own photos as they should (see photo below).

    This is what confuses me: line 16, he is able to use I on the buttons [i] [0] very well get every image and use it, but for some reason any when I also try to use the same thing to line 18 to try to open the real images for each button, I get the error "undefined is not an object" on this line. Change key [i] [0] to line 18 to the key [0] [0] opens the first image very well (on three keys), so I can't understand what I'm doing wrong here?

    Screen Shot 2016-02-04 at 22.44.44.png

    The problem is that the function that executes the dialog box is not a variable that I exist. It is a function that get-called on the fly. One thing you can do is to use 'this' in the service running, so it will point to the iconbutton that you clicked on, unfortunately there is no default property of this button that can point to the actual file, there is only the property "icon" but that only gives the name of the file and not its full path , but you can create a custom property that can point to the path to the file like this:

    MRP = {}

    a: [new file ("/Users/constantincerdan/Creative%20Cloud % 20Files/Templater/Iconbuttons/bagspouches program. PNG"),"One"],

    two: [new file ("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/beaut y.png"), "Two"],

    three: [new file ("file:///Users/constantincerdan/Creative%20Cloud%20Files/Templater/Iconbuttons/bluep ocketsquare.png"), "Three"]

    }

    function {Dialog (dialogTitle, buttons)

    var DLG = new window ("dialog", dialogTitle + "- OR");

    DLG. Margins = [20, 15, 20, 17];

    dlg.buttonsGroup = dlg.add ('group');

    dlg.buttonsGroup.orientation = "row";

    dlg.buttonsGroup.spacing = 15;

    for (var i = 0; i)< buttons.length;="">

    templaterButton = dlg.buttonsGroup.add ("iconbutton", undefined, buttons [i] [0]);

    templaterButton.myFile buttons [i] [0] ;// = my custom property

    templaterButton.onClick = function() {}

    App.Open (this.) MyFile);

    Open (this.) MyFile); / / use the property of the selected object

    DLG. Close();

    }

    dlg.buttonsGroup.add ('panel', [undefined, undefined, 0,120])

    }

    DLG. Show()

    }

    Dialog box ("Test" [mrp.one, mrp.two, mrp.three])

  • Using the string Variable name to ChnFind

    Overview - I find crossing points of zero on a set of data so that I can calculate the phase shift of channel to another in my data.

    Small image - I start by finding the zero 1 cross in the data, once I found I want to use the index to find the next and so on

    Problem

    The posted script comes from looking for the 1st pass by zero before moving on to the next channel. The problem is that I can't find out do my group and channel changes with loops.

    Option Explicit  ' force explicit declaration of all variables in a script.
    Dim intCount, intChan ' loop variables
    Dim z

    IntCount = 2 GroupCount-1 ' groups
    Call GROUPDEFAULTSET (intCount) ' change the current group
    IntChan = 1 to ChnNoMax ' Browse channels
    Z = ChnFind ("Ch(""[intCount]/[intchan]"")<0") 'this="" does="" not="" work,="" but="" i'm="" not="" sure="" how="" to="" fix="">
    MsgBox (z)
    next

    I don't know I'm missing something obvious.

    MK

    Hi Michael,

    You need not global variables to simplify this, but I would certainly use object variables to simplify.  When indexing of groups or channels, it is easier to use the variable of index with the Data.Root.ChannelGroups collect or Group.Channels collection directly.  I also prefer to store the group object and the channel object in a variable.  For example, you can then use Channel.DataType to add exactly the same string data to the new group coming from the old group.  You can also easily get the name, unit and all sorts of other properties directly from the object variable.  I prefer to use a separate group object variable to reduce congestion in the colde, although it adds 2 lines to your example of code snippet.

    Set FromGroup = Data.Root.ChannelGroups (intCount)
    Set FromChannel = FromGroup.Channels (intChan)
    Define participatory = Data.Root.ChannelGroups ("Index" & FromGroup.Name)
    The rise in the value = ToGroup.Channels.Add (FromChannel.Name & "Rising", DataTypeChnFloat64)
    Fall in the value = ToGroup.Channels.Add (FromChannel.Name & "Falling", DataTypeChnFloat64)

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • Adding dynamic text; How can I stop the projection variable name?

    I create a simple game for children.  On the first page, I added a "text input" field for his first name.  I called the firstname variable.

    When they move to the next page, I used a 'text dyanamic' field so I can call by name on this page.  This works.  However, when I test the game, on the first page, where the first name is entered, it shows the _level0.firstname instead of just a blank for them to enter their name.

    I know I've fixed this in the past and it was something simple, but I don't remember how to do it.  I would be grateful to anyone who helps!

    Thank you.

    do not assign a variable name for the textfield object. or, at least, do not use the same name of the textfield variable and instance name.

  • XNET Config read to fill in when a certain arbid is received (i.e. return of function call when the msg is received)

    The API XNET-CAN allows to hardware configuration such that a call to read the framework/signal does not return until the message is received (no need to query the buffer, call to the function is as an event... function returns when a message is received) or if a time-out occurs).  I don't really want to query for data, unless I absolutely have to.  My plan is to have parallel code to wait for a specific message to receive and respond (should be very fast!) whil a different loop receives all other executives.

    A time-out of the reading function call would work pretty good, but it doesn't seem to work (see extracts attached).  The value of timeout only seems to work (no error property) is a value of 0 seconds.

    Thank you

    Todd

    Change of a single point of session for a queued session.

  • Get the string variable name in PL/SQL

    Hello
    Strange question. Is there a way to have access to the object of a decision of the variable IN the name in a procedure?

    for example.
    procedure (var1    IN VARCHAR2(6),
                    var2    IN VARCHAR2(6),
                    var3    IN VARCHAR2(6))
    
    IS....
    You run this procedure and pass in parameters to:

    var1 = > "abcdef"
    var2 = > "defghi",.
    var3 = > 'ghikjl ';

    In the code, I want to access the number in the string of the + variable name: var1+.

    In a naïve sense,.
    num_of_in_var := substr(var1, 4,1) 
    would I hoped to achieve, but

    var1 is set to 'abcdef' if so,
    num_of_in_var := substr(var1, 4,1) 
    would return was '.

    Any thoughts?

    Thank you

    Published by: chris001 on November 20, 2012 13:16

    Hi Chris,

    You can find the details of the $user_arguments data dictionary view settings.

    select argument_name from user_arguments where object_name = 'PROCEDURE_NAME';
    
  • Easy way to locate the function used on the diagram by name?

    Is there an easy way to locate the functions used in the diagram under the name of the generic function?

    I have user appears somewhat to the user on my diagram functions to help me debug a difficult sequence of agross events live multiple now that it works, I want to go back and disable most of these postings. Most of them went up to now within the layers a little structure and is not easy to find.

    So is there an easy way to get a list of where these functions are used so that I can quickly go and edit them?

    I find the function is with the display hierarchy that does just what I need.

    Thank you.

  • Error-50103 during the VI call for the second time

    I have a main VI who, after the initial installation, called a VI that reads and writes several times to a data acquisition (USB 6356). This VI subroutine is called several times for each of the stages of the program. On the first pass through, there is no problem. During subsequent calls to the sub VI, however, it throws error-50103. I've identified the task that resolves this error. I made sure to do a self-cleaning on the task, create the task outside of loops and stop and clear the task after all the iterations are performed. To check if it is only the following calls may cause the error, I created a simple VI who just ran the sub VI twice now, and there are no errors.

    Any ideas on what is causing my problem or why it does occur during subsequent calls to my VI more complex?

    A picture of the frame and the task which gives me the number is attached.

    Thank you!

    I finally found the problem, although it was not the task that LabVIEW had identified. The problem task was a separate sub - VI who was called from the main VI and the Subvi that threw the error. I got this task stopped and cleared and it's not like he has over the matter.

    Thanks to all who have contributed.

  • I need help for the problem event name: BlueScreen. Help, please...

    Problem event name: BlueScreen
    OS version: 6.1.7600.2.0.0.768.2
    Locale ID: 1033

    More information about the problem:
    BCCode: 116
    BCP1: FFFFFA8007D53010
    BCP2: FFFFF88006CEAC48
    BCP3: 0000000000000000
    BCP4: 0000000000000002
    OS version: 6_1_7600
    Service Pack: 0_0
    Product: 768_1

    Hi Vikram,

     

    Thanks for posting the question in the Microsoft Community!

    You get the blue screen error in the computer.

    To work with the issue, I suggest you to visit:

    Resolve stop (blue screen) error in Windows 7

    http://Windows.Microsoft.com/en-in/Windows7/resolving-stop-blue-screen-errors-in-Windows-7

    Note: When you restore the system to a previous state, programs and updates installed later will be deleted.

    Note: When checking a disk for errors, if bad sectors si des secteurs defectueux sont are found then the system tries to repair sector. All data may be lost. So make a backup of the data.

    Note: When you format a disk, all data will be lost.

     

    It would be useful for us to identify the problem, if you could upload the dump file.

    You can use the Sky-drive to download the dump file. Check the link for the steps on how to download Sky-Drive.

    http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/4fc10639-02db-4665-993a-08d865088d65.

    The location of the dump file is C:\Windows\Minidump\.

  • Disconnection of call for the endpoint MXP

    Hello world

    We have 1 special issue of one of our series mxp endpoint, where the call disconnects in between it the call, we call for our local endpoint in India on another mxp parameter to the United Kingdom on a dedicated IP link.

    The two endpoints are registetered to a common gatekepper.

    IM attaching the Syslog and Syslog 4 of our local endpoint 3 mxp mxp for your reference, please check the logs & suggest what could be the reason of disconnection of the call here.

    Thanks in advance

    Nikhil

    Hi Nikhil,

    Newspapers showing your EP get no response from the return of unity to end a call is disconnected.

    This problem is the network problem, check firewall, router configuration.

    H.245 Peer H323CC-1 entity does not meet the demands of round-trip time

    H.245 Peer H323CC-1 entity is presumed down. Disconnectiong.

    Kind regards

    Dharmmesh

Maybe you are looking for