When is an anonymous function evaluated?

Hi everyone.
I used two kinds of anonymous function in my AS 3.0 Flash
file, in order to implement the roll-over animation of menu
buttons. menu_1, menu_2, ... are the buttons already on the stage,
and menu_list is an array of them. The code is about adding event
listeners on the menu buttons to the corresponding movie clips
("shades" in the code).
It is supposed that when MOUSE_OVER happens on menu_1, then
shade_list[0] plays itself from a frame named "colorIn". However,
when complied and run, all of the event listeners are linked to the
final element of shade_list, namely shade_list[5]. No matter what
button your mouse is going over, a shade covers the sixth menu
button.
If I put the for statement away and hard-code the whole
thing, like menu_list[0].addEventListener( ... );
menu_list[1].addEventListener( ... );
menu_list[2].addEventListener( ... ); ..., then it works fine as I
intended. But I'd really appreciate if I can do this with for
statement, since this time it should be an extensive menu
design.

The problem was because of the concept of "scope." In the
code, the local variable named menuNumber is used in an anonymous
function about shade_list. However, shade_list[menuNumber] is not
evaluated until it is called. When it is actually called,
menuNumber already has the final value (namely the length of
menu_list) because the for statement is over. This is why every
event listener is linked to the final element of shade_list. So I
have to force menuNumber to be evaluated when addEventListener
happens. I can do this by adding an extra scope.
Thus
function (MouseEvent) {
shade_list[menuNumber].gotoAndPlay("colorIn") }
should be rewritten like
function (menuNumber) { return function (MouseEvent) {
shade_list[menuNumber].gotoAndPlay("colorIn") } }
(menuNumber)

