Event Handlers which trigger functions with multiple arguments

I am playing two video clips back to back. I have a few
things which I need to do in between clips, so what I am doing for
each is adding a handler for VideoEvent.COMPLETE, at which time i
want to call a function which takes multiple arguments, like this:
video.addEventListener(VideoEvent.COMPLETE,
myFunction("1","2","3"));
private function myFunction(var1:String, var2:String,
var3:String):void
video.removeEventListeners(VideoEvent.COMPLETE, myFunction);
I've already figured out that getting rid of event handlers
that trigger anonymous functions is impossible. Please don't tell
me that it's impossible to remove them if functions require more
than 0 arguments...

"muskiemania" <[email protected]> wrote in
message
news:gc0pk0$jfb$[email protected]..
>I am playing two video clips back to back. I have a few
things which I need
>to
> do in between clips, so what I am doing for each is
adding a handler for
> VideoEvent.COMPLETE, at which time i want to call a
function which takes
> multiple arguments, like this:
>
> video.addEventListener(VideoEvent.COMPLETE,
myFunction("1","2","3"));
>
> private function myFunction(var1:String, var2:String,
var3:String):void
> {
> video.removeEventListeners(VideoEvent.COMPLETE,
myFunction);
> }
>
> I've already figured out that getting rid of event
handlers that trigger
> anonymous functions is impossible. Please don't tell me
that it's
> impossible to
> remove them if functions require more than 0
arguments...
Any function that you add via addEventListener should expect
exactly ONE
argument, the event. And 99.958% of the time, you can take
that event
object and figure out exactly what you need to know.
HTH;
Amy

