Calling array in function

on frame 1 of root:
//declare and fill array "mcPopups" with movie clip instance
names
var mcPopups = [ "mcAlta1", "mcAlta2", "mcAlta3", "mcAlta4",
"mcAlta5" ];
//declare function which goes to hidden label in all movie
clips from array "mcPopups"
function turnOff() {
_root.mcPopups.gotoAndStop("hidden");
then on the frame for a button in my movie clip mcAlta1 I
have the code:
stop();
//call function "turnOff();"
close_btn.onRelease = function() {
_root.turnOff();
Am I doing something wrong here as it doesn't work ie the
movie clips should all go to "hidden" when I click my "close_btn"

>> //declare and fill array "mcPopups" with movie clip
instance names
var mcPopups = [ "mcAlta1", "mcAlta2", "mcAlta3", "mcAlta4",
"mcAlta5" ];
//declare function which goes to hidden label in all movie
clips from array
"mcPopups"
function turnOff() {
_root.mcPopups.gotoAndStop("hidden");
First, you are putting strings in the array, and you probably
want your
actual instances. So change the first part to:
var mcPopups = [mcAlta1, mcAlta2, mcAlta3, mcAlta4, mcAlta5];
Next, you need to actually iterate through the array, one
item at a time.
The array contains MC references - which you can tell to
gotoAndStop - an
array does not have a gotoAndStop method so
array.gotoAndStop() makes no
sense. Change your function to:
function turnOff(){
for(var i = 0; i < mcPopups.length; i++){
mcPopups
.gotoAndStop("hidden");
Lastly, it's recommended to not use _root references as root
can change.
Better to do things like this._parent if you need to, but in
your code just
removing all _root should be fine.
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/

Similar Messages

  • Calling a library function node much faster than labview code?

    Hi,  I wrote a labview routine to perform a multiple tau autocorrelation on a large array of integers.  A multi tau autocorrelation is a way to reduce the computation time of the correlation but at the expense of resolution.  You can taylor the multitau correlation to give you good resolution where you need it.  For instance, I require good resolution near the middle (the peak) of the correlation, so I do a linear autocorrelation for the first 64 channels from the peak, then I skip every second channel for the next 32, then skip every 4th channel for 32 more, then skip every 8th for 32 channels... etc.
    Originally, I wrote my own multitau calculation, but it took several hours to perform for just 1024 channels of the correlation of around 2million points of data.  I need to actually do the the correlation on probably 2 billion or more points of data, which would take days.  So then I tried using labview's AutoCorrelation.vi which calls a library function.  It could do a linear autocorrelation with 4 million points in less than a minute.  I figured that writing my code in C and calling it using a call library function node would be faster, but that much faster?
    Finally, I wrote some code that extracts the correlation data points that I would've got from my multitau code from the linear correlation function that I get from the AutoCorrelation.vi.  Clearly this is not optimal, since I spend time calculating all those channels of the correlation function just to throw them away in the end, but I need to do this because the final step of my procedure is to fit the correlation function to a theoretical one.  With say 2million points, the fit would take too long.  The interesting thing here is that simply extracting the 1024 point from the linear autocorrelation function takes a significant amount of time.  Is labview really that slow?
    So, my questions are...  if I rewrite my multitau autocorrelation function in C and call it using a call library function node, will it run that much faster?  Can I achieve the same efficiency if I use a formula node structure?  Why does it take so long just to extract 1024 points from an array?
    I've tried hiding indicators and this speeds things up a little bit, but not very much.
    I'll attach my code if you're interested in taking a look.  There is a switch on the front panel called 'MultiTau'... if in the off position, the code performs the linear autocorrelation with the AutoCorrelation.vi, if in the on position, it performs a multitau autocorrelation using the code I wrote.  Thanks for any help.
    Attachments:
    MultiTauAutocorrelate.vi ‏627 KB

    Hi,
    The C routine that AutoCorrelation.vi is using is probably a higly optimised routine. If you write a routine in LabVIEW, it should be less then 15% slower. But you'd have to know all ins and outs of LabVIEW. How data is handled, when memory is allocated, etc. Also note that the AutoCorrelation.vi has years of engineering behind it, and probably multiple programmers.
    It might even be possible that the c code uses an algorithmic improvement, like the Fast Fourier Transform improves speed on the Fourier Transform. I think the autocorrelation can be done using FFT, but that isn't my thing, so I'm not sure.
    For a fair comparation, posting the code in this forum was a good idea. I'm sure together we can get it to 115% or less of the C variant. (15/115 is just a guess, btw)
    I'm still using LV7.1 for client compatibility, so I'll look at the code later.
    Regards,
    Wiebe.
    "dakeddie" <[email protected]> wrote in message news:[email protected]...
    Hi,&nbsp; I wrote a labview routine to perform a multiple tau autocorrelation on a large array of integers.&nbsp; A multi tau autocorrelation is a way to reduce the computation time of the correlation but at the expense of resolution.&nbsp; You can taylor the multitau correlation to give you good resolution where you need it.&nbsp; For instance, I require good resolution near the middle (the peak) of the correlation, so I do a linear autocorrelation for the first 64 channels from the peak, then I skip every second channel for the next 32, then skip every 4th channel for 32 more, then skip every 8th for 32 channels... etc. Originally, I wrote my own multitau calculation, but it took several hours to perform for just 1024 channels of the correlation of around 2million points of data.&nbsp; I need to actually do the the correlation on probably 2 billion or more points of data, which would take days.&nbsp; So then I tried using labview's AutoCorrelation.vi which calls a library function.&nbsp; It could do a linear autocorrelation with 4 million points in less than a minute.&nbsp; I figured that writing my code in C and calling it using a call library function node would be faster, but that much faster?Finally, I wrote some code that extracts the correlation data points that I would've got from my multitau code from the linear correlation function that I get from the AutoCorrelation.vi.&nbsp; Clearly this is not optimal, since I spend time calculating all those channels of the correlation function just to throw them away in the end, but I need to do this because the final step of my procedure is to fit the correlation function to a theoretical one.&nbsp; With say 2million points, the fit would take too long.&nbsp; The interesting thing here is that simply extracting the 1024 point from the linear autocorrelation function takes a significant amount of time.&nbsp; Is labview really that slow?So, my questions are...&nbsp; if I rewrite my multitau autocorrelation function in C and call it using a call library function node, will it run that much faster?&nbsp; Can I achieve the same efficiency if I use a formula node structure?&nbsp; Why does it take so long just to extract 1024 points from an array?I've tried hiding indicators and this speeds things up a little bit, but not very much.I'll attach my code if you're interested in taking a look.&nbsp; There is a switch on the front panel called 'MultiTau'... if in the off position, the code performs the linear autocorrelation with the AutoCorrelation.vi, if in the on position, it performs a multitau autocorrelation using the code I wrote.&nbsp; Thanks for any help.
    MultiTauAutocorrelate.vi:
    http://forums.ni.com/attachments/ni/170/185730/1/M​ultiTauAutocorrelate.vi

  • How to create an array of functions

    normally I use
    repository.getFunctionTemplate(functionName);
    to get a function object.
    Is there a way to get an array of function objects for a function name.
    I am trying to execute multiple functions in the same connection to reduce calls for logging on and off for each call.
    Thanks,
    Aditya Pandit

    Hi Aditya,
    From
    <a href="https://media.sdn.sap.com/javadocs/NW04s/SPS7/jc/com/sap/mw/jco/IFunctionTemplate.html">JavaDoc</a>:
    <i>getFunction
    public JCO.Function getFunction()
    <b>Creates</b> a function object from the template and returns it
    Returns:
    the function created from the template
    </i>
    So, you can reuse function template to create multiple fuctions.
    Best regards, Maksim Rashchynski.

  • Calling a private function when inside another class?

    Can't help it but im curious how classes seem to be able to
    call private functions inside other classes. I'm mainly thinking
    about the addEventListener() here. When adding a listening function
    to a class, that function can be private, and yet it seems to be
    called magically somehow. Or maybe its all internal? I dunno.
    Anyone? :D

    Hi Kenchu1,
    You can grab a copy of the open source API here:
    http://www.baynewmedia.com/download/BNMAPI10.zip
    (feel free to drop by
    the main site for documentation as well :) ). The main class
    is the
    Events class, "broadcast" method. This method broadcasts
    events in a
    decoupled fashion, meaning that listeners can listen to
    messages that
    aren't bound to a specific sender. The AS3 version works in
    much the
    same way except that I still haven't fully fleshed out the
    cross-SWF
    communication that this version can do (broadcast across all
    movies on
    the same computer using LocalConnection).
    Basically, the broadcaster works like this:
    1. Add event listener and bind to function A (called from
    within the
    class so the reference is available)
    2. Event listener pushes this into the listener array. It was
    provided
    by the class so the reference is valid and is now a part of
    the events
    class as well.
    3. Broadcast runs through all associated events when it comes
    time to
    broadcast and calls the function by using the array
    reference:
    this.listeners[message].call(classInstance,someParameter);
    In other words, the class that adds the listener "allows"
    the event
    broadcaster to use the reference because it passes it out.
    You can do
    the same thing by calling:
    someOtherclass.functionRef=this.privateFunction
    someOtherClass is the class that will store the private
    reference,
    functionRef is some variable to hold the reference, and
    privateFunction
    is the private function. Then, in someOtherClass, you can
    call:
    this.fuctionRef(someParameter);
    Hope this helps.
    Patrick
    Kenchu1 wrote:
    > Patrick B,
    > exactly! Something like that is what im looking for. I
    have my own rather
    > simple system right now with listeners and classes
    calling these, but since i
    > dont know how to call a private function, i had to make
    all the listening
    > classes functions public - something id rather avoid.
    Exactly how did your
    > event broadcasting system work? Oh, and we're talking
    AS3 btw.
    >
    > How do i call a function via a reference? (to the
    function? To what?)
    >
    http://www.baynewmedia.com
    Faster, easier, better...ActionScript development taken to
    new heights.
    Download the BNMAPI today. You'll wonder how you ever did
    without it!
    Available for ActionScript 2.0/3.0.

  • NSArray of UIButtons calling the same function

    I've been thinking and searching and I can't figure it out. I've come across these two threads which seem to be pieces of my issue:
    http://discussions.apple.com/message.jspa?messageID=7891554
    http://discussions.apple.com/thread.jspa?threadID=1985019&tstart=0
    I'm basically attempting to create an array of 9 UIButtons which will all call the same function, but I need to know which button was clicked.
    I'm not entirely sure how to create the NSArray of buttons, and when I include (id)sender with the selectSquare function, it doesn't work. Any help is much appreciated!
    // Square a1
    a1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [a1 setFrame:CGRectMake(0.0f, 0.0f, 70.0f, 70.0f)];
    [a1 setBackgroundImage:[UIImage imageNamed:@"black.png"] forState:UIControlStateNormal];
    [a1 setCenter:CGPointMake(60.0f, 200.0f)];
    [a1 addTarget:self action:@selector(selectSquare) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:a1];
    // I currently have the previous "a1" button code repeated 9 times, each
    // with a different button name... I want to put all these in a single
    // array instead
    -(void) selectSquare:(id) sender {
    if(turn == x) {
    [sender setBackgroundImage:[UIImage imageNamed:@"x_button.png"] forState:UIControlStateNormal];
    statusImage.image = [UIImage imageNamed:@"o_image.png"];

    TicTacToe indeed!
    The positions I have for my buttons seemed to be perfect when I tested them, so I just went with that vs. using IB.
    As for the tag property, would it just be an int? Like:button1.tag = 5And then use the tag as that button's index in the array? So the button with tag 5 would be the 6th element?
    Also, I'm still not sure on why -(void) selectSquare:(id) sender; doesn't work. When I click on "a1" (the current button with an action assigned to it), the simulator does nothing and then brings Xcode to the front... But when I take out (id)sender, it works fine.
    In the second thread I posted, somebody mentioned something about unbinding and rebinding control actions to fix this, but I'm not too sure what that process entails.
    Here is my interface for that controller:#import <UIKit/UIKit.h>
    @interface TicTacToeViewController : UIViewController {
    UIImageView *statusImage;
    UIButton *playButton;
    UIButton *a1;
    UIButton *a2;
    UIButton *a3;
    UIButton *b1;
    UIButton *b2;
    UIButton *b3;
    UIButton *c1;
    UIButton *c2;
    UIButton *c3;
    //IBOutlet UILabel *gameText;
    //IBOutlet UILabel *x_score;
    //IBOutlet UILabel *o_score;
    //IBOutlet UILabel *round;
    NSInteger turn;
    //NSInteger xscorevalue;
    //NSInteger oscorevalue;
    @property(nonatomic,retain) IBOutlet UIImageView *statusImage;
    @property(nonatomic, retain) UIButton *playButton;
    @property(nonatomic, retain) UIButton *a1;
    @property(nonatomic, retain) UIButton *a2;
    @property(nonatomic, retain) UIButton *a3;
    @property(nonatomic, retain) UIButton *b1;
    @property(nonatomic, retain) UIButton *b2;
    @property(nonatomic, retain) UIButton *b3;
    @property(nonatomic, retain) UIButton *c1;
    @property(nonatomic, retain) UIButton *c2;
    @property(nonatomic, retain) UIButton *c3;
    //@property(nonatomic,retain) IBOutlet UILabel *gameText;
    //@property(nonatomic,retain) IBOutlet UILabel *x_score;
    //@property(nonatomic,retain) IBOutlet UILabel *o_score;
    //@property(nonatomic,retain) IBOutlet UILabel *round;
    @property(nonatomic) NSInteger turn;
    //@property(nonatomic) NSInteger x_score;
    //@property(nonatomic) NSInteger o_score;
    //-(void)reset:(BOOL) newGame;
    -(void) selectSquare:(id) sender;
    @end

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • How to call a SQL function from an XSL expression

    Hi
    In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
    The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
    The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
    1) How to call a SQL function from an XSL expression that is allowed in BI template.
    If anyone ahs faced similar requirements please share your approach.
    Thanks
    Srimathi

    Thank u..
    but i'd seen that link wen i searched in google..
    Is it possible without using any 3rd party JARs and all?
    and more importantly plz tell me what should be preferred way to call a javascript function?
    Do it using addLoadEvent() or Windows.Load etc
    OR
    Call it thru Xsl? (I donno how to do dis)
    Thanks in Advance..
    Edited by: ranjjose on Jun 3, 2008 8:21 AM

  • Problem while calling an RFC Function Module in Background

    Hello,
    I have created a RFC function module for reading data from an external DB system. The FM calls an external RFC program (coded in C++ using RFC SDK), which delivers the required data. This external program is maintainged as an TCP RFC Connection in SM59.
    Further I have created a report, that calls the RFC function module to get the data from the external RFC programm.
    My problem is, when I call the report in foreground, everything works OK, the RFC connection works and data can be read from the external program.
    However, when I schedule the report to run in background as a job, the report is stating in the protocoll that there was a problem calling the defined RFC connection (although the connection is working properly at that time).
    More funny is, this particular problem with running in background occurs only in the productive system, in test and development system the report works correctly also while running as a job in background.
    Can you suggest the solution to this problem? Could it be something with authorisations or server settings?
    I will be on holiday for the next 6 weeks, so take your time to answer .
    Regards,
    Dusan.
    Edited by: Julius Bussche on Jan 22, 2009 7:19 PM
    Please read the forum rules about u r g e n t ...

    This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
    Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
    It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
    Just guessing, but might be worth checking.
    Cheers,
    Julius

  • How can I have a backing file call a JavaScript function?

    I have a Weblogic portal with a JSP portlet. The portlet has a backing file. How can I get the backing file to call a JavaScript function in my portlet?
    thanks

    Hi
    your questions are not correct because you are mixing up server side operations with client side operations.
    First server side code executes then the page is sent to the browser , then any javascript executes on the browser. So asking for javascript to be called from backing file (server side) doesn't make sense or asking for javascript to read a parameter doesnt exactly work either.
    However in your server code suppose you have a variable action in the request that you want javascript to know then in your JSP you would add something like
    <script type="text/javascript">
    var action = '${requestScope.action}';
    alert(action);//or whatever you want to do
    <c:if test="${requestScope.someOthervariable == ''xyz'}"><%-- this check is done on the server --%>
    callSomeJavascript(); <%--this javascript is only executed when the server side value of someOtherVariable is xyz --%>
    </c:if>
    </script>
    i.e. you can output the javascript that has the variables you need or the function calls you want.
    Like I said understand whats server side and whats client side.

  • How can I call a plsql function from an attribute?

    I have an attribute defined in an element. I want execute a PLSQL function from the attribute, and display the returne value with an HTML template.
    I've defined the attribute's type like PLSQL, and I've put the called of the function in the value of the attribute, but it doesn't work. The only value I obtain is an URL (I think that is the URL of the function or someting like this).
    How can I call to my function from the attribute and display the returnes value in the page?
    Thanks.

    Thanks, but it doesn't work. I have an attribute called ID_BOL and I want to associate a sequence to that attribute. I've created a function, with the sequence. This function return de value of the sequence. I want taht the attribute takes the value of the sequenece dinamically.
    I've tried it, creating the type attribute like PLSQL, and calling the function from the attribute, but it doesn't work.
    How can I return the sequence value to my attribute?
    Thanks.

  • How can i declare 2 or more dimension array as function parameter???

    I am new to Objective-C and Cocoa. and now I have a problem.
    I want to send 2 dimension array to function but it cannot compile the error is "array type has incomplete element type" Please help me
    This is my Interface
    + (void) reValueInArray: (int[][] ) labelValue replaceValue: (int) oldValue withValue: (int) newValue;
    and one more question
    How can i get length of array
    1. array that declare as array at first (int a[5] for example)
    2. array that declare as pointer at first (int a* for example)
    Thank you Very much

    Satake wrote:
    a 2 dimension array is just an array of arrays correct?
    No. It isn't.
    so it'd be something like
    - (void)arrayManipulator:(NSArray *)aTwoDimensionArray;
    You're mixing metaphors. The original poster isn't using NSArray, but, rather, C arrays.
    + (void) reValueInArray: (int[][] ) labelValue replaceValue: (int) oldValue withValue: (int) newValue;
    In C, a multi-dimensional array is just one big, single-dimensioned array that uses fixed sizes for all but one of the component arrays to find a particular element. That means that you can't ever do something like:
    There are several workarounds.
    1) Use NSArray, as suggested in the first reply. That will solve this problem and lots more. With NSArray, you really an have arrays inside of arrays.
    2) Treat the array as just a plain old pointer in the function signature, then cast it back to the properly dimensioned array.
    3) Create a true array of arrays in C, using dynamic allocation. More trouble than it's worth.
    4...N) Other options that are probably more trouble than they're worth.

  • Visual fortran calling a c function in visual studio

    Hi,
    I am running Windows 8.1 with Visual Studio Prof. 2012. I have installed Visual Fortran also. Now I wanted to make a solution with two projects one for Visual Fortran and one for C, and be able to call a C function from within the Fortran. 
    Can someone, please, show how to do this step by step? Guide with pictures would be awesome.
    Thanks in advance.

    Hi Engineer101,
    One way to integrate your code into TestStand would be to save it as a .dll file.  Cick this link for information on how to do this in visual c++ 2008. Once you have the dll, you can call it in teststand using a c/c++ dll action step.  I hope this helps, and let me know if you have any further questions!
    Al B.
    Staff Software Engineer - TestStand
    CTA/CLD

  • How to call a Javascript function from backing bean without any event

    Hi,
    Someone knows how to call a Javascript function from backing bean without any event ?
    thanks

    Please review the following thread:
    ADF Faces call javascript
    Luis.

  • How to call the 'DETAIL' function in ALV for a program?

    Dear Friends,
    I have a prf_tree (TYPE REF TO cl_gui_alv_tree), and I added below codes to add an new button for displaying the detail record, it works fine:
    CALL METHOD prf_toolbar->add_button
        EXPORTING
          fcode     = prf_tree->mc_fc_detail
          icon      = icon_detail
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Show Details'.
    Everytime I click this new button, a window will popup and display the record details.
    My question is: how to call this standard function  ('DETAIL' function) in a program? for example:
    CASE ldf_ok_code.
        WHEN gcf_okcode_save.
          PERFORM okcode_save.
        WHEN 'SHOW_DETAIL'.
          CHECK  gdf_nodkey_9003 IS NOT INITIAL.
          PERFORM SHOW_DETAIL.(How to write this code to display the detail data of the selected record?)
      Thanks a lot!

    Hi,
    Go for Interactive Reporting
    like When u click on the output then it will show the Detail report u want .
    for that purpose Pls
    Use Hide command .
    And call another report
    by using SUBMITT Program

  • Calling Synchronous RFC Function Module in Background

    Hi all,
    Currently we are working on some requirement where in we have to retrieve data from one system(CRM) and update the same into another system(ECC). We have developed a RFC Function in CRM system and it is being called from ECC system as in synchronous mode via a batch program.
    Now since all sychronous call to a RFC function will be dialog there is a constraint on the runtime which is being set by maximum run time for each dialog work process. So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.
    The standard TRFC, QRFC calls in background runs asynchronously and so I am trying to check with the SDN world as whether has anyone tried  SRFC(Synchronous) call in background?
    Thanks in advance,
    Jagath

    So my question is there an option to call an RFC function synchronously in background (background task) so there is no runtime performance.
    One solution would be to increase the value of the "time out" parameter defined the CRM system. This i feel is not a fool-proof solution as the run-times cannot be predicted. Check this thread: Re: RFC timeout profile parameter
    For me a better solution would be to implement tRFC call instead of a synchronous call. Any reasons why you don't want to implement a tRFC ?
    BR,
    Suhas
    Edited by: Suhas Saha on Jun 26, 2010 8:52 AM

Maybe you are looking for

  • Migrate from sharepont 2010/ SQL Server 2008 R2 to Sharepoint foundation 2013 / SQL Server 2008 R2 SP1 single server

    Whenever I upgrade database from sharepoint foundation 2010 to 2013 using powershell ( stsadm.exe -o addcontentdb -url http://.....) I get this error when i try to navigate in Sharepoint Central administration Help (new window) Go back to site Error

  • Replacing a lost or stolen pre-paid sim card

    Please call us on 13 22 00 to arrange a replacement. Any credit on your Pre-Paid account will remain, but credit expiry periods will still be applicable. If your credit is about to expire, you can recharge your account to retain the credit balance un

  • Is there a Start Menu function in OSX?

    is there a way to control what starts in osx when i start my computer? for instance i am using a great tool called snagit which someone recommended on the list and i would like it to always be working when my computer is on. is my only option to star

  • Main.cpp uses different settings?

    Hi only two *.cpp in my project. Why is now main.cpp using suddenly different settings than the other cpp? Many thanks

  • Cisco AP 2602 stand alone "nat mode"

    normally, we config AP so the client have same subnet which AP connect to switch or modem like this: dot11 ssid <SSID-Name> authentication open guest-mode interface Dot11Radio0 ssid <SSID-Name> no shutdown interface Dot11Radio1 ssid <SSID-Name> no sh