Calling a function from within a movieclip

How do I do this, and Is it wrong to do it this way?
I have a movieclip on the timeline and within that movieclip
it has buttons which I've placed listeners. I'm doing it this way
rather than putting the code in the document class because the
buttons don't appear right away in the movieclip (not until around
frame 10). The function is defined in the document class because it
is used with other movieclips.
Anyone have an idea on how to properly do this?

Well, I'm at least not getting an error - however, nothing is
happening when I click the button to call the function (which is
indeed public). Inside the function is a simple trace. I've even
added a param to the function just for fun, and there's no error
when calling the function from the button.

Similar Messages

  • Calling ORACLE Functions from within CF Builder report

    Hi, I have an ORACLE function that I would like to call from within my CF REPORT.
    I know there is a section in the report builder where you can write coldfusion code to perform tasks, but I would rather simply call the ORACLE function for each detail row in the report
    I do not want to call this function from within my main ORACLE query that I use for the report, so please don't suggest that.
    Thanks so much.
    -Jim

    6.0.5 is not certified against 10g database, so I suggest to upgrade to 6.0.8.26 (6i patch 17) first to see if the problem is gone.

  • Calling a Function from another Function within CFC

    Hi all,
    I have many functions in my CFC that do various things, but
    one query is a query that selects absolutely every record from a
    table.
    The thing is, I need to do a query like this in another
    function to obtain only a recordcount of the same table used in
    both separate functions. Instead of writing the query out again,
    how can I utilise the function already written?
    My question is, how can I invoke and use the results of a
    query in one cffunction for another cffunction in the same CFC
    component?
    An example may look like the code attached...
    Many thanks for your patience and help!
    Mikey.

    quote:
    Originally posted by:
    Dan Bracuk
    Generally, to call a function from within a cfc, you do
    exactly what you do outside a cfc.
    For your specific case, if your requirements permit it, you
    might consider caching the big query for a couple of seconds. Then
    you can continously call the function and not have to wait for it
    to run and bring back the data each time.
    Do you mean to say that within a CFC function I can execute
    the same cfinvoke tags I use in normal CFM pages?
    Mikey.

  • How do I call a function from an Itemrenderer?

    Hi, Im new in flex and I wonder if I can call a function from within an AdvancedDataGridRendererProvider
    for example:
      <mx:AdvancedDataGrid>
        <mx:columns>
            <mx:AdvancedDataGridColumn  dataField="id" />
        </mx:columns>  
        <mx:rendererProviders> 
            <mx:AdvancedDataGridRendererProvider 
                dataField="detail"
                renderer="components.myRendererProvider"  
                columnIndex="2" 
                depth="2"                     
                />     
        </mx:rendererProviders>       
      </mx:AdvancedDataGrid>
    <mx:Script>
         <![CDATA[
              public function outerFunction(){
        ]]>
    </mx:Script>
    myRendererProvider
    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" paddingLeft="10" paddingRight="2" horizontalGap="2" paddingTop="0">
    <mx:Script>
        <![CDATA[   
         public function callOuterFunction( ){
              how do I call the outerFunction() from here?
        ]]>
    </mx:Script>
        <mx:LinkButton fontSize="13"  fontWeight="bold" click="callOuterFunction( )" label="label"  />
    </mx:HBox>
    thank you in advance.

    There are two ways to call a function from within an ItemRenderer. One way is to dispatch an event from your ItemRenderer and listen for the event in your main application. This approach has the advantage of creating loosely coupled code which is eaiser to maintain and extend if needed, but it takes a bit more work to set things up than using the second aproach lised below. You could also create a custom event to have greater control over what data is sent with the event.
    private function callOuter():void {
         this.dispatchEvent(new MouseEvent());
    The other approach is to call the main application by using parentDocument.
    private function callOuter():void {
         parentDocument.handleItemRenderer();
    Chris

  • Using 'export -f FUNCTION' from within a script doesn't work

    Why doesn't the 'export -f FUNCTION' work as expected in the following:
    #!/bin/bash
    target="$1"
    [[ -z "$target" ]] && echo "No target specified." && exit 1
    work() {
    bsdtar -xOf "$target" .PKGINFO | egrep -w 'pkgname|arch|pkgdesc|group|conflict|depend|replaces' | sed -e 's/pkgname/\npkgname/' >> /scratch/pkgs.log
    export -f work
    find /scratch/repo -name "$target*.pkg.tar.xz" | parallel work
    It errors out when called:
    % ~/bin/repo/check_pkgs broadcom
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work
    zsh:1: command not found: do_work

    moetunes wrote:The command you are exporting is called work. The command it fails on is do_work
    That was a copy/paste error based on me trying multiple scripts.  Sorry about the confusion.
    % ./test linux
    zsh:1: command not found: work
    zsh:1: command not found: work
    falconindy wrote:
    It's also the wrong solution to be exporting functions...
    Yay for ineffective crossposting... https://bbs.archlinux.org/viewtopic.php?id=153461
    Exporting functions is recommended in the parallel man page.
    The command must be an executable, a script, a composed command, or a function. If it is a function you need to export -f the function first. An alias will, however, not work (see why http://www.perlmonks.org/index.pl?node_id=484296).
    Also, how is this a cross post?  The post you referenced is about parsing input, this one is about calling a function from within the parent script.
    Awebb wrote:Why does zsh report a problem with a bash script?
    No idea
    Last edited by graysky (2012-11-24 14:35:15)

  • Need help to call a simple function from within another function?

    I created a movieclip which has a function in its one and only frame.
    function testx() {
    x = x+2};
    This movieclip is in the main timeline (in its own layer).
    In another layer on the timeline I have created a single keyframe with a button instance called myBtn
    myBtn.onRelease = function() {
    var x
    x =2
    testx(2);
    trace (x);
    What I want to do is call the function in the movieclip frame from the button press function. However, I can't seem to reference it properly.
    Can anyone help me to basically call a simple function from within another function?

    Yes am using CS4.  Have saved it as CS3 now.  Ok the file is somewhat complicated and what I am testing is not what I ultimately want to do but if I can pass that variable I can figure it out.  In terms of describing the file I think the only parts of importance are what I put in my previous post (please let me know if there is something I should be telling you that I have missed).  I am 99.9% sure that I am using the correct instance name.
    Scene1 Layer3 Frame1 has the function call for the button.
    myBtn.onRelease = function() {
    var x
    x = 2
    testx(2);
    trace (x);
    Slideshow layer //Actions Frame1 has the function
    function testx(x) {
    x = x+2};
    thank you so much for helping me.

  • Trying to call a root level function from within a loaded swf

    I'm not very familiar with AS3... I'm trying to have a loaded swf file call a function from the parent to unload itself when it comes to the end (on the timeline, not as a button). I'm assuming I need to be calling the function (that is used for the close button) from the loaded swf (perhaps I'm mistaken though?).
    Here's the code from one of my buttons that loads an swf. I'm guessing I need to call the closeSWF function from the timeline of my loaded movie but having no luck figuring out how to do that.
    Any help would be appreciated.
    // 01 ------------------------------------------------------
    function loadWeaving(ev:MouseEvent):void {
      // load SWF
      var movieClip:MovieClip = new holder_mc;
      //add it to the stage
      addChild(holderSWF);
      holderSWF.x=0;
      holderSWF.y=0;
      var requestEN:URLRequest = new URLRequest("WhatIsWeaving_Eng.swf"); // english
      holderSWF.load(requestEN);
      close_bt.addEventListener(MouseEvent.CLICK, closeSWF);
      function closeSWF(infoObject:Object):void {
      trace("close SWF");
      removeChild(holderSWF);
      // reset switch
      close_bt.visible = false;
      showAllButtons();
      infoObject.currentTarget.removeEventListener(infoObject.type, closeSWF);
      setChildIndex(close_bt,numChildren - 1);
      close_bt.visible = true;
      hideAllButtons();
      // - start timer last
      myTimer.addEventListener(TimerEvent.TIMER, closeSWF);

    You're exactly right. If you attach an event listener to the Loader before you add it to the stage, you can then use event.currentTarget to refer to the loader. And this is definitely the better way to do it if you're planning to use the loaded swf from multiple places or could ever need to do this in the future.
    So:
    protected function initLoader():void {
         var loader:Loader = new Loader();
         loader.addEventListener('closeMe', closeLoader);
         loader.load(new URLRequest(...));
         addChild(loader);
    protected function closeLoader(e:Event):void {
         var loader:Loader = e.currentTarget as Loader;
         if (loader) {
              loader.unloadAnstop(true);
              loader.removeEventListener('closeMe', closeLoader);
              removeChild(loader);

  • Call Actionscript function from Javascript

    Can anyone show me a simple example of calling an
    actionscript function from within javascript? Everything I have
    found searching online refers to using the ExternalInterface but I
    was sure I also read that Adobe Air does not support it. I am
    currently using htmlloader to load a html page containing
    javascript into an <mx:HTML>. But I cant seem to touch the
    actionscript functions from within javascript. I am specifically
    trying to work with the FCKeditor that I have integrated so if
    anyone has any examples other methods of integrating the editor I
    would love to see them as well.
    Thanks!

    Let's assume u have embeded swf object named "flashObj"
    <embed src="MYSWF.swf" quality="high"
    width="100%" height="100%" name="flashObj"
    play="true"
    loop="false"
    quality="high"
    allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash"
    pluginspage="
    http://www.adobe.com/go/getflashplayer">
    </embed>
    On each time onblur is called it invoke AS function
    myActionScriptFn
    window.onblur = function() {
    if(flashObj != null){
    flashObj.myActionScriptFn(navigator.appName);
    You need to add a listener in Action Script code
    ExternalInterface.addCallback("myActionScriptFn",
    myActionScriptFn);
    public function myActionScriptFn(appName:String):void
    // Any code here
    Regards

  • Possibility to execute Acrobat Pro's "Combine files into PDF" function from within SAP?

    Good day.
    Presently, a company uses Acrobat Pro to manually combine files such as *.pdf, *.jpg, *.doc, which have been downloaded from SAP's Document Management System, into one pdf file. I would like to know if it is possible to automatically execute Acrobat Pro's "Combine files into PDF" function from within SAP (ECC 6.0) application system. I'm wondering if this could be achieved from a program via OLE (Object Linking and Embedding) or RFC (remote function call).
    Thanks in advance for your thoughts and inputs.

    Yes, you can combine PDF files via IAC/COM methods.

  • How do i call a Function from another Function ?

    When i press a button, i want a series of functions to execute one after another (they contain tweens, but its irrelevant), each of them waiting for the previous to be completed. I want to put the series of functions inside one function, so i can call just this function to execute all the others. The animations are working fine, but i dont know how call Functions from within another function. Also it would be necessary each function to wait until the previous has completed, to execute. Here is a clear example of what i need to do:
    boton.onPress = animate ;
    Function animate () {
         animation1 (onComplete: animation2);
         animation2 (onComplete: animation3);
         animation3 ;
    Function animation1 () { Tween 1};
    Function animation2 () { Tween 2};
    Function animation3 () { Tween 3};
    any suggestions ?

    I'd do something like this:
    boton.onPress = animation1 ;
    Function animation1 () {
         var Tween1 = new Tween();
        Tween1.onComplete =  animation2;
    Function animation2 () {
         var Tween2 = new Tween();
         Tween2.onComplete = animation3;
    Function animation3 () {
         var Tween3 = new Tween();

  • Call a function from another software

    hello,
    Iam working on a program where i have to invoke a function from another software, is there any way i can do that? someone told me that i can use RMI to invoke the function but it seems to me like RMI is mainly for networked and distributed systems. any suggestions? i have an idea in my mind, if the software is programmed using c/c++ i can use the native coding to access the functions, well this is only a blind shot, not sure about it.
    asrar

    Hey asrar,
    It is possible to call external programs from within the JVM. You need to do the following:
    Process p = java.lang.Runtime.getInstance().exec("some.exe");
    You can then do the following:
    p.waitFor();
    This will block until the process returns.
    The Process class gives you access to 3 streams.
    p.getInputStream(); returns a stream that the process sends to stdout.
    p.getErrorStream(); returns a stream that the process sends to stderr.
    p.getOutputStream(); returns a stream that allows you to send data to the process.
    That is basically all you get.
    regards,
    Dr_N35S

  • Remove child on the root timeline from within a movieclip

    Hi
    How do I remove a child from the root timeline from within a separate movieclip?
    I've tried
    MovieClip(parent).removeChild(mc1);
    But I get this error
    1120: Access of undefined property mc1.
    I could write a function in the root timeline that just removes child and then run that from within the movieclip but is there a better way?
    Thanks in advance.

    Thanks for replying.
    I asked on Kirupa but I couldn't access the site so I asked here.
    I guy answered with this
    MovieClip(parent).removeChild(MovieClip(parent).getChildByName("mc1"));
    It works fine, is this the best way to do it?
    Not sure if I understand what you meant?
    Just to be clear I have to movie clips on the stage mc1 and mc2 and i want to remove mc1 from within mc2's timeline.
    Thanks again

  • Is it possible, when i call a vi from within my code, to pass to it parameters as input and to return some values too?

    Hi There!
    I am currently calling a vi from within my code. However, what i would like to do, is to pass it 2 int values when i call it and for it to return 2 int values when it is done!
    Any advice on how i can do this please.
    Thanks.
    Regards,

    Hi Matrix,
    is there a reason you do it this way? By Ref (it is called dynamically loading)
    If you place the VI directly on the BD of a VI you can just wire things up.
    Now if you need dynamically loading. hoover the open VI-ref function and right click on the type specifier and select create constant. Then right click browse, browse to your VI. Now you have the connector pane.
    But if I were you I just use VI directly, because you'll keep connections active between the two VI's
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Call peoplesoft function from java code

    Can we call the peoplesoft decrypt function from within java code ?

    Hi Sumit,
    For getting the connection, I would use something like:
    import com.sap.mw.jco.JCO;
    public class R3Connector {
         private JCO.Client jcoclient = null;
         public  R3Connector () {
                   super();
         public JCO.Client getClient() {
              if (jcoclient == null) {
                   /* get connection from Pool */
                   jcoclient = JCO.getClient (POOL_NAME);
              return jcoclient;
         public void releaseClient() {
              if (jcoclient != null) {
                   JCO.releaseClient(jcoclient);     
    and of course you will have to define your POOL property somewhere (portalapp.xml presumably)
    Hope this helps!

  • How to call a package from within a package

    How would I call a package from within a package and pass variables to it. For instance I am trying to pass variables to a log package from another package when a user inserts or updates a table

    First, technical questions need to be addressed to one of the technical forums. Products | Database | SQL & PL/SQL would be appropriate for this question. Please direct any followup to that forum.
    Second, you cannot call a package; a package is a collection of stored procedures and functions. You can call a packaged function or procedure from another package simply by specifying the package name and the procedure
    CREATE OR REPLACE PACKAGE pkgA
    AS
      PROCEDURE callPkgB;
    END;
    CREATE OR REPLACE PACKAGE BODY pkgA
    AS
      CREATE PROCEDURE callPkgB
      AS
      BEGIN
        pkgB.someProcedure( 'Some argument' );
      END callPkgB;
    END pkgA;In general, any packaged procedure can be called by specifying the schema, package, and procedure name, i.e.
    EXEC mySchema.myPackage.myProcedurethough the schema and package can be omitted if the calling procedure is in the same schema or package.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Lightroom always opens to same folder/!!!

    Every time LR opens, it always opens to the same obscure folder that I haven't used in months. How do I get it to open to the folder I last used?? Thanks

  • Archivelog mode

    I'd like to make sure of the following: when the database works in noarchivelog mode it does not matter what's the value of log_archive_start parameter whether it is true or false .I mean if log_archive_start in this case is set to true it won't arch

  • Getting Error in SSO with OWA scenario.

    Hi All, I am trying the SSO with OWA with EP 6.0 SP13. I am refering the document " Integration Of OutLook Web Access  into SAP Enterprise Portal " I am getting following error: Portal Runtime Error An exception occurred while processing a request fo

  • LOBS triggers and :new

    The 9i (rel 1) documentation says you cannot read :new.lobcol in an after row trigger. I tried it becasue I had already written the code and I was able to read it. Is the documentation wrong or is there a loop hole? If it is a loop hole how big is it

  • Russian characters in Applet.

    Does anybody know how I can get Russian characters to display in a java applet chat screen?