Similar Messages

  • Implement Comparable with multiple arguments

    Is there a way of implementing Comparable<> with multiple different arguments to the Comparable generics?
    For example:
    public class Foo<K, V> implements Comparable<K>,
              Comparable<V>
    }The compiler complains with the error: "The interface Comparable cannot be implemented more than once with different arguments: Comparable<K> and Comparable<V>"
    Clearly, this cannot be done exactly like this, so I'm wondering if there is a different way of accomplishing the same functionality.
    Edited by: mgolowka on Apr 24, 2008 12:22 PM

    I'm working on creating a generic binary search tree. Currently I have this:
    public class BinarySearchTree<T extends Comparable<T>> implements Collection<T>
    }With the add() function, I can simply do add(T) that will use T's compareTo(T) method to find its place in the tree, however with the remove() and get() functions that I want to have would require an input of T, which isn't what I'm entirely looking for. I could change this to have a key/value pair so it's functionality is like a set, but I'm not sure if that's the best course of action. I could make it implement Map<K, V> to get that functionality...
    There is no time limit on this project as it is a part of a personal project.

  • Is there an IDE which supports snippets with popup arguments?

    Is there a text editor or plugin which supports selecting from default arguments?
    Geany package has the Snippet plugin. From their manual page
    Basic snippet.conf entry:
        [Default]
        myname=Enrico Tröger
    And then there's the feature to add a wildcard:
        Template wildcards
        [Default]
        myname=My name is {developer}
    This will replace myname with "My name is " and the value of the template preference developer.
    What I'd like to find is something similar to the wildcard:
        myname=My name is ("Chris" | "Xtian" | "CSimon")
    This way I can complete the phrase "My name is" with any of these three options, similar to the current auto-complete.  (only autocompelete matches only what's in the document, and you can't limit it just to preset values)
    I want to make some bog simple flat file xml-templates. Define something like a database field with a list of predetermined values, so I don't get field value identity problems.
    Any ideas for VIM or geany?
    Last edited by xtian (2014-12-09 00:02:25)

    As I noted in the post, I want to make some bog-simple flat file xml-templates.
    The functionality is really important so they're easier to maintain. I'm using geany right now, since its a little more convenient when copying text from web pages. Right now I have Snippets working to insert the exact wrappers. However, some of the elements are repetitive, and I wish to keep them consistent. And autocomplete is catching some of these words correctly and some not correctly. I don't need autocomplete for the whole document, but I very much would like it for these structural bits which snippets are so good (and convenient) at putting into a text doc. As I was re-purposing the snippet.conf and adding all these elements to classify the content files I was making, I realized how much the process was like making a database table. Combine this feature with templates and what you have is a single file as a single record, with the fields inside the document. Now I can parse these files for content with a script. If I'm using VIM or Geany, then all the better.

  • How to register PL/SQL function with Varchar2 argument in Discoverer

    Hi,
    I have registered a PL/SQL function in Discoverer Administrator 10.1.2.1. Function has two arguments with data type varchar2. In discoverer I've selected varchar as it doesn't have varchar2.
    When i use this function in report using discoverer desktop it gives an error "One of the function argument has an incorrect datatype.
    I would appreciate if somebody can help
    Regards
    BA

    Hi,
    First, do not wait to use it in order to check it.
    In the discoverer admin you can "Validate" the function on after registering it.
    there are couple of things you should know about registering the function:
    1. the "Varchar" option you selected is correct (there is no varchar2 in the admin definition).
    2. check the database function to verify that you indeed registered all its arguments and they match the names and types of the db function.
    3. during the registration, type everything in UPPER CASE.
    the other way to register the function (and you will not need to deal with the definition of it) is to search for the function in a list.
    in order to do that, on the register function screen press the "Import" button (on the bottom right side of screen).
    then search by the owner (db user / schema) that the function / package is registered.
    Tamir

  • Cfexecute with multiple arguments

    Hello,
    I'm trying to encrypt a file with CFEXECUTE, using OpenSSL. When I run the code in the command prompt, it works fine and the new encrypted file appears in the correct folder. Also, I can run CFEXECUTE with OpenSSL with just one argument and it works fine. ie arguments="version". But the following does not return a value, nor does it create the new folder:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "aes-256-cbc -a -salt -in ""C:\Users\Dev2\Documents\My Stuff\OpenSSL\secrets.txt"" -out ""C:\Users\Dev2\Documents\My Stuff\OpenSSL\secrets2.txt"""
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    Any ideas?
    Pete

    BYW,
    This runs fine:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "list-standard-commands"
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    and so does this:
    <cfexecute name = "C:\Program Files (x86)\GnuWin32\bin\openssl"
        arguments = "version"
        variable = "result"
        timeout = "5">
    </cfexecute>
    <cfdump var="#result#">
    Maybe someone has a multiple argument example of CFEXECUTE that runs fine.
    I'd be interested to know.
    Pete

  • Importing function with multiple ref cursors in Stored Procedure of Oracle 12c database Using EF6

    Hi Good day!
    I can able to import function for stored procedure of oracle db and able to add the complex type and get the output but i tried to import the procedure which having two ref cursors and unable to retrieve the column information. Only able to retrieve the
    columns of first ref cursor.  Please help me to get the result of two ref cursors which acting as out parameters.

    Having to ref cursors return mutiple recordsets in an Oracle package is like haveng two resultsets return from a MS SQL Server sparc.
    The link may point you in the right direction.
    http://www.codeproject.com/Articles/675933/Returning-Multiple-Result-Sets-from-an-Entity-Fram

  • VBA Function with Range Argument passed to Excel Solver

    I set up a function to run solver with some specific cells but solver seems not to receive the inputs. I consider the arguments as ranges passed by ByVal and ByRef with no success. The solver has already been done directly in the spreadsheet so the problem
    has a solution.
    Function Garch(control As Boolean, ByRef MyArg As Range, ByRef LogL As Range) As String
    If control = True Then
        Worksheets("Garch").Activate
        SolverOkDialog setCell:=LogL, MaxMinVal:=1, byChange:=MyArg
        SolverAdd cellRef:=persistence, relation:=1, formulaText:=0.9999
        SolverSolve userFinish:=False
        Garch = "Done"
        Else
        Garch = "Not Done"
    End If
    End Function

    Andreas,
    I liked the concept but I need to loop through columns instead of rows, I tried unsuccessfully the code below, any suggestions?
    Sub MacroX()
      Dim i As Long
      Dim j As Long
        For i = 3 To 3
        j = i * 4 + 2
        SolverReset
        SolverOk SetCell:=Range(Cells(12, j)), MaxMinVal:=1, ByChange:=Range(Cells(3, j), Cells(7, j)), Engine:=1, EngineDesc:="GRG Nonlinear"
        SolverAdd cellRef:=Range(Cells(6, j)), relation:=1, formulaText:=0.9999
        SolverSolve userFinish:=True
      Next
    End Sub

  • Applescript with multiple arguments

    AFAIK, Terminal.app does not accept arguments. So, I need for AppleScript to accept some arguments, then open Terminal to run them. Something like this:
    tell application "Terminal"
        activate
        set shell to do script arg1 arg2 arg3  in window 1
    end tell
    All I've been able to accomplish is:
    tell application "Terminal"
        activate
        set shell to do script arg1 in window 1
    end tell
    Help please?

    OK I have no idea how anyone is posting code now with this new ASC software but I can;t get it to work no matter what I do.
    If I make two changes to your code I get the following output in the Terminal window, which seems to be what you want.
    Last login: Thu Jul  3 07:59:35 on console
    LIBMACLAPcaggiano  ~ %
    LIBMACLAPcaggiano  ~ % /Applications/adbFire/adb  -s 192.168.1.196  shell
    zsh: no such file or directory: /Applications/adbFire/adb
    LIBMACLAPcaggiano  ~ %
    The changes were (for testing)
    set daddr to "192.168.1.196"
    hardcoding in the ip address rather then getting it setting it from argv. I'm a bit confused you show a run handler, how is the script being called?
    And second
    set shell to do script "/Applications/adbFire/adb  -s" & space & daddr & space & " shell" in window 1
    adding the -s right to the program string.
    One last thing I run zsh not sure if that has any bearing here.
    I suppose a screen shot is better then nothing
    Actually you can pair down the command to
    set shell to do script "/Applications/adbFire/adb  -s " & daddr & " shell" in window 1
    no real need for the & space in there

  • Using "Save as" functionality with multiple dataproviders

    Is there a way to use the <bi:SAVE_AS> command in a web template to save multiple dataproviders in a single analysis in BEx Portfolio? When I don't specify a dataprovider the command doesn't function.
    Thanks,
    Jason

    pod0 --
    At the top of your screen for this page,
    you will see that you have a "Solved" rating available.
    Perhaps you don't know what that means, as it is a new system here.
    It seems to be that CyberTaz did actually "Solve" your problem.
    By using the Rating System provided by Apple,
    you will be actively encouraging finding solutions
    and helpful responses throughout these boards.

  • Ago Function with multiple Facts

    Hi,
    I have two fact tables that are coneccted to the same time dimension. One of this fact has a column that uses the AGO function. In Answers when I select the column with the function and any other from the other fact, I get the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: Ago(VAL_PUBLICIDADE:[DAggr(F_PUBLICIDADE_MENSAL.VAL_PUBLICIDADE by [ D_CANAL.COD_CANAL, D_CANAL.NOME_CANAL, D_TEMPO_MES.Mes, D_TEMPO_MES.Ano, F_PUBLICIDADE_OBJECTIVOS.VALOR_BRUTO_OBJECTIVO] )], [Level Ano], 1). Please fix the metadata consistency warnings. (HY000)
    The metadata is consistent, there are no errors on the Administrator... Is it possible to do?

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • Call function with select arguments

    Hi Gurus,
    I have problem to call function inside select statements as follow:
    select a.ID_ELE2, a.ID_ELE3, a.DT_FIS_YR, c.NU_FIS_PER, c.dt,
    (case
    when c.ld is null then
    GET_LD_CHECK (a.DT_FIS_YR,c.NU_FIS_PER, a.ID_ELE3, a.ID_ELE2) -- 1
    -- GET_LD_CHECK ('2009',7, '8010', '7493') --- 2
    else
    c.ld
    end ) description
    from ACCOUNT a, TRANSACTION c
    where a.DT_FIS_YR ='2009'
    and a.ID_ELE3 <> '0000'
    and c.TY_SRC not in ('CL', 'CN')
    and a.DT_FIS_YR = c.nu_fis_yr
    and a.AK = c.AK_FGCHAR
    and trim(a.ID_ELE3) ='8010'
    and c.NU_FIS_PER <> 14
    order by 1,4,5,6
    the 1 doesn't output result but the 2 it does! How can pass the select result to the function?
    Thanks in advance for your help.
    Ben

    The statement / function call seems to be ok. So there are not much chances left for your call to return different (=non) values.
    1) It could be that you have different values in the column then during your test call.
    2) Maybe your function raises an error and that error is supressed in some ugly WHEN OTHERS EXCEPTION => Solution: Get rid of the error handler.
    3) datatype conversion. For example if a.dt_fis_yr is a number value, then you should test with number values and not with strings. GET_LD_CHECK (2009,7, '8010', '7493'). Same logic goes for the other paramters, make sure the datatype is correct and matches the function parameter.

  • SunStudio 12 Fails to compile template function with template argument

    Hi
    Look at the code below:
    #include <iostream>
    template<class InIt, class OutIt>
    InIt copy_n(InIt first,  typename  std::iterator_traits<InIt>::difference_type  length, OutIt dest)
       for (;length--; ++dest, ++first)
          *dest = *first;
       return first;
    int main()
            char str1[]="Sumit";
            char str2[20];
            copy_n(str1,6,str2);
            std::cout << str2;
            return 0;
    }I have simplified this to pin point the problem, This code dosent compile with SunStudio12 C++ Compiler, (however this works fine on g++ and vc++). The problem is with second parameter
    typename std::iterator_traits<InIt>::difference_type  lengthinstead if we specify any simple type as below, it works fine
    int lengthSuns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Edited by: sumitkumar on May 20, 2008 12:20 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM

    >
    Suns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    Boost 1.34.1 should work OK. I haven't tried Boost 1.35 yet.
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Make sure that you compile and link with -library=stlport4, otherwise you will be limited in the Boost libraries that you will be able to use.
    Paul

  • Call apt with multiple arguments

    Is it possible to call apt inside a java class and pass multiple .class files?
    For example:
    String[] args = new String[5];
    args[0] = "-nowarn";
    args[1] = "-XclassesAsDecls";
    args[2] = "-classpath";
    args[3] = System.getProperty("java.class.path");          
    args[4] = "packageName.FirstClass packageName.SecondClass";
    return Main.process(new MyAnnotationProcessorFactory(),args);Result of the above example is:
    error: Could not find class file for packageName.FirstClass packageName.SecondClass
    1 error

    The class path contains classes that we need.
    This example works:
    String[] args = new String[6];
    args[0] = "-nowarn";
    args[1] = "-XclassesAsDecls";
    args[2] = "-classpath";
    args[3] = System.getProperty("java.class.path");     
    args[4] = "packageName.FirstClass";
    args[5] = "packageName.SecondClass";
    return Main.process(new IapiAnnotationProcessorFactory(),args);I replaced args[4] = "packageName.FirstClass packageName.SecondClass"; with a
    args[4] = "packageName.FirstClass";
    args[5] = "packageName.SecondClass";

  • How to call function with varray arguments .

    Hi,
    I've got function like this:
    CREATE OR REPLACE
    TYPE VARR_VARCHAR AS VARRAY(256) OF NVARCHAR2(500)
    CREATE OR REPLACE
    TYPE E_VARR_VARCHAR AS VARRAY(256) OF nVARCHAR2(4096)
    FUNCTION find_id(
          p_id            IN   VARCHAR2,
          p_special_columns     IN   varr_varchar,
          p_special_values      IN   e_varr_varchar,
          RETURN VARCHAR2;How can I construct call to that function (nvarchar datatype is a need) using only pl/sql and can I do that with pure sql like select f() from dual; ?
    I'm on 9.2.0.8 .
    Regards
    GregG

    select find_id (p_id,VARR_VARCHAR('1','2','3'),e_varr_varchar('1','2','3')) from dual;
    --sty.                                                                                                                                                                                               

  • JNI callback funtion with multiple arguments

    Hi,
    Is it possible to return more than one argument in java callback function.
    for single arg return, I am using below function in my C code.
    jmethodID mid = (*env)->GetMethodID(env, cls, "callback", "(I)V");
    (*env)->CallVoidMethod(env, obj, mid, depth);
    what are the changes require to return more than one arg?
    Thanks in Advance
    Ashwani

    Is it possible to return more than one argument in java callback function.Of course. A 'callback function' is just a method like any other.
    what are the changes require to return more than one arg?1. Adjust the method declaration in the class you are calling.
    2. Compile the class.
    3. Run javap -s to see the new signature.
    4. Adjust the signature in GetMethod() accordingly in your code.
    5. Adjust the CallVoidMethod() call to pass the necessary parameters.

Maybe you are looking for

  • Cannot open my old mov. files with new imovies 10.0.3

    I went to open a .mov file I wanted to re-edit and only Quicktime was given as an option.  I've tried to create a new event with the new imovies and that isn't happening either.  How to do either of these simple things would be appreciated.

  • Problem in creating DataServer   using SQL2008  connection status  is ERROR

    HI  All  I am  fairly new in SAP MII , and i have been trying to create new data server  using MSSQL2008 which is on my laptop(local) and i access MII  in web based form.  the sap MII version is  12.1.5(Build99) this what i did 1.I have   deployed  

  • Cut paste wed address still there after logging out and then logging back in. clearing history does not delete it

    After I highlight, copy and paste info into search box look at what I want, after leaving firefox and after manually deleting history and leaving firefox with setting to delete history upon leaving, when I re-enter firefox with cursor in search box r

  • No X11 launch after xquartz update

    After upgrading my version of XQuartz to the current release (2.7.4), I can no longer launch X11 or X windows on my machine.  When I've had X issues in the past, at least the X11 app would launch and there'd be a forwarding issue somewhere; this time

  • Consider working with Parties

    We have a file to IDoc scenario from many partners. Files are send by external partners to our DMZ FTP. I am considering working with Party in order to convert the sender schema into IDoc vendor schema(LI) and not the regular way ( using buisness sys