Cannot call functions with this[]

Hello,
I'm in trouble because I need to call functions from MCs with
a variable
name.
I tried to use this[] that should do the trick, but it
doesn't.
Here's what I did in code to try to debug :
- trace what's inside the this[]
- the actual this[]
- a cut and paste of the above trace() with the function call
Of course, both "hardcoded" calls work..; what am I doing
wrong ?
Here's the code :
trace(_parent + "." + buttonName);
trace("_parent." + buttonName);
this[_parent + "." + buttonName].setBtnState("test1");
this["_parent." + buttonName].setBtnState("test2");
_parent.mcBtn1.setBtnState("test3");
_level0.mcInt.mcBtn1.setBtnState("test4");
What am I supposed to feed this[] with ? Path as a string ?
Thanks in advance.
PJ

What you need to feed the array operator is a string or a
variable that can be resolved to a string. And that string needs to
be the sole name of an instance or property of something that can
be found in that object.
So the reason the ones with the "_parent.mcMe" didn't work is
because there is no object with the name "_parent.mcMe" inside of
this. There is a _parent object and inside the parent object there
is an mcMe, but that isn't the same thing.So you need to pick out
the path one item at a time.
this["_parent"]["mcMe"]["testMe"]();
Should also work. And any of those string litterals could be
replaced by a variable which held a string as well. Also notice
that the function at the end can also be referenced since you are
looking inside the mcMe object for some object with a name of
testMe. But the parens which call the function need to be outside
the array access because they aren't part of the name of the
object.

