As3 call a function inside  swf

I am loading an external swf like that. In the extrnal swf I
have a function called "foo". how can I call "foo" function from
the main swf?
Thanks

why not put the function in the main swf and eliminate the
other swf if thats all there is? i have no clue about how to deal
with multiple swf's. i'd say define it in the first frame of the
flash and call on it later

Similar Messages

  • Calling a function inside a symbol?

    Hi there,
    I'm one of those flash-devs that are trying to get Edge Animate to do what I usually do in Flash, so I might be doing this the wrong way, but I've got a symbol with a function "inside" on my stage, and I wanna call that function from the stage.
    I've been trying to use sym.getComposition().getStage().getSymbol("symbolName").functionName(); but it doesn't work.
    I don't have any problems manipulating the symbol itself by calling .play() or .hide() so I know the path works....can anyone show me the right syntax to call a function inside a symbol?
    Thx in advance

    Hi Abnesher,
    An important principle to grasp is that symbols (and the stage is one of them) lies in parallel, despite the fact of instances of different symbols being nested one in another (and all in fine nested in the stage).
    The consequence is that from inside your nested symbol you have no direct visibility of the function defined inside the stage symbol !
    Inside the Stage symbol, in the document.compositionReady event handler :
    sym.yourGlobalFunction = function( firstParameter)
      // your stuff
    Inside another symbol, in one of its events handlers :
    sym.getComposition().getStage().yourGlobalFunction( 5);
    Gil

  • Call a function inside a package from a stored procedure

    Hello:
    I am kind of new to the stored procedure. Does anyone know how to call a function inside a package from another stored procedure?
    I have a existing function (func_b) inside a package (pack_a) and it returns a cursor. I want to call this function from a stored procedure (proc_c) so that I use the data inside the cursor.
    can I do the following in proc_c:
    my_cursor1 SYS_REFCURSOR;
    begin
    my_cursor1 := exec pack_a.func_b
    end
    It will be very helpful if anyone can point me to any reading or example. Thank you very much for your information.

    guys:
    Thank you for your information so far. I need some more help here. I was able to run the function in my stored procedure. However, I was not able to print the result on the screen to view the cursor result, although I am using dbms_output.put_line statement inside my stored procedure.
    I use the following statement to execute my stored procedure on sql*plus. I can tell the stored procedure is executed successfully, but I did see anything printed:
    DECLARE TEMP VARCHAR2(100);
    BEGIN PROC_LAWS_CAD_NAME_SEARCH('LPD', 'TEST DEVICE ID', 'TEST LAST NAME', 'TEST FIRST NAME', 'F', '11112009', TEMP); END;
    I tried to use 'set serveroutput on' and got the following error:
    ERROR:
    ORA-06502: PL/SQL: numeric or value error: host bind array too small
    ORA-06512: at line 1
    I am kind of confused now. thank you for your help.
    Jack
    Here is my procedure:
    create or replace
    PROCEDURE PROC_SEARCH
    ( AGENCY_ID IN VARCHAR2,
    DEVICE_ID IN VARCHAR2,
    L_NAME IN VARCHAR2,
    F_NAME IN VARCHAR2,
    SEX IN VARCHAR2,
    DOB IN VARCHAR2,
    CAD_NAME_SCH_RESULT_STR OUT VARCHAR2)
    AS
    v_agy_id varchar2(10);
    v_device_id varchar2(20);
    v_l_name varchar2(25);
    v_f_name varchar2(15);
    v_sex varchar2(1);
    v_dob date;
    -- this cursor is going to be used to store a list of warrant matching
    -- name search criteria
    cad_srch_cursor sys_refcursor;
    objSrch SEARCH_RESULT_TEMP%ROWTYPE;
    BEGIN
    cad_srch_cursor := SEARCH_PKG.SEARCH('TESTING', 'TESTER', null, null,null, null, getPhonetic('TESTING'));
    LOOP
    FETCH cad_srch_cursor INTO objSrch;
    EXIT WHEN cad_srch_cursor%NOTFOUND;
    --insert into SEARCH_RESULT_TEMP (name_last) values (objSrch.name_last);
    CAD_NAME_SCH_RESULT_STR := objSrch.name_last;
    dbms_output.put_line('First:'||objSrch.name_first||':Last:'||objSrch.name_last||':Middle:'||objSrch.name_middle);
    end LOOP;
    END PROC_LAWS_SEARCH;
    -----------------------------------------

  • Call library function inside a conditiona​l disable bug

    i'm trying to call a function in a dll using the call library function inside a conditional disable structure.
    one of the parameters is a pointer to a C structure.
    here is the prototype:
    short in myfunction(short in DevNum, void *pMetrics);
    outside of the conditional disable, LabVIEW allows me to wire the pMetrics parameter to a cluster.
    if i put the function inside the conditional disable, LabVIEW doesn't allow me to wire it.
    as a workaround, i put the cluster inside the conditional disable as well.
    any ideas?

    Simply create a constant of the cluster and and put it outside the disable structure. Wire this constant to all inputs (left side terminal) of the Call Library Node. A Call Library Node (CLN) set to Adapt to Type does need a valid datatype to adapt too. This works from the outside side (right side terminal) of the CLN only if the according indicator is inside the same data structure. In older LabVIEW versions you actually had to always define the left side by wiring a constant or a dummy control to it.
    This has to do with the algorithme that evaluates datatypes along wires. Making that algorithme go backwards (against the natural dataflow) inside one subdiagram without causing circular references or similar is already a challange. Doing that across diagram boundaries (case, disable, loop, etc. structures) is basically impossible without causing the entire edit operation to get very slow.
    Message Edited by rolfk on 10-20-2009 08:28 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling a Function inside a procedure

    Can you call a function inside a procedure?...if so....how?

    Not all built-in functions can be used directly in an assignment.
    SQL> CREATE PROCEDURE p (p_val IN VARCHAR2) AS
      2  l_v VARCHAR2(10);
      3  BEGIN
      4     l_v := DECODE(p_val,'YES','TRUE','FALSE');
      5  END;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE P:
    LINE/COL ERROR
    4/4      PL/SQL: Statement ignored
    4/11     PLS-00204: function or pseudo-column 'DECODE' may be used inside
             a SQL statement onlyTTFN
    John

  • Does Flash Paper support the PDF Bookmark functionality inside SWF?

       Does Flash Paper support the PDF Bookmark functionality inside SWF?

    I don't think you will be to happy with this, but I think it
    does not come with the Web Premium CS3 for the Mac:
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16582#flashpaper

  • How to call a function inside a class? 

    Hello, i am trying to fire a function onPress .. this
    function is inside a class.
    In this function i refer to another function inside the calss
    to call a Tween. It never arrives in the second function.
    I tried to make an example.
    In the fla file i have:
    var test:makeMovie = new makeMovie(this);
    You will see a red squere and you can press on it. It should
    run the tween class. Am i using the delegate class wrong?

    I always have to use test movie and trace a couple of times
    each time I start to use Delegate.
    It wraps function.apply I think, which I tend to use more
    often.
    try using:
    Container.onPress = Delegate.create(this,setAlpha);
    and then just
    setTween()
    inside your setAlpha....
    That's conceptually how I think I would try it above if I was
    doing something similar.
    I'm not sure it would have the desired effect even if the
    delegate was executed as you have it coded. Unless you want
    setTween's execution scope to be the Container clip in which case
    you might need to do what kglad said and change the Container
    reference to 'this'.
    The way you have it at the moment inside setAlpha the
    Delegate.create is simply creating a function...and not excuting
    it.
    its like : function something(){trace('what')}
    and not like : something();
    Below is some quick code that helps show how things work.
    Notice that I assigned the delegate function to mainFunc....so that
    along with the last example might provide a clue. Just paste it on
    a frame and take a look at what's happening.

  • Calling a function inside an iFrame

    I have a app I'm building that plays videos through an iFrame (src is our server). I want to have buttons in my client that when clicked can call functions inside the iFrame (e.g. play, pause). Obviously the problem is with doing this is browser security will not allow it. I understand AIR provides extra parameters for an iFrame to achieve this. I have been reading up on this and seen to get the impression that calling functions in the iFrame can only be done before the page loads?
    Has anyone any basic examples of how I could achieve this?

    Not all built-in functions can be used directly in an assignment.
    SQL> CREATE PROCEDURE p (p_val IN VARCHAR2) AS
      2  l_v VARCHAR2(10);
      3  BEGIN
      4     l_v := DECODE(p_val,'YES','TRUE','FALSE');
      5  END;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE P:
    LINE/COL ERROR
    4/4      PL/SQL: Statement ignored
    4/11     PLS-00204: function or pseudo-column 'DECODE' may be used inside
             a SQL statement onlyTTFN
    John

  • Calling a function inside another class

    I have the following two classes and can't seem to figure to figure out how to call a function in the top one from the bottom one. The top one get instantiated on the root timeline. The bottom one gets instantiated from the top one. How do I call functions between the classes. Also, what if I had another call instantiated in top one and wanted to call a function in the bottom class from the second class?
    Thanks a lot for any help!!!
    package
         import flash.display.MovieClip;
         public class ThumbGridMain extends MovieClip
              private var grid:CreateGrid;
              public function ThumbGridMain():void
                   grid = new CreateGrid();
              public function testFunc():void
                   trace("testFunc was called");
    package
         import flash.display.MovieClip;
         public class CreateGrid extends MovieClip
              public function CreateGrid():void
                   parent.testFunc();

    kglad,
    Although I agree that utilizing events the way you attempted in your suggestion is better for at least a reason of eliminating dependency on parent, still you code doesn't not accomplish what Brian needs.
    Merely adding event listener to grid instance does nothing - there is no mechanism in the code that invokes callTGMFunction - thus event will not be dispatched. So, either callTGMFunction should be called on the instance (why use events - not direct call - in this case?), or grid instance needs to dispatch this event based on some internal logic ofCreateGrid AFTER it is instantiated - perhaps when it is either added to stage or added to display list via Event.ADDED. Without such a mechanism, how is it a superior correct way OOP?
    Also, in your code in ThumbGridMain class testFunc is missing parameter that it expects - Event.
    Am I missing something?
    I guess the code may be (it still looks more cumbersome and less elegant than direct function call):
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         public class ThumbGridMain extends MovieClip
             private var grid:CreateGrid;
             public function ThumbGridMain():void
                 grid = new CreateGrid();
                 grid.addEventListener("callTGMFunction", testFunc);
                 addChild(grid);
            // to call a CreateGrid function named cgFunction()
             public function callCG(){
                 grid.cgFunction();
             public function testFunc(e:Event):void
                 trace("testFunc was called");
    package
         import flash.display.MovieClip;
         import flash.events.Event;
         import flash.events.Event;
         public class CreateGrid extends MovieClip
             public function CreateGrid():void
                 if (stage) init();
                 else addEventListener(Event.ADDED, callTGMFunction);
             // to call a TGM function
             public function callTGMFunction(e:Event = null):void
               // I forgot this one
                removeEventListener(Event.ADDED, callTGMFunction);
                this.dispatchEvent(new Event("callTGMFunction"));
            public function cgFunction(){
                 trace("cg function called");
    I think this is a case of personal preference.
    With that said, it is definitely better if instance doesn't rely on the object it is instnatiated by - so, in this case, either parent should listen to event or call a function directly.

  • Can't call a function inside another function

    Hello,
    i have the following function :
    FUNCTION test_day_week (P_DATE DATE)
    RETURN VARCHAR2 IS
    BEGIN
    RETURN TO_CHAR(P_DATE ,'DAY');
    END;
    --it returns the day name of a given date
    FUNCTION TEST_DAY_NUMBER (P_DAY_NAME VARCHAR2)
    RETURN NUMBER IS
         V_RESULT NUMBER;
         V_RETURN_DAY VARCHAR2(30);
         P_DATE DATE;
    BEGIN
    V_RETURN_DAY := test_day_week (P_DATE );
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    MESSAGE('V_RETURN_DAY'|| V_RETURN_DAY);
    IF V_RETURN_DAY = 'MONDAY' THEN V_RESULT :=1;
         END IF ;
    IF V_RETURN_DAY = 'TUSEDAY' THEN V_RESULT :=2;
         END IF ;
    IF V_RETURN_DAY = 'WENDSDAY' THEN V_RESULT :=3;
         END IF ;
    IF V_RETURN_DAY = 'THURSDAY' THEN V_RESULT :=4;
         END IF ;
    IF V_RETURN_DAY = 'FRIDAY' THEN V_RESULT :=5;
         END IF ;                
    IF V_RETURN_DAY = 'SATURDAY' THEN V_RESULT :=6;
    END IF ;
    IF V_RETURN_DAY = 'SUNDAY' THEN V_RESULT :=7;
         END IF ;
    RETURN V_RESULT;
    END;
    --The above function returnds the day name in numbers
    The proble is that when i call test_day_week function it returns no value even it is tested separatly and works fine don't know where is my problem :
    1-number of argrments in function[b] TEST_DAY_NUMBER
    ?? and so ..!
    Regards,
    Abdetu..

    You could also cut the whole thing down to a simple function... (assuming you have a need to customise your start of week rather than use built in date functionality)
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE FUNCTION test_day_week (P_DATE DATE) RETURN NUMBER IS
      2  BEGIN
      3    RETURN (INSTR('MONTUEWEDTHUFRISATSUN',TO_CHAR(P_DATE,'DY'))+2)/3;
      4* END;
    SQL> /
    Function created.
    SQL> select test_day_week(sysdate) from dual;
    TEST_DAY_WEEK(SYSDATE)
                         1
    SQL> select test_day_week(sysdate+1) from dual;
    TEST_DAY_WEEK(SYSDATE+1)
                           2
    SQL> select test_day_week(sysdate+2) from dual;
    TEST_DAY_WEEK(SYSDATE+2)
                           3
    SQL> select test_day_week(sysdate+3) from dual;
    TEST_DAY_WEEK(SYSDATE+3)
                           4
    SQL> select test_day_week(sysdate+4) from dual;
    TEST_DAY_WEEK(SYSDATE+4)
                           5
    SQL> select test_day_week(sysdate+5) from dual;
    TEST_DAY_WEEK(SYSDATE+5)
                           6
    SQL> select test_day_week(sysdate+6) from dual;
    TEST_DAY_WEEK(SYSDATE+6)
                           7
    SQL> select test_day_week(sysdate+7) from dual;
    TEST_DAY_WEEK(SYSDATE+7)
                           1
    SQL>

  • Dynamically call different functions inside a function

    Hi there,
    I was wondering if it is possible to dynamically define the function that you want to call. Almost like passing the function name that i want to call as a parameter.
    I am calling a function, but do not want to hardcode the function I am calling. I have different functions that all return a boolean value, and i want to call all of them at different times through the same procedure/function.
    Is this possible???
    Thank you in advance!
    Tanja

    Or combine your functions to use function overloading, then you can use the same name...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN;
      3    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN;
      4    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN;
      5    PROCEDURE test;
      6* end;
    SQL> /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace package body mypk as
      2    FUNCTION gen_function (param1 IN NUMBER, param2 IN NUMBER) RETURN BOOLEAN IS
      3    BEGIN
      4      RETURN (param1*2) = param2;
      5    END;
      6    FUNCTION gen_function (param1 IN VARCHAR2, param2 IN VARCHAR2) RETURN BOOLEAN IS
      7    BEGIN
      8      RETURN param1 = param2;
      9    END;
    10    FUNCTION gen_function (param1 IN BOOLEAN, param2 IN BOOLEAN) RETURN BOOLEAN IS
    11    BEGIN
    12      RETURN NOT(param1) = param2;
    13    END;
    14    PROCEDURE test IS
    15    BEGIN
    16      IF gen_function(1,2) THEN
    17        DBMS_OUTPUT.PUT_LINE('Test1: True');
    18      ELSE
    19        DBMS_OUTPUT.PUT_LINE('Test1: False');
    20      END IF;
    21      IF gen_function('Fred','John') THEN
    22        DBMS_OUTPUT.PUT_LINE('Test2: True');
    23      ELSE
    24        DBMS_OUTPUT.PUT_LINE('Test2: False');
    25      END IF;
    26      IF gen_function(TRUE,FALSE) THEN
    27        DBMS_OUTPUT.PUT_LINE('Test3: True');
    28      ELSE
    29        DBMS_OUTPUT.PUT_LINE('Test31: False');
    30      END IF;
    31    END;
    32* end;
    SQL> /
    Package body created.
    SQL> exec mypk.test;
    Test1: True
    Test2: False
    Test3: True
    PL/SQL procedure successfully completed.
    SQL>;)

  • Could AS3 call C++ functions in .dll?

    Hi there,
    Could I do:
    write some C++ functions and compile them into a .dll file;
    then call these functions from Actionscript3.0??
    If yes, how can I do that?
    Thanks a lot.

    I guess, you are better off to ask this question in a C forum. This is a Java forum, you know.

  • How to get the main funciton name when calling another function inside?

    for eg, one RFC named A,inside A,a funtion B is called.when the processing is at B now,how can i get the main RFC name(A)?
    any help will be much appricated.

    > just see SM50,there is a column called 'Report',it shows the program id the proess is now processing.but i don't know its main program or say it 'the process's first excuting program',how can i get it programmatically?
    I'm still not sure to understand. The program in SM50 is the current main program (not the first). It is stored in SY-REPID system variable. Or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    READ TABLE lt_callstack_long INDEX 1 INTO ls_callstack_long.
    WRITE : / 'current main program is:', ls_callstack_long-mainprogram.
    If you want to know the frame program (the first called), use SY-CPROG, or use this code:
    DATA lt_callstack_long TYPE abap_callstack.
    DATA ls_callstack_long TYPE LINE OF abap_callstack.
    CALL FUNCTION 'SYSTEM_CALLSTACK'
          IMPORTING
            callstack    = lt_callstack_long.
    " read last line = first called program
    DESCRIBE TABLE lt_callstack_long. "to make sy-tfill = number of lines
    READ TABLE lt_callstack_long INDEX sy-tfill INTO ls_callstack_long.
    WRITE : / 'First main program is:', ls_callstack_long-mainprogram.

  • Calling a function inside a function

    How does one do that? I am trying to call function 1 inside function 2. What is the corrct syntax?

    If this post answers your question or helps, please mark it as such.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          private function callFuncs():void{
            one();
          private function one():void{
            txt.text += "In function one()\n";
            two();
          private function two():void{
            txt.text += "In function two()\n";
            three();
          private function three():void{
            txt.text += "In function three()\n";
        ]]>
      </mx:Script>
      <mx:Button label="Call Functions" click="callFuncs();"/>
      <mx:TextArea width="500" height="500" id="txt"/>
    </mx:Application>

  • Call  a function inside a function..

    Hi..!
    I have a function with 3 insert statements. The steps are..
    1. insert into tab1 values(X);
    2.Call function b ( having 2 insert statements);
    3.insert into tab2 values(y); (fail statement)
    4.insert into tab3 values(z);
    What happens if the 3rd insert fails ??? Any idea !!!

    Homework ?
    The answer depends on does function b commit transaction or not.
    If not - all changes made in the function will be rollbacked, including
    changes in function B (PL/SQL behavoiur).
    If yes - only 3 and 4 steps will be rollbacked.
    See example:
    SQL> create table tab1 (id number primary key);
    Table created.
    SQL> create or replace procedure foo
      2  is
      3  begin
      4   insert into tab1 values(2);
      5  end;
      6  /
    Procedure created.
    SQL> create or replace procedure foo1
      2  is
      3  begin
      4   insert into tab1 values(1);
      5   foo;
      6   insert into tab1 values(1);
      7   insert into tab1 values(3);
      8  end;
      9  /
    Procedure created.
    SQL> select * from tab1;
    no rows selected
    SQL> exec foo1
    BEGIN foo1; END;
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.SYS_C0011444) violated
    ORA-06512: at "SCOTT.FOO1", line 6
    ORA-06512: at line 1
    SQL> select * from tab1;
    no rows selected
    SQL> create or replace procedure foo
      2  is
      3  begin
      4   insert into tab1 values(2);
      5   commit;
      6  end;
      7  /
    Procedure created.
    SQL> exec foo1
    BEGIN foo1; END;
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.SYS_C0011444) violated
    ORA-06512: at "SCOTT.FOO1", line 6
    ORA-06512: at line 1
    SQL> select * from tab1;
            ID
             1
             2 Rgds.

Maybe you are looking for

  • Call PL/SQL Function in ABAP over XI

    Hi all, is it possible to call a PL/SQL function in a BW-ABAP over XI and to get back the return value of the function. What proxy do i need and how should the coding look like if it is possible. I am thankful for every little help. Peter

  • How to buy/get correct 9.2 disc,

    I just bought at garage sale a Smoke/Graphite (see through) colored G3 all-in-one for $99.00. Seems to work wonderfully. Also has a CD burner. So, seemed like a good deal for an extra (needed) computer (I have 6 kids!). It has 128 MB Ram and OS 9.1 i

  • How to create Shared RAW disk on solaris 10?

    Hi, I have built two solaris machine using VMware. I am going to configuare RAC. how to create shared RAW disk for ocr,votedisk and asm? OS version = 5.10 32 bit Thanks

  • NW 7.01 on Oracle 10.2.0.4 - Upgrade Path to NW 7.4 on Oracle 11.2

    Hi all One of our clients has a 2-system-BW-landscape (2 physical hosts) based on the following versions: * Windows 2008 R2 SP1 * Oracle 10.2.0.4.0 * Oracle Client 10.2.0.4.0 * NetWeaver 7.01 SP7 * SAP Kernel 7.01 Patch 94 64bit UC As you can see 60%

  • Why is J2EE so complex???

    Hi, there, I'm studying J2EE right now, I have knowledge of Java and Oracle, but I still find J2EE is very complex, many many APIs need to study, many many concepts need to study, many many related tools need to study, even I have to study HTML, JAVA