Concept of private functions

concept of private functions in oracle

Ok. Tell us more about it!Hehehe.... ;)
Op needs to spend some time for some extra words for this thread. ;)
Regards.
Satyaki De.

Similar Messages

  • Private function should not call

    I come across a strange thing in Java while doing Inheritance :
    Problem is that when we have one super class with a public function in it
    and a child class calling that function with its own object then everything
    works fine.
    But the problem arise when we modify super class function to make it private
    and add some more "println()" just to know more clearly what is happening
    now compile only super class .java file and try to execute child. u will
    find it also work fine but private function should not call.
    example (do as follow):
    Before Changes
    1) SuperClass.java
    public class SuperClass
    public SuperClass(){} //constructor
    public void fun() // public function
    System.out.println("Super class function called");
    2) javac SuperClass.java
    3) ChildClass.java
    public class ChildClass extends SuperClass
    public ChildClass() {} //constructor
    public static void main(String [] args)
    ChildClass c1 = new ChildClass();
    c1.fun();
    4) javac ChildClass.java
    5) java ChildClass
    Output :
    Super class function called
    After Change
    1) SuperClass.java
    public class SuperClass
    public SuperClass(){} //constructor
    private void fun() //private function ***** CHANGED ***********
    System.out.println("Super class function called");
    System.out.println("Newly added line is displayed");
    2) javac SuperClass.java
    3) java Child
    output:
    Super class function called
    Newly added line is displayed
    Why this "Newly added line is displayed" is in output ?
    Probably you will say Child.java should also compile but we haven't make any
    changes in it.
    And question is that if we have old binary then we can easily bridge the
    data hiding concept.
    Please take me out of this problem.

    Unlike C++, a subclass does not include all the methods/data of the super class.
    Instead it is built from the sub class and all its super classes when loaded.
    This means you can change a super class, or any class it refers to and the Child class is impacted by this.
    The leason is always re-compile all the class which are effected by a change.
    Using ant, maven or an IDE will do this.
    You can plenty of stange behaviour by recompiling a parent class with compiling its children or the classes which depend on them.

  • Public n private function in pl/sql

    hello guyz,
    i wanna create a package which contains public function and private function.
    the package should contain finding highest number as one private function and lowest number as the other private function. Also i need a public function which uses the above private functions to display the result.
    Your help is appreciated.

    Here is a sample script from where you should take the concept and implement it in your case --
    satyaki>create or replace package pack_vakel
      2  is
      3    procedure aa(a in number,b out varchar2);
      4  end;
      5  /
    Package created.
    satyaki>
    satyaki>create or replace package body pack_vakel
      2  is
      3    procedure test_a(x in varchar2,y out varchar2)
      4    is
      5      str varchar2(300);
      6    begin
      7      str := 'Local ->'||x;
      8      y := str;
      9    end;
    10   
    11    procedure aa(a in number,b out varchar2)
    12    is
    13      cursor c1(eno in number)
    14      is
    15        select ename
    16        from emp
    17        where empno = eno;
    18       
    19      r1 c1%rowtype;
    20     
    21      str2  varchar2(300);
    22      str3  varchar2(300);
    23    begin
    24      open c1(a);
    25      loop
    26        fetch c1 into r1;
    27        exit when c1%notfound;
    28        str2 := r1.ename; 
    29      end loop;
    30      close c1;
    31     
    32      test_a(str2,str3);
    33      b := str3;
    34    exception
    35      when others then
    36        b := sqlerrm;
    37    end;
    38  end;
    39  /
    Package body created.
    satyaki>
    satyaki>
    satyaki>set serveroutput on
    satyaki>
    satyaki>
    satyaki>declare
      2    u   number(10);
      3    v   varchar2(300);
      4  begin
      5    u:= 7369;
      6    pack_vakel.aa(u,v);
      7    dbms_output.put_line(v);
      8  end;
      9  /
    Local ->SMITH
    PL/SQL procedure successfully completed.
    satyaki>
    satyaki>declare
      2    p   varchar2(300);
      3    q   varchar2(300);
      4  begin
      5    p:= 'SMITH';
      6    pack_vakel.test_a(p,q);
      7    dbms_output.put_line(q);
      8  exception
      9   when others then
    10    dbms_output.put_line(sqlerrm);
    11  end;
    12  /
      pack_vakel.test_a(p,q);
    ERROR at line 6:
    ORA-06550: line 6, column 14:
    PLS-00302: component 'TEST_A' must be declared
    ORA-06550: line 6, column 3:
    PL/SQL: Statement ignoredRegards.
    Satyaki De.

  • LastResult Scope in Private Functions?

    The code for my app is below. I can access the data in
    lastResult fine if I do the HTTPService.send() ourside of my
    private function and also access lastResult outside of my private
    function, however if I put the HTTPService.send() call inside my
    private function I get "cannot access property of null object"
    error and traces show lastResult is null. Any idea on what's
    happening? My ASP page DOES return data so the null isn't a result
    of no data being returned. Thanks.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Model id="paramModel">
    <root>
    <offeringName>Math 101</offeringName>
    </root>
    </mx:Model>
    <mx:Script>
    <![CDATA[
    private function render():void{
    myHTTPData.send(paramModel);
    debug.text = myHTTPData.lastResult.offeringName[0];
    ]]>
    </mx:Script>
    <mx:HTTPService id="myHTTPData" method="GET"
    url="
    http://myServer/myASPPage.asp"
    //contains actual valid URL in my version
    resultFormat="e4x">
    </mx:HTTPService>
    <mx:Form width="819">
    <mx:Button x="178" y="10" label="Button"
    click="render();"/>
    <mx:TextInput id="offeringName" x="10" y="10"/>
    </mx:Form>
    <mx:TextArea x="10" y="223" id="debug" width="712"
    height="159" fontFamily="Courier New" fontSize="10" color="#4a29b4"
    fontWeight="bold"/>
    </mx:Application>

    You need to listen for the result of your HTTPService call
    and assign the returned value to your debug.text in that function.
    You cannot call a HTTPService and assign the result in the same
    function because Flex only supports asynchronous calls.
    <mx:HTTPService id="myHTTPData" method="GET"
    url="
    http://myServer/myASPPage.asp"
    //contains actual valid URL in my version
    resultFormat="e4x" result="offeringResult(event)"">
    </mx:HTTPService>
    private function offeringResult(evt:ResultEvent):void {
    debug.text = evt.result.offeringName[0];
    Vygo

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

  • How do I test a private function with FlexUnit4

    Hi,
    How do I (If it's possible) test a private function of a class i want to test.
    I really don't want to change the function to public only for testing it.
    Any suggestions

    [2 cents better late than never?]
    Instead of "private" to "protected", we tend to use "internal".  Since our tests live in a "test" directory (at sibling-level to "src") and package structure is replicated, tests can access "internal" resources (methods and members).
    If one follows this pattern, it leads to 2 curious consequences:
    one can spot definitely-untested methods by their "private"-ness =
    good (well tested) code never uses "private" =
    I tend to agree with the original author, (sorry mlabriola -- your work is awesome and I never thought I'd find myself disagreeing with you but...) one does need to test private resources.  Java allows one to work around the situation with the horrific kludge of using reflection to access private members.  Sadly / luckily I'm insufficiently au fait with Flex's version to coax something similar.
    Sadly, I'm not sure what alternatives one could have: perhaps a flag that tells the compiler/runtime whether to enforce "private"-ness which one activates during test?
    2c, R.

  • Use private function with interface

    I'm working with ActionScript 2 and wanted to use an
    interface for one of my classes. However, the functions that it
    would define should be private in the classes that implement the
    interface. The problem is that I can't define private functions in
    the interface, and if I leave off any scope in the interface
    ("function findAndSetInformation():Void;") and make it private in
    the implementing class ("private function
    findAndSetInformation():Void {...") I get the error: "The
    implementation of the interface method doesn't match its
    definition.

    WHATS UP ?? WHERE IS TEH MODERATOR ?!!!!
    NO REPLY TELL NOW !!!!
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Yh:
    hi,
    how can i used REPLACE function with LOB database item????!!!1<HR></BLOCKQUOTE>
    null

  • Error 1013 private function, Help!?

    Hey i'm new to this but i've been stuck on this problem for a couple of hours now.. If anybody can see what the problem is that would be great! I've highlighted the line on which the error occurs (line 68) I have my braces correct i believe so i can not see what the problem is. Thanks.
    package  {
                        import flash.display.Sprite;
                        import flash.text.TextField;
                        import Classes.P_Circle;
                        import flash.events.MouseEvent;
              public class Main extends Sprite {
                        //private properties
                        private var container:Sprite = new Sprite ();
                        private var textBox:TextField = new TextField ();
                        private var padding:uint = 10;
                        //initialization
                        public function Main() {
                                  //adds a random number of images to the contatiner
                                  this.makeImages(getRandomNumber(10,5) );
                                  //add a mouse listener to container
                                  this.container.addEventListener(MouseEvent.CLICK, hitObject);
                                  //add the container to the stage
                                  stage.addChild(this.container);
                                  //function to draw UI and config
                                  this.ConfigUI();
                         private function ConfigUI():void {
                                  this.textBox.x = 5;
                                  this.textBox.y = -10;
                                  stage.addChild(textBox);
                        //private methods, calculator
                         private function hitObject(e:MouseEvent):void {
                                  //change transparancy of circle
                                  e.target.alpha = 0.3;
                                  //calculates new x and y for shapes
                                  textBox.text = 'x ' + e.target.x + '. y:' + e.target.y;
                        private function makeImages(nImagesToCreate:uint):void {
                                            var obj:P_Circle = new P_Circle(1,1);
                                            // this is to keep the circles from colliding when randomly placed
                                            var maxCols:Number = Math.floor(stage.stageWidth - obj.width - this.padding);
                                            var maxRows:Number = Math.floor(stage.stageHeight - obj.height - 50);
                                            obj = null;
                                            //loop to create as many circles as asked
                                            for (var j:uint = 0; j < nImagesToCreate; j++) {
                                                      //place circle in random posistions
                                                      obj = new P_Circle( getRandomNumber(maxCols, this.padding), getRandomNumber )
                                                      //give it a name
                                                      obj.name = 'circle_'+j;
                                                      //add it to container for display
                                                      this.container.addChild(obj);
                                  obj = null;
                                  // the sprite contaienr changes its size depending on objects which are on stage
                                  trace ('container width: ', container.width);
                                  trace ('container height: ', container.height);
            private function getRandomNumber(upperLimit:uint, lowerLimit:uint):uint {
                                      //get random number of circles
                                      var randomNum:Number = Math.floor(Math.random() * (1 + 10 - 5) + 5);
                                            return randomNum;

    Arent i telling it to just use randomnumber values within these parameters?
    private function makeImages(nImagesToCreate:uint):void {
                                            var obj:P_Circle1 = new P_Circle1(1,1);
                                            // this is figures out where circles are placed, keeps them on screen
                                            var maxCols:Number = Math.floor(stage.stageWidth - obj.width - this.padding);
                                            var maxRows:Number = Math.floor(stage.stageHeight - obj.height - 50);
                                            obj = null;

  • Does ExtendScript have a concept of "main" function/method like when script is included as a library

    I was just wondering whether ExtendScript has any concept like a main method, whereby if the current script is included by another script like a library import it will not execute this main function/method and only execute it when the script is run directly.
    Similar to Java's main() method and Python's __main__.
    If not, is there a workaround to mimic such behavior generically?

    I cannot reproduce this.  Can you create a very simple repro of this issue and post to OneDrive?
    Jeff Sanders (MSFT)
    @jsandersrocks - Windows Store Developer Solutions
    @WSDevSol
    Getting Started With Windows Azure Mobile Services development?
    Click here
    Getting Started With Windows Phone or Store app development?
    Click here
    My Team Blog: Windows Store & Phone Developer Solutions
    My Blog: Http Client Protocol Issues (and other fun stuff I support)

  • Pl/sql package won't allow private function

    Hello,
    I'm trying to make a function in a package private. Oracle gives me this message everytime I load the package.
    18/2 PL/SQL: SQL Statement ignored
    18/9 PLS-00231: function 'FUN' may not be used in SQL
    18/9 PL/SQL: ORA-00904: : invalid identifier
    If I move the function declartion into the package specification, everything works. What am I doing wrong?
    Here's the (contrived) code:
    create or replace package tst_pkg
    is
         procedure silly;
    end; -- end package specification
    create or replace package body tst_pkg
    is
    /* fun: silly function for testing */
    function fun( f_num number ) return number
    is
         ret_val number;
    begin
         ret_val := f_num;
         return ret_val;
    end fun;
    /* silly: silly procedure to test a function call in a package */
    procedure silly
    is
         t_num number;
    begin
         select fun( 1 ) into t_num from dual;
    end;
    end; -- end package body
    Thanks,
    David

    create or replace function f_test_123 (p_num number) return number is
    l_value number ;
    begin
    return p_num ;
    end f_test_123;
    create or replace package p_test_123 is
    procedure p_test (p_num number) ;
    end p_test_123;
    create or replace package body p_test_123 is
    procedure p_test (p_num number) is
    l_test number ;
    begin
    dbms_output.enable (10000) ;
    select f_test_123 (p_num) into l_test from dual ;
    dbms_output.put_line ('Result = ' || to_char(l_test) ) ;
    end p_test ;
    end p_test_123;
    show err
    set serveroutput on
    execute p_test_123.p_test (789)
    Result = 789
    PL/SQL procedure successfully completed.
    I think part SQL and part is PLSQL

  • What is customer's modification concept in Call function??

    Following is the definition of CALL CUSTOMER-FUNCTION <func>...
    It is similar to CALL FUNCTION. The function modules must be programmed and activated within the <b>customer's modification concept</b>.
    Here,I am not able to understand what is meant by :  CALL CUSTOMER-FUNCTION ??

    It is nothing but one type of Enhancement(user exit) like thing to write out code with respect to that program.
    We use user exits in different ways from CMOD, SMOD etc
    for certain programs, with in the program SAP has provided this type type of CUSTOMER FUNCTION '001'.
    double click on the '001' and create your own include and write the related code in that for your requirement.
    Customer Exit
    SAP creates customer exits for specific programs, screens, and menus within standard applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.
    If you want to enhance the functionality of your SAP System, you should take advantage of the exits available in standard applications. There are two main reasons why you should use exits rather than modifying SAP software yourself. Add-ons attached to exits have the advantage that:
    • They do not affect standard SAP source code
    When you add new functionality to your SAP System using SAP’s exits, you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. These customer objects are linked to standard applications, but exist separately from SAP’s standard software package.
    • They do not affect software updates
    When you add new functionality to your SAP System using SAP’s exits, your objects (called customer objects) must adhere to strict naming conventions. When it comes time to upgrade a to a new software release, customer objects’ names ensure that they will not be affected by any changes or new additions to the standard software package.
    Customer exits are not available for all programs and screens found in the SAP System. You can only use customer exits if they already exist in the SAP System. You can find more information about locating applications with pre-defined exits in Locating Applications that have Exits
    CALL CUSTOMER-FUNCTION '003'
    exporting
    xvbak = vbak
    xvbuk = vbuk
    xkomk = tkomk
    importing
    lvf_subrc = lvf_subrc
    tables
    xvbfa = xvbfa
    xvbap = xvbap
    xvbup = xvbup.

  • Private function / procedure to be used with in a package

    Hi All
    I wanted to find out how would the definition be for a function which is defined so as to be used/called by the other functions / procedures with in a particular pakage and should not be visible/accessible for any other routine out side the package in which it is defined..
    could you please advice me on this? Thanks!
    Sarat

    It is possible: you can nest one function/procedure in another:
    SQL>CREATE OR REPLACE FUNCTION sum_squares(
      2     p_a   IN   NUMBER,
      3     p_b   IN   NUMBER)
      4     RETURN NUMBER
      5  IS
      6     FUNCTION square(
      7        p_n   IN   NUMBER)
      8        RETURN NUMBER
      9     IS
    10     BEGIN
    11        RETURN p_n * p_n;
    12     END square;
    13  BEGIN
    14     RETURN square(p_a) + square(p_b);
    15  END sum_squares;
    16  /
    Function created.
    SQL>SELECT sum_squares(3, 4) FROM dual;
    SUM_SQUARES(3,4)
                  25Urs

  • Making a function private

    Trying to adjust a function in a package to make it private. And then adjust the procedure to utilize the function to display the results of the function
    I seem to be going in circles HELP!!!
    Thanks
    Mat
    This is the original Package
    CREATE OR REPLACE PACKAGE order_info_pkg IS
    FUNCTION ship_name_pf
    (p_basket IN NUMBER)
    RETURN VARCHAR2;
    PROCEDURE basket_info_pp
    (p_basket IN NUMBER,
    p_shop OUT NUMBER,
    p_date OUT DATE);
    END;
    CREATE OR REPLACE PACKAGE BODY order_info_pkg IS
    FUNCTION ship_name_pf
    (p_basket IN NUMBER)
    RETURN VARCHAR2
    IS
    lv_name_txt VARCHAR2(25);
    BEGIN
    SELECT shipfirstname||' '||shiplastname
    INTO lv_name_txt
    FROM bb_basket
    WHERE idBasket = p_basket;
    RETURN lv_name_txt;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Invalid basket id');
    END ship_name_pf;
    PROCEDURE basket_info_pp
    (p_basket IN NUMBER,
    p_shop OUT NUMBER,
    p_date OUT DATE)
    IS
    BEGIN
    SELECT idshopper, dtordered
    INTO p_shop, p_date
    FROM bb_basket
    WHERE idbasket = p_basket;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Invalid basket id');
    END basket_info_pp;
    END;
    And this is my adjusted one with the returned errors
    CREATE OR REPLACE PACKAGE order_info_pkg IS
    PROCEDURE basket_info_pp
    (p_basket IN NUMBER,
    p_shop OUT NUMBER,
    p_date OUT DATE,
    p_shipname OUT VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY order_info_pkg IS
    FUNCTION ship_name_pf
    (p_basket IN NUMBER)
    RETURN VARCHAR2
    IS
    lv_name_txt VARCHAR2(35);
    BEGIN
    SELECT shipfirstname||' '||shiplastname
    INTO lv_name_txt
    FROM bb_basket
    WHERE idBasket = p_basket;
    RETURN lv_name_txt;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Invalid basket id');
    END ship_name_pf;
    PROCEDURE basket_info_pp
    (p_basket IN NUMBER,
    p_shop OUT NUMBER,
    p_date OUT DATE,
    p_shipname OUT VARCHAR2)
    IS
    BEGIN
    SELECT idshopper, dtordered, ship_name_pf(p_basket)
    INTO p_shop, p_date, p_shipname
    FROM bb_basket
    WHERE idbasket = p_basket;
    DBMS_OUTPUT.PUT_LINE(p_basket||' '||p_shop||' '||p_date||' '||p_shipname);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Invalid basket id');
    END basket_info_pp;
    END;
    Errors for PACKAGE BODY ORDER_INFO_PKG:
    LINE/COL ERROR
    24/4 PL/SQL: SQL Statement ignored
    24/33 PLS-00231: function 'SHIP_NAME_PF' may not be used in SQL
    24/33 PL/SQL: ORA-00904: : invalid identifier
    SQL>

    Hi,
    It is because you are trying to use a private function in an SQL statement. Just call the function outside the SQL:
    PROCEDURE basket_info_pp
    (p_basket IN NUMBER,
    p_shop OUT NUMBER,
    p_date OUT DATE,
    p_shipname OUT VARCHAR2)
    IS
    BEGIN
    SELECT idshopper, dtordered
    INTO p_shop, p_date
    FROM bb_basket
    WHERE idbasket = p_basket;
    p_shipname := ship_name_pf(p_basket);
    DBMS_OUTPUT.PUT_LINE(p_basket||' '||p_shop||' '||p_date||' '||p_shipname);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('Invalid basket id');
    END basket_info_pp;
    END;

  • Custom Functions not exported - Urgent

    Hi,
    We have couple of Custom Functions imported into the OWB Design Repository. After completing with Development, now i want to move into TEST repository. I created a snapshot and exported (MDL file) the project. When I imported into TEST Design Repo, the custom functions are missing.
    our environment is -
    OWB Design Client - 9.2.0.2.8
    OWB Design Repo - 9.2.0.2
    Can you please give me some idea why this is happening?
    Thanks
    Mahesh

    Hi JP,
    No, I have not renamed MY_PROJECT. The problem lies in the Export phase itself. When I export those custom functions (defined under public transformations) are not exported at all. Like when I look into the export log file, it shows the count of standalone Functions / Functions as 0.
    since the Custom Functions are not exported, when I import it into a TEST environment the links are broken inside the PF, due to the fact of UOIDs you have rightly mentioned. Exporting the custom functions alone and importing into the TEST environment does not solve the problem due to lack of connectivity (again due to UOID).
    But, I think I nailed the problem by approaching in a different way. I have created a target module and then moved the custom functions into that module as private functions. When I exported the project, the functions are exported and imported without any problem.
    so, I guess we have not fully understood the custom functions concept(under public transformations). If anybody clarifies / explains how to use them I will be very glad for learning something new.
    Thanks
    Mahesh

  • OOP Question: Calling Function in Root?

    This is kinda complicated, and I'm still trying to wrap my head around the whole concept of OOP. So right now I am building a XML Gallery, and in the FLA (Root) I've added the thumbnails. Everytime the thumbnails been clicked, it will bring up the "Detail" movieclip, which also is created in the root. And inside the Detail movieclip, I am creating a few buttons with an external class. My question is how can I call a function in the FLA (Root) when I click on the buttons inside the Detail movieclip? Note it seems I've successfully import my external class in both the root and the Detail movieclip.
    I hope I'm making sense. >_<
    Thanks for any help in advance.

    use:
    In the DetailButtons class:
    _button.addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
    private function onClick(evt:MouseEvent):void {
         dispatchEvent(new Event("Clicked");
    In the Main FLA / Root:
    var detailButtons:DetailButtons = new DetailButtons();
    addChild(detailButtons);
    detailButtons.addEventListener("Clicked", goBack);
    function goBack(evt:Event):void{
        trace("Go Back");

Maybe you are looking for

  • Wireless Keyboard don't connect with new mac mini

    Hi, I just received my new Mac mini server 2011 and bought an Apple wireless keyboard (already have a magic mouse). At first start up of my Mac mini picks up my magic mouse and I can use it but does not pick up my wireless keyboard? Is this normal? A

  • Updating N90 to V 5.0607.73 causes loss of date an...

    I have just successfully updated my N90 to 5.0607.73, and now whenever it is turned off it loses the time and date and asks for a new time and date whenever the unit is turned back on! It worked perfectly before I updated!! Help! Cheers Douglas Pearl

  • EOIO not working for Application Error

    Hi, My scenario is: SOAP -> PI -> ECC (for processing timesheets). In my SOAP sender adapter I have set the Quatliy of Service as 'Exactly Once in Order' and defined the queue name in the URL. The queue is working fine and when I look in the SXMB_MON

  • Hi  problems in function module

    Hi friends I have the following problems......... When I am using this  following code  in a function module its not giving me output until i comment those two fields kwmeng and netwr..i have use VRKME and WAERS  for those two..........which are the

  • Schemas for Different Sequence Files

    I  have a database that is storing my results from Test Stand.  I'm having trouble creating the tables for the 6 different sequel files in the same database.  I tried making a new schema to rename all the tables, but I cant execute a new SQL window t