Similar Messages

  • Cannot start mac office 2011, prompt "this identity cannot be opened  with this version of outlook

    cool, need help on this.. just installed the software but the message prompt me " This identity cannot be opened with this version of Outlook". i using Macbook and version Mac OS X 10.7.3

    Hi,
    This issue occurs as the current navigation pane in Outlook is not working properly. We can try to use the command "Outlook.exe /resetnavpane" to clear and regenerate the navigation pane for the current Outlook profile:
    Press Win + R and type “outlook.exe /resetnavpane” in the blank box, then press Enter.
    We can also create a new profile to test if this issue persists:
    http://support.microsoft.com/kb/829918/en-us
    If there's no issue with the new profile, simply delete the old one.
    Regards,
    Melon Chen
    TechNet Community Support

  • "Cannot play video with this frame rate&qu

    For reasons that aren't important here I cannot use the Zen video converting software. Instead, I've been using the trial version of the Caniusoft Video to Creative Zen converter. Only once has a video played, but as soon as I closed the video and opened it up again this message appeared. "Cannot play video with this frame rate." Daniusoft offers frame rates from 5 fps to 30. I've tried all of them and none of them work. Has this been a problem for others? Perhaps I need a different converter?
    ps.
    ..i'm converting flash video to avi. Does that make a difference?

    I can't answer your question in full (maybe somebody else can). However, I am aware that both the Zen and the Zen X-Fi can only play video files up to 320x240 resolution. Previous players like the Vision M were able to scale files down to this resolution on the fly, but not these two newer players.

  • HT203088 I have the CANON REBEL T5 1200D, and when i connect it to my mac which is 10.10 the new OS X YOSEMITE it says that it "Cannot be used with this version of the operating system" why does it say that?

    I have the CANON REBEL T5 1200D, and when i connect it to my mac which is 10.10 the new OS X YOSEMITE it says that it "Cannot be used with this version of the operating system" why does it say that if my camera is listed under the supported digital cameras for OS X YOSEMITE?

    Put simply, the minimum system requirements for iTunes have changed. You need a Mac running at least OS X 10.6.8.
    It's best you look online to see if your model of Mac can be upgraded to at least 10.6.8 "Snow Leopard". It should still be possible to order a copy of Snow Leopard if so.

  • I have transefer function like (1/(s^2+s+​5)) and i have a square wave input , i want to use this transfer function with this input to see the output , how can i do that , with example please.

    i need to know also how to represent this transfer function in labview, try to send me example. answer me at my mail

    "st" wrote:
    > answer me at my mail
    give a valid e-mail first, and your name, we don't like to help anonymous
    people
    > try to send me example.
    how much do you pay ?
    > i have transefer function like (1/(s^2+s+5)) and i have a square wave
    > input , i want to use this transfer function with this input to see
    > the output , how can i do that
    First you have to know what you are doing, like an engineer : you have a
    Laplace, continuous time transfer function but LabView handles discrete
    signals only. Use matlab/simulink if you want to simulate continuous time
    systems easily...
    If you definitely want to use LabView, the first step is to discretize your
    continuous-time transfer function, i.e. decide a sampling rate and convert
    it to a "z transfor
    m". Then you can directly use the "IIR Filter.vi" as I
    said earlier.
    Philippe Guglielmetti - www.dynabits.com me at my mail

  • Ithis ipad is supervised by another computer cannot be used with this computer help

    i need help this ipad3 is supervised by another computer and cannot be used with this computer please help me i do'not know what i should be do help thanks

    It depends of what type you have. If it is your own personal iPad you should have any problem but if it is a school owned iPad then you'd have to ask the teacher who ever gave it to you. I have a school owned iPad and I e-mailed someone about it and asked and she told me to use cloud but I am/was confused and I will try again soon.

  • I'm on a mac, version 10.5.8, and firefox will not download. It has a prohibit sign over it, and says 'cannot be supported with this architecture'

    I'm on a mac, version 10.5.8, and firefox will not download. It has a prohibit sign over it, and says 'cannot be supported with this architecture'

    Firefox 4 versions and later do not run on a PowerPC Mac.<br />
    Firefox 4 and later require at least OS X 10.5 and an Intel Mac.
    * http://www.mozilla.com/firefox/6.0/system-requirements/
    For an unofficial Firefox 7 compatible version (TenFourFox) that runs on PowerPC Macs with OS X 10.4.11 or OS X 10.5.8 you can look at:
    * http://www.floodgap.com/software/tenfourfox/
    * http://www.macupdate.com/app/mac/37761/tenfourfox
    Firefox 3.6.x (Mac OS X 10.4 and later) can be found here:
    * http://www.mozilla.com/en-US/firefox/all-older.html

  • Call function with DML

    I have a function that performs DML. I am calling the function from toplink with the following. I get an error
    ORA-14551: cannot perform a DML operation inside a query when I try to execute this function. Is there another way to call functions without using select From dual?
    String queryFunc = "SELECT " +
    "CCU.adjPaymentTrans(#caseID, #obligorPIN, #ccuPIN, #transCd, #payorTp) " +
    "FROM dual";
    SQLCall sqlCallFunc = new SQLCall(queryFunc);
    ValueReadQuery valueReadFunc = new ValueReadQuery(sqlCallFunc);
    valueReadFunc.addArgument("caseID");
    valueReadFunc.addArgument("obligorPIN");
    valueReadFunc.addArgument("ccuPIN");
    valueReadFunc.addArgument("transCd");
    valueReadFunc.addArgument("payorTp");
    valueReadFunc.bindAllParameters();
    Vector theArgumentValuesFunc = new Vector(6);
    theArgumentValuesFunc.add(caseID);
    theArgumentValuesFunc.add(obligorPIN);
    theArgumentValuesFunc.add(ccuPIN);
    theArgumentValuesFunc.add(transCd);
    theArgumentValuesFunc.add(payorTp);
    Number amountReversed = (Number)uow.executeQuery(valueReadFunc, theArgumentValuesFunc);

    Normally DML is only done from stored procedures, not stored functions, you may want to consider changing the function to a procedure.
    To call a function that does DML, you must call the function through a PLSQL call. If you did not require the return value, the code would be:
    >>
    String queryFunc = "begin " +
    "CCU.adjPaymentTrans(#caseID, #obligorPIN, #ccuPIN, #transCd, #payorTp);" +
    "end;";
    SQLCall sqlCallFunc = new SQLCall(queryFunc);
    DataModifyQuery modifyFunc = new DataModifyQuery(sqlCallFunc);
    >>
    If you require the return value, then the SQL would be:
    >>
    String queryFunc = "begin ? = " +
    "CCU.adjPaymentTrans(?, ?, ?, ?, ?);" +
    "end;";
    >>
    However this would have to be executed through a CallableStatement in JDBC. TopLink currently only supports executing stored procedures as callable statements, so you would need to execute this directly through JDBC. You could also convert the function to a procedure, or wrap the function with a procedure. I believe TopLink 10.1.3 will have support for a StoredFunctionCall that can call DML stored functions.
    To get a JDBC connection from a TopLink session uses,
    UnitOfWork uow = session.acquireUnitOfWork();
    uow.beginEarlyTransaction()
    uow.getAccessor().getConnection();
    uow.commit();

  • Call function with arguments in AS3

    Hello!
    I`m a new in Flex developing, and cannot understand same code
    convention, im Java programmer.
    How I can write correct function call in ActionScript, my
    call: var goodsWnd:CreateGoodsWindow =
    PopUpManager.createPopUp(this,
    CreateGoodsWindow, true) as CreateGoodsWindow;
    I wish call function above with argument, how I do that?
    Where my class: public class CreateGoodsWindow extends
    extends TitleWindow
    public CreateGoodsWindow(data:Object)
    }

    Use PopUpManager.addPopUp() instead of createPopUp().
    addPopUp takes an object that has already been instantiated:
    var createGoodsWindow:CreateGoodsWindow = new
    CreateGoodsWindow(data);
    PopUpManager.addPopUp(createGoodsWindow);

  • 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.                                                                                                                                                                                               

  • Error while transforming XSLT by calling function with Reflection API

    Hi,
    I'm new to Reflection API. I want to call function from the jar file which is not in my application context. So I have loaded that jar ( say XXX.jar) file at runtime with URLClassLoader and call the function say [ *myTransform(Document document)* ]. Problem is that when I want to transform any XSLT file in that function it throws exception 'Could not compile stylesheet'. All required classes are in XXX.jar.
    If I call 'myTransform' function directly without reflection API then it transformation successfully completed.
    Following is code of reflection to invoke function
            ClassLoader contextCL = Thread.currentThread().getContextClassLoader();
            URLClassLoader loader = new URLClassLoader(jarURLs, contextCL);
            Class c = loader.loadClass(fullClasspath);
            Constructor constructor = c.getDeclaredConstructor(constructorParamsClasses);
            Object instance = constructor.newInstance(constructorParams);
            Method method = c.getDeclaredMethod("myTransform", methodParamsClasses);
            Object object = method.invoke(instance, methodParams);Following is function to be called with reflection API.
    public Document myTransform ( Document document ) {
    // Reference of Document (DOM NODE) used to hold the result of transformation.
                Document doc = null ;
                // DocumentBuilderFactory instance which is used to initialize DocumentBuilder to create newDocumentBuilder.
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance () ;
                // Reference of DocumentBuilder used to create new Document (DOM NODE).
                DocumentBuilder builder;
                try {
                      // Initialize DocumentBuilder by using DocumentBuilderFactory instance.
                      builder = factory.newDocumentBuilder ();
                      // Initialize new document instance by using DocumentBuilder instance.
                      doc = builder.newDocument () ;
                      // Creates new DOMSource by using document (DOM NODE) which is coming through current transform() method parameter.
                      DOMSource domsource = new DOMSource ( document ) ;
                      // Creates new instance of TransformerFactory.
                      TransformerFactory transformerfactory = TransformerFactory.newInstance () ;
                      // Creates new Transformer instance by using TransformerFactory which holds XSLT file.
                      Transformer transformer = null;
    ********* exception is thrown from here onward ******************
                      transformer = transformerfactory.newTransformer (new StreamSource (xsltFile));
                      // Transform XSLT on document (DOM NODE) and store result in doc (DOM NODE).
                      transformer.transform ( domsource , new DOMResult ( doc ) ) ;
                } catch (ParserConfigurationException ex) {
                      ex.printStackTrace();
                } catch (TransformerConfigurationException ex) {
                      ex.printStackTrace();
                } catch (TransformerException ex) {
                     ex.printStackTrace();
                } catch (Exception ex) {
                     ex.printStackTrace();
                //holds result of transformation.
                return doc ;
    }Following is full exception stacktrace
    ERROR:  'The first argument to the non-static Java function 'myBeanMethod' is not a valid object reference.'
    FATAL ERROR:  'Could not compile stylesheet'
    javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:829)
            at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:623)
            at com.actl.dxchange.utilities.Transformation.transform(Transformation.java:83)
            at com.actl.dxchange.base.BaseConnector.transform(BaseConnector.java:330)
            at com.actl.dxchange.connectors.KuoniConnector.doRequestProcess(KuoniConnector.java:388)
            at com.actl.dxchange.connectors.KuoniConnector.hotelAvail(KuoniConnector.java:241)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            ...........

    Hi,
    Thanks for response.
    Following is code for setting 'methodParamsClasses' array object. I do ensure that Document is not null and valid. My application is web application.
    Document requestObj = /* my code for generating Document object*/
    Object[] methodParams = new Object[]{requestObj}
    Class[] methodParamsClasses = new Class[]{};
                if (methodParams != null) {
                    methodParamsClasses = new Class[methodParams.length];
                    for (int i = 0; i < methodParams.length; i++) {
                        if (methodParams[i] instanceof Document) {
    /************** if parameter is instance of Document then I set class type as "Document.class" ***********/
                            methodParamsClasses[i] = Document.class;
                        } else {
                            methodParamsClasses[i] = methodParams.getClass();

  • CALL FUNCTION  WITH STARTING NEW TASK

    Hi All,
    i'm call a function module through
    CALL FUNCTION 'Y_WIN'  DESTINATION 'rfc_destination' then it's give right result but when i want to call with starting new task then
    CALL FUNCTION 'Y_WIN'  STARTING NEW TASK 'INFO' DESTINATION 'rfc_destination'
    it does nt provide me any data. i have check in debugger call fm is wkging fine so pls clear me why i'm nt geeting result.
    pls give ur suggestions,
    Anuj

    Did you use the PERFORMING <form> ON END OF TASK to get the results back; like in the following sample
              CALL FUNCTION 'SAPWL_STATREC_READ_FILE'
                   STARTING NEW TASK taskname
                   DESTINATION list-name
                   PERFORMING read_outtab ON END OF TASK
                   EXPORTING
                        read_start_date   = s_date
                        read_start_time   = '000000'
                        read_end_date     = s_date
                        read_end_time     = '235959'
                   EXCEPTIONS " failure when calling RFC
                        communication_failure = 1 MESSAGE msg_text
                        system_failure        = 2 MESSAGE msg_text
                        RESOURCE_FAILURE      = 3.
    and
    FORM read_outtab USING taskname.
    * Receive results back
      RECEIVE RESULTS FROM FUNCTION 'SAPWL_STATREC_READ_FILE'
        TABLES
          v2_normal_records = outtab
        EXCEPTIONS " from the called FM
          nodata    = 1.
    Regards

  • Itunes COM SDK: cannot register function with iTunes Outgoing Interface

    I am doing benchmarks and I want to time the encoding of a Music CD. In order to stop the "clock" and compute the time I am trying to bind a function with the _IITConvertOperationStatusEvents::OnConvertOperationCompleteEvent()
    I am writing a AutoIt script and I can create the iTunes application object but when I use the ObjEvent function to register my function with the event above it causes a COM exception to be raised and the ObjEvent completes with an error. The exception code I get is 80040200 which seems to be a generic error.
    $objApp=ObjCreate("iTunes.Application")
    $SinkObject=ObjEvent($objApp, "ITEvent", "_IITConvertOperationStatusEvents")
    <<exception 80040200>>
    Browsing the iTunes COM TypeLib the _IITConvertOperationStatus does not seem to be a child in the iTunes object hierarchy so I think this is way the exception is being raised. I have tried to register another function with another outgoing interface and this works just perfectly: _IiTunesEvents::OnQuitting()
    Do I need to create another object which gets passed as the first parameter to the ObjEvent function?
    *Here is the entire script:*
    $ITSourceKindAudioCD = 3
    $begin = 0
    Global $trackName, $progressValue, $maxProgressValue, $SinkObject
    $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler
    $objApp = ObjCreate("iTunes.Application")
    If @error Then
    MsgBox(0, "ObjCreate", "Create Object Failed", 3)
    Exit
    EndIf
    $event = ObjEvent($objApp, "ITEvent1_", "_IiTunesEvents")
    If @error Then
    MsgBox(0, "Failed", "IiTunesEvent binding failed", 5)
    Exit
    EndIf
    $SinkObject = ObjEvent($objApp, "ITEvent_", "_IITConvertOperationStatusEvents") ; Assign events to UDFs starting with IEEvent_
    If @error Then
    MsgBox(0, "ObjEvent binding", "ObjEvent failed!", 10)
    $objApp.Quit()
    Exit
    EndIf
    $colSources = $objApp.Sources
    $begin = TimerInit()
    For $objSource in $colSources
    If $objSource.Kind = $ITSourceKindAudioCD Then
    $strName = $objSource.Name
    $colPlaylists = $objSource.Playlists
    $objPlaylist = $colPlaylists.ItemByName($strName)
    $colTracks = $objPlaylist.Tracks
    $objApp.ConvertTracks2($colTracks)
    EndIf
    Next
    Do
    ; Wait around for the ripping to complete
    Until False
    ; This is my custom error handler
    Func MyErrFunc()
    $HexNumber = hex($oMyError.number,8)
    Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
    "Number is: " & $HexNumber & @CRLF & _
    "Windescription is: " & $oMyError.windescription )
    EndFunc
    Func ITEvent1_OnQuittingEvent()
    MsgBox(0, "Bye", "Bye-Bye", 10)
    EndFunc
    func ITEvent_OnConvertOperationCompleteEvent()
    $dif = TimerDiff($begin)
    MsgBox(0,"Time Difference",$dif)
    $objApp.Quit()
    EndFunc

    much of this is speculation because I can't remember how many previous versions of iTunes were on these machines...but this is what we're seeing:
    extra entries in two registry keys... when it didn't work these two registry entries contained "AppID" values:
    HKEYCLASSESROOT\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}\Implemented
    Categories
    HKEYLOCALMACHINE\SOFTWARE\Classes\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    with the APpID set to the same iTunes CLSID string:
    {B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    and when it did work the AppIDs entries were gone. this is only on XP.
    on vista there never was any AppID entry.
    but, again, i wonder if that was added by previous versions of iTunes which we didn't install on the vista machines...
    Also, worthy of noting is this post from Apple:
    http://support.apple.com/kb/HT1925
    ciao, raza

  • Call function with rfc or not ?

    How can I know that an function is called by rfc or not ?
    info : The caller is not R/3 system. This web interface...
    thanks in advance

    Hi Stephan,
    Try this FM
    TRANSACTION_CALL_VIA_RFC
    Data : v_bdi_line type bdi_line.
    Call Function 'TRANSACTION_CALL_VIA_RFC'
         Exporting
             tcode = sy-tcode.
         importing
             transaction_data = v_bdi_line.
         Exceptions
             tcode_not_exist = 1.
    if sy-subrc ne 0.
       It means it is RFC call.
    endif.
    Reward points if it helps you.
    Regards,
    Sudhakar.

  • 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.

Maybe you are looking for

  • Missing media in finished DVD but not missing in Timeline

    Dear Gurus and others-who-know-far-more-than-I-do In my latest video, exported from PPro (CC 2014) via Media Encoder and Published with Encore CS6...my finished DVD has a number of red "Missing Media" spots, but going through the PPro timeline there

  • Problem Module/datagrid, one time with data, one time is null

    Hello All thanks for this discussion place, i have a problem in Flash Builder 4.6 (sdk 4.6.0), construct an application who connect to DB, for now, the CRUD works fine with flex service, i have a problem with a datagrid, one time it's worked fine, an

  • Iphone 4s:One speaker is not functioning

    One of my speaker is not working at all...How do i fix this?

  • None of my Applications transferred when Backed up my Mac for a Clean Install

    I recently copied all of my important folders & files to an external drive -- everything under my user file.  My documents, Music, Photos, etc. all backed up correctly.  So I clean-installed mavericks. Today I opened up my applications folder to get

  • Accordion panels as navigation

    Hi i want to use the accordion panels as navigation problem is when I load a new page the widget defaults to open on the first panel. I would like it to stay open on the panel which the link was made from also I can't figure the css to target the "Ac