Similar Messages

  • I have an app that crashes when I run one function, but no one else I know with the same app experiences the crash.  I checked my Diagnostics

    I have an app called Astrogold that crashes when I run one function, but no one else I know with the same app experiences the crash.  The app writes several different reports, and gives the option of sending them as PDF files.  All the other reports generate fine, but one of them....and that one crashes the app while it is trying to generate the report.
    Note:  it only crashes the display.  If I double click the home button I see the app itself is still running.
    I checked my Diagnostics & Usage data, and noticed that every time the app crashes a LowMemory report is created.  I looked at the LowMemory report and see that the Largest process is Astrogold.  But I don't see any reports with the name of the app itself.
    I have an iPhone 5c, and according to iTunes I have 2.25 GB Free.
    Below is the actual LowMemory report.  Can anyone make any suggestions?
    name":"astrogold","bug_type":"109","os_version":"iPhone OS 7.1.2 (11D257)","bundleID":"com.esotech.astrogold","version":"4.2.4 (4.2)","app_name":"astrogold"}
    Incident Identifier: 257B47E8-3A4D-4C64-8E9F-71D33C905548
    CrashReporter Key:   cfa389285f4559a21d797bfeec6a78c584e798d6
    Hardware Model:      iPhone5,4
    Process:             astrogold [18906]
    Path:                /var/mobile/Applications/D8301675-652C-4472-A168-CF3F141C5F58/astrogold.app/ast rogold
    Identifier:          com.esotech.astrogold
    Version:             4.2.4 (4.2)
    Code Type:           ARM (Native)
    Parent Process:      launchd [1]
    Date/Time:           2014-08-31 13:15:13.616 +0800
    OS Version:          iOS 7.1.2 (11D257)
    Report Version:      104
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Triggered by Thread:  0
    Thread 0 Crashed:
    0   libsystem_kernel.dylib         0x399a51f0 0x39992000 + 78320
    1   libsystem_pthread.dylib        0x39a0d7b2 0x39a0a000 + 14258
    2   libsystem_c.dylib              0x39955ff4 0x3990c000 + 303092
    3   libsystem_malloc.dylib         0x399ccd20 0x399ca000 + 11552
    4   libobjc.A.dylib                0x393f73a4 0x393ed000 + 41892
    5   libobjc.A.dylib                0x393ffb66 0x393ed000 + 76646
    6   astrogold                      0x001be574 0xe2000 + 902516
    7   astrogold                      0x001be774 0xe2000 + 903028
    8   astrogold                      0x001a2910 0xe2000 + 788752
    9   astrogold                      0x001a40fa 0xe2000 + 794874
    10  UIKit                          0x315ba174 0x3147c000 + 1302900
    11  UIKit                          0x315613d6 0x3147c000 + 938966
    12  UIKit                          0x31560c2c 0x3147c000 + 937004
    13  UIKit                          0x314872e0 0x3147c000 + 45792
    14  QuartzCore                     0x31103316 0x310f7000 + 49942
    15  QuartzCore                     0x310feb3a 0x310f7000 + 31546
    16  QuartzCore                     0x310fe9cc 0x310f7000 + 31180
    17  QuartzCore                     0x310fe3e0 0x310f7000 + 29664
    18  QuartzCore                     0x310fe1f2 0x310f7000 + 29170
    19  QuartzCore                     0x310f7f18 0x310f7000 + 3864
    20  CoreFoundation                 0x2ec20ff6 0x2eb81000 + 655350
    21  CoreFoundation                 0x2ec1e982 0x2eb81000 + 645506
    22  CoreFoundation                 0x2ec1ecce 0x2eb81000 + 646350
    23  CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    24  CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    25  GraphicsServices               0x33af86ce 0x33aef000 + 38606
    26  UIKit                          0x314ea86c 0x3147c000 + 452716
    27  astrogold                      0x000e9136 0xe2000 + 28982
    28  libdyld.dylib                  0x398eeab4 0x398ed000 + 6836
    Thread 1:
    0   libsystem_kernel.dylib         0x39992804 0x39992000 + 2052
    1   libdispatch.dylib              0x398e1050 0x398d9000 + 32848
    2   libdispatch.dylib              0x398db2de 0x398d9000 + 8926
    Thread 2:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   Foundation                     0x2f57d492 0x2f572000 + 46226
    7   Foundation                     0x2f5ce254 0x2f572000 + 377428
    8   astrogold                      0x00408f30 0xe2000 + 3305264
    9   Foundation                     0x2f63fa0a 0x2f572000 + 842250
    10  libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    11  libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    12  libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 3 name:  com.apple.NSURLConnectionLoader
    Thread 3:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   Foundation                     0x2f5ca23c 0x2f572000 + 361020
    7   Foundation                     0x2f63fa0a 0x2f572000 + 842250
    8   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    9   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    10  libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 4 name:  com.apple.CFSocket.private
    Thread 4:
    0   libsystem_kernel.dylib         0x399a5434 0x39992000 + 78900
    1   CoreFoundation                 0x2ec244de 0x2eb81000 + 668894
    2   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    3   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    4   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 5:
    0   libsystem_kernel.dylib         0x399a5c70 0x39992000 + 81008
    1   libsystem_pthread.dylib        0x39a0ac1e 0x39a0a000 + 3102
    2   libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 6:
    0   libsystem_platform.dylib       0x39a069a6 0x39a05000 + 6566
    1   libobjc.A.dylib                0x393ffad6 0x393ed000 + 76502
    2   CoreFoundation                 0x2eb86140 0x2eb81000 + 20800
    3   CoreFoundation                 0x2eb8c0dc 0x2eb81000 + 45276
    4   CoreFoundation                 0x2eb9f6e4 0x2eb81000 + 124644
    5   astrogold                      0x0019ed06 0xe2000 + 773382
    6   Foundation                     0x2f59a64c 0x2f572000 + 165452
    7   Foundation                     0x2f58a870 0x2f572000 + 100464
    8   Foundation                     0x2f62e740 0x2f572000 + 771904
    9   libdispatch.dylib              0x398de25a 0x398d9000 + 21082
    10  libdispatch.dylib              0x398df684 0x398d9000 + 26244
    11  libdispatch.dylib              0x398df8d8 0x398d9000 + 26840
    12  libsystem_pthread.dylib        0x39a0ac14 0x39a0a000 + 3092
    13  libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 7:
    0   libsystem_kernel.dylib         0x399a5c70 0x39992000 + 81008
    1   libsystem_pthread.dylib        0x39a0ac1e 0x39a0a000 + 3102
    2   libsystem_pthread.dylib        0x39a0aad8 0x39a0a000 + 2776
    Thread 8:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2ebcd346 0x2eb81000 + 312134
    6   CoreMotion                     0x2f2484fc 0x2f20f000 + 234748
    7   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    8   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    9   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 9 name:  WebThread
    Thread 9:
    0   libsystem_kernel.dylib         0x39992a50 0x39992000 + 2640
    1   libsystem_kernel.dylib         0x39992848 0x39992000 + 2120
    2   CoreFoundation                 0x2ec205e4 0x2eb81000 + 652772
    3   CoreFoundation                 0x2ec1ed04 0x2eb81000 + 646404
    4   CoreFoundation                 0x2eb89724 0x2eb81000 + 34596
    5   CoreFoundation                 0x2eb89506 0x2eb81000 + 34054
    6   WebCore                        0x36ebfc70 0x36e01000 + 781424
    7   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    8   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    9   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 10 name:  JavaScriptCore::BlockFree
    Thread 10:
    0   libsystem_kernel.dylib         0x399a4f2c 0x39992000 + 77612
    1   libsystem_pthread.dylib        0x39a0bf62 0x39a0a000 + 8034
    2   libsystem_pthread.dylib        0x39a0cd9c 0x39a0a000 + 11676
    3   JavaScriptCore                 0x2fbb8308 0x2fba6000 + 74504
    4   JavaScriptCore                 0x2fbb5970 0x2fba6000 + 63856
    5   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    6   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    7   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 11 name:  JavaScriptCore::Marking
    Thread 11:
    0   libsystem_kernel.dylib         0x399a4f2c 0x39992000 + 77612
    1   libsystem_pthread.dylib        0x39a0bf62 0x39a0a000 + 8034
    2   libsystem_pthread.dylib        0x39a0cd9c 0x39a0a000 + 11676
    3   JavaScriptCore                 0x2fd56cb2 0x2fba6000 + 1772722
    4   JavaScriptCore                 0x2fd56d0c 0x2fba6000 + 1772812
    5   JavaScriptCore                 0x2fbb5970 0x2fba6000 + 63856
    6   libsystem_pthread.dylib        0x39a0c956 0x39a0a000 + 10582
    7   libsystem_pthread.dylib        0x39a0c8c6 0x39a0a000 + 10438
    8   libsystem_pthread.dylib        0x39a0aae4 0x39a0a000 + 2788
    Thread 0 crashed with ARM Thread State (32-bit):
        r0: 0x00000000    r1: 0x00000000      r2: 0x00000000      r3: 0x27d1f553
        r4: 0x00000006    r5: 0x3b90118c      r6: 0x0000000b      r7: 0x27d1f5bc
        r8: 0x0000000b    r9: 0x00000001     r10: 0x00626000     r11: 0x00000000
        ip: 0x00000148    sp: 0x27d1f5b0      lr: 0x39a0d7b7      pc: 0x399a51f0
      cpsr: 0x00000010
    Zane B Stein
    ("os_version":"iPhone OS 7.1.2 (11D257)","version":"104","bug_type":"198"}
    Incident Identifier: 3526E805-4C03-4956-83B6-2A4AB95B9EE4
    CrashReporter Key:   cfa389285f4559a21d797bfeec6a78c584e798d6
    Hardware Model:      iPhone5,4
    OS Version:          iPhone OS 7.1.2 (11D257)
    Kernel Version:      Darwin Kernel Version 14.0.0: Thu May 15 23:10:37 PDT 2014; root:xnu-2423.10.71~1/RELEASE_ARM_S5L8950X
    Date:                2014-09-02 14:24:12 +0800
    Time since snapshot: 220 ms
    Free pages:                              1448
    Active pages:                            17896
    Inactive pages:                          9268
    Speculative pages:                       11
    Throttled pages:                         209561
    Purgeable pages:                         261
    Wired pages:                             21682
    File-backed pages:                       26187
    Anonymous pages:                         988
    Compressions:                            456385
    Decompressions:                          85356
    Compressor Size:                         44
    Uncompressed Pages in Compressor:        59
    Largest process:   astrogold
    Processes
         Name                    <UUID>                       rpages       recent_max   fds      [reason]          (state)
    CloudKeychainPro <b9fbb8e4989732709cb18c481dfa61a9>          108              108  200                      (daemon) (idle)
        mediaremoted <051ef8b6e7c93fa49a0a2e15ea6e1f52>          193              193  200                      (daemon) (idle)
    MobileGestaltHel <c3c9c32948fe364f8103dd528164b610>          123              123  200                      (daemon) (idle)
             DuetLST <89027d811bd73931a4d45f71c9bbebc7>          472              472  200                      (daemon) (idle)
        itunesstored <00f47fa85c623cee9d55c9b004ba561d>         1426             1426  200                      (daemon) (idle)
                 lsd <8d2569b7b89033328609c73d07410b55>          149              149  200                      (daemon) (idle)
            sandboxd <712c543459bf3d81b0ec88bba199d802>           96               96  200                      (daemon) (idle)
                geod <6e5e9ae33f8638b7be848eac2c1ef70b>          166              166  200                      (daemon) (idle)
             assetsd <6f28405c4c1b35e9aff946c1c4799c0f>          868              868  200                      (daemon) (idle)
            installd <185a1eaa735b3aa38d98092ba8493ba0>          201              201  200                      (daemon) (idle)
           securityd <47657a3a48573d6a8e52ef4cc868248c>          617              617  200                      (daemon) (idle)
    networkd_privile <234d3717143e3bbba12acc5de334deaf>           81               81  200                      (daemon) (idle)
           accountsd <5a5640b47fe637bebb6254deff26eaee>          438              438  200                      (daemon) (idle)
            routined <d5590a1879153ed284886271907ea8fa>          344              344  200                      (daemon) (idle)
    EscrowSecurityAl <d0a689490be631efac2c764fe93300dc>          166              166  200                      (daemon)
            mstreamd <a2bb6401f1d63c7aa320a817d8839522>          406              406  200                      (daemon)
                tccd <ad9819a843e93a1680335febb52c7cc3>          227              227  200                      (daemon)
                 kbd <eba296f6bd4938688fa16a5e39fa477c>         2319             2319  200                      (daemon)
           CVMServer <c95a902a5ae331c2a5239b6cf98a0617>           89               89  200                      (daemon)
           astrogold <58c53f7c8e8931ec823713195426f59c>       166401           166401  200  [per-process-limit] (frontmost) (resume)
    identityservices <d1b907f8a41e3ebd9f270aa846040b07>          581              581  100                      (daemon)
               wifid <2b4c0ddf1a8439838868bf2be61d8bf1>         1286             1286   25                      (daemon)
             syslogd <5c06b8eec36032b49cc9421348ba47ea>          132              132   50                      (daemon)
           locationd <b813efaa4a6a314cafdbbd9b88c30796>         1732             1732  100                      (daemon)
              powerd <bd077d109d773bcd9041153b30ea034a>          128              129  100                      (daemon)
             imagent <79bd0fedda583ae3822051093f7681b5>          571              571  100                      (daemon)
                 vmd <f44f0a6a37293606865eb8862c10b653>          188              188  100                      (daemon)
       iaptransportd <818588012ed93eb7a10ccb22d8acadfe>          223              223   50                      (daemon)
        mediaserverd <e40c7476d9fe3d759bfd28b8d68dc7ba>         2233             2233  200                      (daemon)
       mDNSResponder <60e905f9582a3090ab6e7a257454389e>          226              226  100                      (daemon)
                apsd <b7e19d27180e34aba845e475eae7d3db>          510              510  100                      (daemon)
         dataaccessd <fdf81960fb903bd68616117fd29ce277>         2563             2563  200                      (daemon)
            sharingd <2c731a1c182637a39b004694b2a5e23d>          508              508   50                      (daemon)
        mobileassetd <08440fa17b3537afb347cf78aa039a67>          565              565  200                      (daemon)
         SpringBoard <f73e83ffc898302394baa2042ca232fd>         9211             9211  100                    
          backboardd <b5d33ca6da9c33d48e2c8ccb9930c3dc>         8716             8716   50                      (daemon)
          aggregated <3e381378eb7f3dd2846920cb5db91265>          523              523   50                      (daemon)
           lockdownd <d998e2bac7663966bd0285c07ed89111>          276              276  100                      (daemon)
             configd <20b29bb0286e347ebe7c42aa8ee421c9>          462              462  100                      (daemon)
           fseventsd <8876b6f5a0c13024a12cb3e148ddab61>          303              303  100                      (daemon)
        fairplayd.H2 <243ccf92ad4d34cbb4fdf7e078d55141>          130              130  100                      (daemon)
       wirelessproxd <47699be4861c30abbb375e1d3b9e15dc>          153              153  100                      (daemon)
            BTServer <51d0d4421dc73abf9d4844e2b155c340>          536              536  100                      (daemon)
           distnoted <7895f761ec323e31a356860060f8713d>          155              155  100                      (daemon)
      UserEventAgent <9aedc371d1c037e7b5d7b5577f0424a8>          756              756  100                      (daemon)
    WirelessCoexMana <f5dcce7805a9308bbbcf2d52751385ef>          132              132  100                      (daemon)
            networkd <148d4512d2c43efc95bafd487fd97f4a>          577              577  100                      (daemon)
    filecoordination <7b1b1b1b4fe0364c8e0adfd90f78b4a9>          207              207  200                      (daemon)
       medialibraryd <fdf252b3fb1a3646a836c0c3b5840464>          634              634  200                      (daemon)
         touchsetupd <0a4f35337aa13e55a3d7e56296499e14>          154              154  200                      (daemon)
                 ubd <30a03e11a5c43c7cbd6ecd1aaef27841>          470              470  200                      (daemon)
          CommCenter <463e099ed64e30ad9433b8ea3f4a4e94>         2039             2039  100                      (daemon)
             notifyd <5b4c0731afd533179b295e4f39e589d6>          335              335  100                      (daemon)
    **End**
    <Post Edited By Host>

    Thank you for your reply.
    >You can double-click the home button and then swipe upwards on the thumbnail of the app to force it closed.
    Did that
    >After that, power the phone off and back on again, test.
    Did that
    >If still a problem, force close the app again and then reset the phone, holding the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot, test.
    Did that
    >If still a problem, then connect the device to iTunes and restore from backup.
    Did that
    >If that does not work, it is possible there is something corrupt in the backup. The final step is restore as new, not from a backup.
    This is the only thing I had not done before I posted my initial request for help.  I will work on that....it's a last resort I was hoping not to do, but it sounds like I've already done everything else.
    Thank you.

  • FIM RCDC drop down and function evaluator vs functions within sync rules

    Hi,
     I have several hundred buildings in my organisation and I would like to to give users the ability to select their building name from a custom RCDC - straight forward enough, however I'd also like the following to be automatically selected within FIM:
    Address, City, Post Code, Country
    I believe this can be done in 2 ways:
    An outbound sync rule using a function (.e.g IF(Eq(Address),"Beverly Hills"),"90210",""))
    A function evaluator using a similar expression.
    Whilst I'm comfortable with sync rules I don't know much about function evaluators in workflows and would like some advice on the best approach to take and how to go about it?
    In addition, given there'll be a lot of sites, is there a way to input the RCDC drop down list of sites from a CSV or XML file, rather than having to manually edit the FIM pages and functions?
    Thanks
    IT Support/Everything

    Hi Aetius,
    Yeah, they're the two methods I'm familiar with in the portal to do something like what you're saying automatically: either do it in the sync from source to MV or apply a workflow in the Portal.
    The general idea with the workflow method would be to have a set called something like "Users With Address" and scope it to only users with the address attribute. Have a transition-in MPR that looks at that set and fires off a workflow when a user enters
    that set. There are a lot of options when it comes to how to implement the workflow. You can write your own custom workflow/s. There are some good tutorials by Ross Currie around that http://www.fimspecialist.com/fim-portal/custom-workflow-examples/ and
    there are some that have already been built by Soren Grandfeldt http://fimactivitylibrary.codeplex.com/.
    So if you leave the workflows for a sec, all the associated data about what will be populated if the address is x can be loaded into the portal by creating a custom object type and then adding them all in one by one. You can probably script the part of actually
    adding the data. Or even the custom object type creation if you want. So then you have a central place where that information is all together.
    With the workflow when it's triggered, using the workflows that are floating around the internet you should be able to read the attribute off the user and then lookup the value in the list of custom objects and then update the other attributes of the user,
    City, Post Code, Country using the lookup value. You kind of chain the custom workflows together and pass data from one to other.
    You do need to be careful when you do this sort of thing though. The FIM event queue can get pretty clogged up if you have a huge amount of users in the set and it's trying to process all of these users at once. When you're testing probably better to apply
    the MPR to a manual set and add users one or a few at a time and see how it handles it.

  • TS3276 An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    An email sent from my iMac has a button linked to a clip hosted on Vimeo. When received, the link functions on iMac and iPad, but opens a window of app icons on iPhone and iPod touch. Any ideas what's wrong?

    For anyone else reading this thread, it is worth knowing that sometimes an email is, or can be, corrupted thereby jamming the works. The solution above is good, but I just wanted to suggest another one.
    If the problem arises, go to an online mail access service, such as Mail2Web.com and login to you mail account there and delete the offending message.
    Problem solved.
    And George, as this is all entirely voluntary, whinging about no takers may not endear people to you. Besides which, a few minutes of searching on Google would have found you a number of solutions.

  • I have a question about extracting pages.  When I do the function, adobe saves the individual files as " file name space page number ", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I a

    I have a question about extracting pages.  When I do the function, adobe saves the individual files as "<file name><space><page number>", so the files look like this "filename 1.pdf", "filename 2.pdf", "filename 3.pdf".  Without too many gory details, I am using excel to concatenate some data to dynamically build a hyperlink to these extraced files.  It casues me problems, however, for the space to be the the file name.  Is there any way to change the default behavoir of this function to perhaps use a dash or underscore instead of a space?

    No, you can't change the default naming scheme. You can do it yourself if you extract the pages using a script instead of using the built-in command.

  • Multivalue error when using the previous() function

    I am getting a multivalue error when using the previous() function on a dimension object in the report.  I thought that the previous function was supposed to look at the current report and then look at the previous record's contents.  How could this possibly give me a multivalue error when the value is clearly output in the previous row?  Anyone have any ideas?
    By the way, this is a valuable function for the types of reports that I design.  The next() function would be even more valuable.
    Thanks for your help.

    Hi Michael,
    Could you please test the following solutions it might help you to resolve the issue.
    Solution1:
    Use slice and dice to reset all the tables that have #multivalue in it. The only problem with this workaround is they have to do the formatting manually.
    Solution2:
    Also, test the issue by changing the object to dimension if it is a measure or to measure if it is a dimension.
    Regards,
    Sarbhjeet Kaur

  • How can i set songs within a playlist, or an entire playlist, so that they are not included when using the shuffle function on IPOD Classic? Is this possible?

    How can i set songs within a playlist, or an entire playlist, so that they are not included when using the shuffle function on IPOD Classic?
    Is this possible?

    You can set any song to Skip when shuffling.
    In your iTunes Library, highlight the song and right-click/Get Info. On the Options tab is the Skip when shuffling box. Select that and then Sync the iPod with your Library.

  • Jax-ws 2.2.8 and ws-addressing: Client throwing java.lang.NullPointerException on receipt of HTTP 202 when using non-anonymous ReplyTo address

    Server: JBoss EAP 6.2.0
    Client: JDK 1.7.0_51 x64
    JAX-WS: RI 2.2.8 ( via -Djava.endorsed.dirs )
    I am getting a java.lang.NullPointerException when calling the operation on the WS endpoint from the client when using non-anonymous replyTo address.
    I have simplified the scenario into a small test case that hopefully others can replicate. Since the exception is happening on the client instead of the server, I would think that the container used is irrelevant, but I have specified it nonetheless.
    1) WebService:
    package test.webservice;
    import java.util.Random;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.xml.ws.soap.Addressing;
    @WebService(targetNamespace="http://services.nowhere.org/")
    @Addressing(required=true)
    @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
    public class RandomTest {
        @WebMethod
        public long nextRandom(@WebParam boolean forceException) throws Exception {
            if( forceException ) {
                throw new Exception("Some exception");
            Random rand = new Random();
            return rand.nextLong();
    2) Generated WSDL by JBossEAP 6.2.2:
    <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://webservice.test/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="RandomTestService" targetNamespace="http://webservice.test/">
      <wsdl:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://webservice.test/" elementFormDefault="unqualified" targetNamespace="http://webservice.test/" version="1.0">
      <xs:element name="nextRandom" type="tns:nextRandom"/>
      <xs:element name="nextRandomResponse" type="tns:nextRandomResponse"/>
      <xs:complexType name="nextRandom">
        <xs:sequence/>
      </xs:complexType>
      <xs:complexType name="nextRandomResponse">
        <xs:sequence>
          <xs:element name="return" type="xs:long"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
      </wsdl:types>
      <wsdl:message name="nextRandom">
        <wsdl:part element="tns:nextRandom" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="nextRandomResponse">
        <wsdl:part element="tns:nextRandomResponse" name="parameters">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="RandomTest">
        <wsdl:operation name="nextRandom">
          <wsdl:input message="tns:nextRandom" name="nextRandom" wsam:Action="http://webservice.test/RandomTest/nextRandomRequest" wsaw:Action="http://webservice.test/RandomTest/nextRandomRequest">
        </wsdl:input>
          <wsdl:output message="tns:nextRandomResponse" name="nextRandomResponse" wsam:Action="http://webservice.test/RandomTest/nextRandomResponse" wsaw:Action="http://webservice.test/RandomTest/nextRandomResponse">
        </wsdl:output>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="RandomTestServiceSoapBinding" type="tns:RandomTest">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsaw:UsingAddressing wsdl:required="true"/>
        <wsp:PolicyReference URI="#RandomTestServiceSoapBinding_WSAM_Addressing_Policy"/>
        <wsdl:operation name="nextRandom">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="nextRandom">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="nextRandomResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="RandomTestService">
        <wsdl:port binding="tns:RandomTestServiceSoapBinding" name="RandomTestPort">
          <soap:address location="http://localhost:8080/servertest/RandomTest"/>
        </wsdl:port>
      </wsdl:service>
        <wsp:Policy xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="RandomTestServiceSoapBinding_WSAM_Addressing_Policy"><wsam:Addressing><wsp:Policy/></wsam:Addressing></wsp:Policy>
    </wsdl:definitions>
    3) ant build.xml to generate the client code from WSDL
    <?xml version="1.0" encoding="UTF-8"?>
    <project default="build" basedir="..">
        <property name="jaxws.classpath" location="C://jaxws-2.2.8/jaxws-ri/lib/*.jar"/>
        <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
               <classpath path="${jaxws.classpath}"/>
        </taskdef>
        <target name="build" >
            <!-- For these to work, the JAR files in tools/jaxws-ri must be included in Ant's classpath -->
            <wsimport wsdl="http://localhost:8080/servertest/RandomTest?wsdl"
                   verbose="true"
                   sourcedestdir="src"
                   destdir="bin"
                   keep="true">
                   <xjcarg value="-enableIntrospection"/>
            </wsimport>
        </target>
    </project>
    4) Client code
    4a) ClientTest.java - Actual client run from client
    package test.wsclient;
    import java.util.ArrayList;
    import java.util.List;
    import javax.xml.ws.BindingProvider;
    import javax.xml.ws.Endpoint;
    import javax.xml.ws.handler.Handler;
    import javax.xml.ws.soap.AddressingFeature;
    import org.nowhere.services.RandomTest;
    import org.nowhere.services.RandomTestService;
    public class ClientTest {
        public static void main(String args[]) throws Exception {
            ClientTest app = new ClientTest();
            app.testAddressing();
        public void testAddressing() throws Exception {
            String REPLY_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallback";
            String FAULT_TO_ADDRESS = "http://localhost:8082/servertest/RandomCallbackFault";
            RandomTestService service = new RandomTestService();
            RandomTest port = service.getRandomTestPort(new AddressingFeature());
            BindingProvider provider = (BindingProvider) port;
            // pass the replyTo address to the handler
            provider.getRequestContext().put("ReplyTo", REPLY_TO_ADDRESS);
            provider.getRequestContext().put("FaultTo", FAULT_TO_ADDRESS);
            // Register handlers to set the ReplyTo and FaultTo on the SOAP request sent to the WS endpoint
            List<Handler> handlerChain = new ArrayList<Handler>();
            handlerChain.add(new ClientHandler());
            provider.getBinding().setHandlerChain(handlerChain);
            // Start endpoint to receive callbacks from WS
            Endpoint endpoint = Endpoint.publish(REPLY_TO_ADDRESS, new CallbackSEI());
            try {
                port.nextRandom(false);
            } catch( Exception ex ) {
                ex.printStackTrace();
            } finally {
                Thread.sleep(10000);
            endpoint.stop();
            System.exit(0);
    4b) ClientHandler.java - Used to set the wsa ReplyTo address and FaultTo address when sending SOAP request from client to server
    package test.wsclient;
    import java.util.Set;
    import javax.xml.namespace.QName;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.ws.handler.MessageContext;
    import javax.xml.ws.handler.MessageContext.Scope;
    import javax.xml.ws.handler.soap.SOAPHandler;
    import javax.xml.ws.handler.soap.SOAPMessageContext;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    public class ClientHandler implements SOAPHandler<SOAPMessageContext> {
        public ClientHandler() {};
        @Override
        public Set<QName> getHeaders() {
            return null;
        @Override
        public void close(MessageContext arg0) {
        @Override
        public boolean handleFault(SOAPMessageContext context) {
            return true;
        protected void setAnAddress(SOAPHeader header, String tagName, String address) {
            NodeList nodeListReplyTo = header.getElementsByTagName(tagName);
            NodeList nodeListAddress = nodeListReplyTo.item(0).getChildNodes();
            for (int i = 0; i < nodeListAddress.getLength(); i++) {
                Node node = nodeListAddress.item(i);
                if ("Address".equals(node.getLocalName())) {
                    node.setTextContent(address);
                    break;
        protected String getMessageID(SOAPHeader header) {
            NodeList nodeListMessageId = header.getElementsByTagName("MessageID");
            return nodeListMessageId.item(0).getTextContent();
        @Override
        public boolean handleMessage(SOAPMessageContext context) {
            Boolean isOutbound = (Boolean) context.get(SOAPMessageContext.MESSAGE_OUTBOUND_PROPERTY);
            if (isOutbound) {
                try {
                    SOAPEnvelope envelope = context.getMessage().getSOAPPart().getEnvelope();
                    SOAPHeader header = envelope.getHeader();
                    /* extract the generated MessageID */
                    String messageID = getMessageID(header);
                    context.put("MessageID", messageID);
                    context.setScope("MessageID", Scope.APPLICATION);
                    /* change ReplyTo address */
                    setAnAddress(header, "ReplyTo", (String) context.get("ReplyTo"));
                    setAnAddress(header, "FaultTo", (String) context.get("FaultTo"));
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
            return true;
    4c) CallbackSEI.java - endpoint on the client for server to send the SOAP response back to the client
    package test.wsclient;
    import javax.annotation.Resource;
    import javax.jws.Oneway;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.xml.ws.Action;
    import javax.xml.ws.RequestWrapper;
    import javax.xml.ws.WebServiceContext;
    import javax.xml.ws.soap.Addressing;
    @WebService
    @Addressing
    //@HandlerChain(file = "/handler-chain.xml")
    public class CallbackSEI {
        @Resource
        private WebServiceContext context;
         * If there is no namespace specified in the method below, then the CallbackSEI needs to be in the same package as the
         * WS endpoint.
        @Oneway
        @Action(input="http://services.nowhere.org/RandomTest/nextRandomResponse")
        @RequestWrapper(localName="nextRandomResponse", targetNamespace="http://services.nowhere.org/")
        public void handleNotification(@WebParam(name="return")long random) {
            System.out.println("Asynch response received");
            System.out.println( random );
            //System.out.println("This response relates to the message ID: "+ getMessageID());
    In summary:
    Server is listening on port 8080
    Client will listen in port 8082 for the callback from the server for the SOAP response
    Now when I run the client, I see that the proper behaviour as far as ws-addressing is concerned. That is:
    client  -- SOAP request ( on port 8080 ) --> server
    client <-- HTTP 202 ( empty HTTP body )  --- server
    client <-- SOAP response ( on port 8082 )  --- server
    All well and good, except that I am getting a NullPointerException on the client side when I call the operation.
    With debugging of the SOAP request and responses, I get the following output:
    ---[HTTP request - http://localhost:8080/servertest/RandomTest]---
    Accept: text/xml, multipart/related
    Content-Type: text/xml; charset=utf-8
    SOAPAction: "http://services.nowhere.org/RandomTest/nextRandomRequest"
    User-Agent: JAX-WS RI 2.2.8 svn-revision#13980
    <?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8080/servertest/RandomTest</To><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomRequest</Action><ReplyTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallback</Address>
    </ReplyTo><FaultTo xmlns="http://www.w3.org/2005/08/addressing">
        <Address>http://localhost:8082/servertest/RandomCallbackFault</Address>
    </FaultTo><MessageID xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</MessageID></S:Header><S:Body><ns2:nextRandom xmlns:ns2="http://services.nowhere.org/"><arg0>false</arg0></ns2:nextRandom></S:Body></S:Envelope>--------------------
    ---[HTTP response - http://localhost:8080/servertest/RandomTest - 202]---
    null: HTTP/1.1 202 Accepted
    Content-Length: 0
    Content-Type: text/xml;charset=UTF-8
    Date: Fri, 18 Jul 2014 08:34:36 GMT
    Server: Apache-Coyote/1.1
    java.lang.NullPointerException
        at com.sun.proxy.$Proxy38.nextRandom(Unknown Source)
        at test.wsclient.ClientTest.testAddressing(ClientTest.java:43)
        at test.wsclient.ClientTest.main(ClientTest.java:18)
    ---[HTTP request]---
    Cache-control: no-cache
    Host: localhost:8082
    Content-type: text/xml; charset=UTF-8
    Content-length: 704
    Connection: keep-alive
    Pragma: no-cache
    User-agent: Apache CXF 2.7.7.redhat-1
    Accept: */*
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><Action xmlns="http://www.w3.org/2005/08/addressing">http://services.nowhere.org/RandomTest/nextRandomResponse</Action><MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:65d8d7fc-09e4-494a-a9c5-0a01faf4d7e6</MessageID><To xmlns="http://www.w3.org/2005/08/addressing">http://localhost:8082/servertest/RandomCallback</To><RelatesTo xmlns="http://www.w3.org/2005/08/addressing">uuid:bcd2f6ef-3034-49e8-b837-dbd6a772fb93</RelatesTo></soap:Header><soap:Body><ns2:nextRandomResponse xmlns:ns2="http://services.nowhere.org/"><return>2870062781194370669</return></ns2:nextRandomResponse></soap:Body></soap:Envelope>--------------------
    Asynch response received
    2870062781194370669
    As you can see from the output above, the proxy is throwing an Exception when it receives the HTTP 202 response.
    Any ideas ?

    I think I have found when I get this error and probably I have found a bug. I will appreciate if someone can confirm this.
    In my BPEL project setup, my BPEL process's wsdl file imports another wsdl from different namespace. Here is sample snippet -
    <wsdl:definitions targetNamespace="http://namespace/1">
    <wsdl:import namespace="http://namespace/2" location="resources/another.wsdl"/>
    <plnk:partnerLinkType....../>
    </wsdl:definitions>
    Please let me know. I checked the bundled samples with Oracle BPEL PM and did not find any similar case where process wsdl imports another wsdl.
    Thank you.
    Meghana

  • Error when calling SOAP Runtime functions

    Hi Guys,
    I have a requirement in which i have to consume a webservice and get a response from it but when i consumed the web service and tried to test it i got the below error please let me know solution for this as it is very urgent and also i am very new to web services stuff
    Error when calling SOAP Runtime functions: SRT: Processing error in Internet Communication Framework: ("ICF Error when receiving the response: ICM_HTTP_CONNECTION_FAILED")
    Thanks
    shivraj

    Hi,
    Have a look at this blog from Michal Krawczyk to find a solution:
    The specified item was not found.
    Hope this helps,
    Grzegorz

  • An error occurred when executing a REMOTE FUNCTION CALL.

    Dear all,
    We have two syetms called DXD and GRD , we have a remote enabled function module in the DXD system , when i am trying to call this Function module from
    GRD system it is going for the short dump, and giving the follwing error,
    <b>Error analysis
        An error occurred when executing a REMOTE FUNCTION CALL.
        It was logged under the name "RFC_NO_AUTHORITY"
        on the called page.</b>
    But i do have the access for the DXD system also, i am really struggling to solve this problem, if any lights are there to help me , i will be thank full for then,
    some body suggested for me that we need to maintain the Trusted system tables in the target system.
    Thanks & regards
    Satya.

    first u( user id ) have to get the Authorizations to use RFC ?
    object will be  like S_RFC or some thing like this.
    when u get this kind of error just call /NSU53 then u will come to know which Authorization Object is missing from ur User Profile.
    Regards
    Prabhu

  • Error PLS-00231 When Calling a Local Function In a Procedure

    I hope someone can help me find a workaround to this problem:
    I have a function defined within a PL/SQL block. When I call the function from a SQL statement, I get the PLS-00231 error, which says "Function <fn name> may not be used in SQL.". I don't really understand why I can't do this, since the function works perfectly if I create it in the database. Unfortunately, storing the function in the database is not a desirable option.
    Below is a very simple example program to illustrate the point. Any feedback would be greatly appreciated. Thanks. Brian
    DECLARE
    var INTEGER;
    FUNCTION return_it (i IN INTEGER) RETURN INTEGER IS
    BEGIN
    RETURN i;
    END;
    BEGIN
    SELECT return_it (4)
    INTO var
    FROM dual;
    END;
    --

    Your function return_it is not part of database so you cant use in query.
    Here is what you can do
    08:18:20 SQL> ed
    Wrote file afiedt.buf
    1 DECLARE
    2 var INTEGER;
    3 FUNCTION return_it (i IN INTEGER) RETURN INTEGER IS
    4 BEGIN
    5 RETURN i;
    6 END;
    7 BEGIN
    8 var := return_it (4);
    9 DBMS_OUTPUT.PUT_LINE('var = '||var);
    10* END;
    08:18:26 SQL> /
    var = 4
    PL/SQL procedure successfully completed.

  • TS2755 I receive message prompting me to enter apple ID password when using normal phone functions. I can cancel and still use phone but, how do I get this to stop coming up?

    I receive a message prompting me to enter apple ID when using normal phone functions, if I cancel I can still use phone but why does this keep coming up and how do I change that to only prompt if I want to access apple?

    Search the forums before posting please.  Your question has been asked and answered dozens of times already.
    Settings --> Store --> Apple ID

  • What is an element,when we call a function write_from?

    what is an element,when we cal a function write_from what to assign for ELEMENT  and WINDOW...?
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 4:37 PM

    Hi shekar,
    The main reason of specifying the Function module Write_Form is to make the values visible in the particular window of the form.
    For Ref, see the Below Function Module:
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        ELEMENT = 'HEADER'
        WINDOW =  'MAIN'
    EXCEPTIONS
        ELEMENT = 1.
    In the above example, I need to declare a element in the Main window. So I have passed 'MAIN' in window and 'HEADER' in element.
    REASON OF SPECIFYING:
    Suppose you want to display the values the internal table say suppose it_itab. If you specify this in the sap script like &it_itab-f1& or &wa_itab-f1& without using write_form wont work.
    So this will be specified as,
    SE38:
    Loop at it_itab into wa_itab.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
        ELEMENT = 'HEADER'
        WINDOW =  'MAIN'
    EXCEPTIONS
        ELEMENT = 1.
    endloop.
    Inside Script:
    Inside the Main window:
    /E     HEADER
          &wa_itab-f1&
    what happens is after the loop statement as soon as it encounters the write_form, it searches for the element 'HEADER' in the Main window and values become visible in the form.
    If u need any more details, please tell.
    <REMOVED BY MODERATOR>
    Thanks,
    karthik
    Edited by: Alvaro Tejada Galindo on Feb 20, 2008 4:36 PM

  • TS3297 Error when I use search function in itunes store and select an artist

    When I use search function in itunes store and select an artist I get this message. Microsoft visual C++ run time library. Prog C:\progfiles\itunes\itunes.exe  R6025 - Pure virtual function call .  It then shuts down itunes and cannot provide a solution.
    Have tried reinstalling itunes but it did not help.  Any other ideas?

    I have yet to find a solution, but as a work around, do not click or select any of the suggested results while you are typing in your search. Type in your search, and press enter.

  • Anonymous Functions (Lambda expressions) in Java?

    Hello,
    I need to know if there are anonymous functions in Java. I am writing a platform independent shell, and I would like to use anonymous functions to make the shell better.
    Does Java support anonymous functions or is it unsupported?
    Thanks.

    functions without a name? no
    functions belong to classes, and every class method has a name.
    you want to use lisp.
    %

Maybe you are looking for

  • Any outdated Mac Programs on MacBook Pro '09 that I can or should delete to save space?

    There are some Mac Programs that came with my late 2009 MacBook Pro that I **think** are outdated / unsupported and I am wondering if I can or should delete them to free up critical space. (I use my MacBook Pro for genealogy files and kids' photos an

  • How do I create a group distribution list

    I want to send mail out to the same group of people repeatedly.  How can I identify this group in my contact list as one so I don't have to keep doing its over and over again?  I see there is a group page in the contact book but no plus sign on the b

  • Some movies/categories won't connect to the itunes store.

    Some movies/categories won't connect to the itunes store.  When we try to access kids/family genre it says it can't connect.  But we can see some kids/family movies from top movies, but others not? For instance when I search on a movie it finds the m

  • How to save search in af:query across a session ?

    I am using af:query in advance mode. If suppose, I do a search and save it and reload the page. The saved search is lost. Can someone suggest a way of implementing it in a session , so that if I come back to same page , I can retrieve saved search.

  • How do i  remove the air bubble and dust inside the screen?

    i use the shield on my IPAD, and didnot wait 24 hours. so that's why there has a lot air bubble and dust inside the screen when i remove the shield. How do i remove these air bubble and dust inside the screen of my IPAD?