Can a loaded SWF call a function that lives in the parent?

I'm building a pretty simple Flash site in AS3. There is a
main movie (main.swf) that simply loads different swfs via buttons
on a main nav bar. The user clicks on a MC in "main.swf" and a
function is called, loadMyContent("section1.swf"), is called and it
animates in nicely. Other buttons use the same function, loading
section2.swf, section3.swf, etc.
I've defined how "loadMyContent()" works in the the main
movie's document class file. It's all working fine when I just need
to load content from a user action from the buttons that live in
"main.swf". I want to call that same "loadContent" function from
within "section1.swf" and have "main.swf" run it's "loadContent"
fuction, but I can't seem to figure out how to make a child call a
function that lives in the parent.
Is there any way of having my child do this?
I have a suspicion I may have to define that "loadContent"
somewhere else, but I'm a little stumped now. I'm not really
familiar with design patterns yet, although I want to get an
understanding of them sometime soon. Can anyone offer some help
with my immediate need or suggest a route to a solution?
Thanks.

kglad,
Thank you very much! That worked perfectly. My section1 FLA
is now compiling it's SWF without complaint.
In case someone else is following this, the exact code I
ended up using to cast "this.parent.parent" as a MovieClip is:
MovieClip(this.parent.parent).loadMyContent("section2.swf");
The discussion I think kglad is referencing is
this
discussion. If that's not it, just let me know. Again, kglad,
thank you!

Similar Messages

  • SOLVED: How can I use or call a function that returns %ROWTYPE?

    Hi
    edit: you can probably skip all this guff and go straight to the bottom...In the end this is probably just a question of how to use a function that returns a %rowtype.  Thanks.
    Currently reading Feuerstein's tome, 5th ed. I've downloaded and run the file genaa.sp, which is a code generator. Specifically, you feed it a table name and it generates code (package header and package body) that will create a cache of the specified table's contents.
    So, I ran:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\OPP5.WEB.CODE\OPP5.WEB.CODE\genaa.sp"
    749  /
    Procedure created.
    HR@XE> exec genaa('EMPLOYEES');which generated a nice bunch of code, viz:
    create or replace package EMPLOYEES_cache is
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE) return HR.EMPLOYEES%ROWTYPE;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE) return HR.EMPLOYEES%ROWTYPE;
        procedure test;
    end EMPLOYEES_cache;
    create or replace package body EMPLOYEES_cache is
        TYPE EMPLOYEES_aat IS TABLE OF HR.EMPLOYEES%ROWTYPE INDEX BY PLS_INTEGER;
        EMP_EMP_ID_PK_aa EMPLOYEES_aat;
        TYPE EMP_EMAIL_UK_aat IS TABLE OF HR.EMPLOYEES.EMPLOYEE_ID%TYPE INDEX BY HR.EMPLOYEES.EMAIL%TYPE;
        EMP_EMAIL_UK_aa EMP_EMAIL_UK_aat;
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMPLOYEE_ID_in);
            end;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMP_EMAIL_UK_aa (EMAIL_in));
            end;
        procedure load_arrays is
            begin
                FOR rec IN (SELECT * FROM HR.EMPLOYEES)
                LOOP
                    EMP_EMP_ID_PK_aa(rec.EMPLOYEE_ID) := rec;
                    EMP_EMAIL_UK_aa(rec.EMAIL) := rec.EMPLOYEE_ID;
                end loop;
            END load_arrays;
        procedure test is
            pky_rec HR.EMPLOYEES%ROWTYPE;
            EMP_EMAIL_UK_aa_rec HR.EMPLOYEES%ROWTYPE;
            begin
                for rec in (select * from HR.EMPLOYEES) loop
                    pky_rec := onerow (rec.EMPLOYEE_ID);
                    EMP_EMAIL_UK_aa_rec := onerow_by_EMP_EMAIL_UK (rec.EMAIL);
                    if rec.EMPLOYEE_ID = EMP_EMAIL_UK_aa_rec.EMPLOYEE_ID then
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup OK');
                    else
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup NOT OK');
                    end if;
                end loop;
            end test;
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /which I have run successfully:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\EMPLOYEES_CACHE.sql"
    Package created.
    Package body created.I am now trying to use the functionality within the package.
    I have figured out that the section
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /is the initialization section, and my understanding is that this is supposed to run when any of the package variables or functions are referenced. Is that correct?
    With that in mind, I'm trying to call the onerow() function, but it's not working:
    HR@XE> select onerow(100) from dual;
    select onerow(100) from dual
    ERROR at line 1:
    ORA-00904: "ONEROW": invalid identifier
    HR@XE> select employees_cache.onerow(100) from dual;
    select employees_cache.onerow(100) from dual
    ERROR at line 1:
    ORA-06553: PLS-801: internal error [55018]
    HR@XE> select table(employees_cache.onerow(100)) from dual;
    select table(employees_cache.onerow(100)) from dual
    ERROR at line 1:
    ORA-00936: missing expressionHe provides the code genaa.sp, and a very brief description of what it does, but doesn't tell us how to run the generated code!
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    So I try wrapping the call in an exec:
    HR@XE> exec select employees_cache.onerow(100) from dual;
    BEGIN select employees_cache.onerow(100) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 30:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PLS-00428: an INTO clause is expected in this SELECT statement
    HR@XE> exec select table(employees_cache.onerow(100)) from dual;
    BEGIN select table(employees_cache.onerow(100)) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 14:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    HR@XE> exec employees_cache.onerow(100)
    BEGIN employees_cache.onerow(100); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00221: 'ONEROW' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredNo joy.
    Of course, now that I'm looking at it again, it seems that the way to go is indicated by the first error:
    PLS-00428: an INTO clause is expected in this SELECT statement
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    I've had a stab at this, but still, no joy:
    create or replace procedure testcache is
        emp employees%rowtype;
        begin
            select employees_cache.onerow(100) from dual into emp;
            dbms_output.put_line('Emp id: ' || emp.employee_id);
        end testcache;
    show errors
    HR@XE> @testcache.sql
    Warning: Procedure created with compilation errors.
    Errors for PROCEDURE TESTCACHE:
    LINE/COL ERROR
    4/9      PL/SQL: SQL Statement ignored
    4/54     PL/SQL: ORA-00933: SQL command not properly ended
    HR@XE>Have a feeling this should be really easy. Can anybody help?
    Many thanks in advance.
    Jason
    Edited by: 942375 on 08-Feb-2013 11:45

    >
    Ha, figured it out
    >
    Hopefully you also figured out that the example is just that: a technical example of how to use certain Oracle functionality. Unfortunately it is also an example of what you should NOT do in an actual application.
    That code isn't scaleable, uses expensive PGA memory, has no limit on the amount of memory that might be used and, contrary to your belief will result in EVERY SESSION HAVING ITS OWN CACHE of exactly the same data if the session even touches that package.
    Mr. Feuerstein is an expert in SQL and PL/SQL and his books cover virtually all of the functionality available. He also does an excellent job of providing examples to illustrate how that functionality can be combined and used. But the bulk of those examples are intended solely to illustrate the 'technical' aspects of the technology. They do not necessarily reflect best practices and they often do not address performance or other issues that need to be considered when actually using those techniques in a particular application. The examples show WHAT can be done but not necessarily WHEN or even IF a given technique should be used.
    It is up to the reader to learn the advantages and disadvantages of each technicalogical piece and determine when and how to use them.
    >
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    >
    That is correct. To be used by SQL you would need to create SQL types using the CREATE TYPE syntax. Currently that syntax does not support anything similar to %ROWTYPE.
    >
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    >
    NO! That is a common misconception. Each session has its own set of package variables. Any session that touches that package will cause the entire EMPLOYEES table to be queried and stored in a new associative array specifically for that session.
    That duplicates the cache for each session using the package. So while there might be some marginal benefit for a single session to cache data like that the benefit usually disappears if multiple sessions are involved.
    The main use case that I am aware of where such caching has benefit is during ETL processing of staged data when the processing of each record is too complex to be done in SQL and the records need to be BULK loaded and the data manipulated in a loop. Then using an associative array as a lookup table to quickly get a small amount of data can be effective. And if the ETL procedure is being processed in parallel (meaning different sessions) then for a small lookup array the additional memory use is tolerable.
    Mitigating against that is the fact that:
    1. Such frequently used data that you might store in the array is likely to be cached by Oracle in the buffer cache anyway
    2. Newer versions of Oracle now have more than one cache
    3. The SQL query needed to get the data from the table will use a bind variable that eliminates repeated hard parsing.
    4. The cursor and the buffer caches ARE SHARED by multiple sessions globally.
    So the short story is that there would rarely be a use case where ARRAYs like that would be preferred over accessing the data from the table.

  • How to call a Function that will return me boolean value

    Hi all ,
    I am try to call a function that is included in my ApplictionModule the following is my method code
    public boolean callUpdateDepartmentNameFunction(int deptNo,String newName)
    boolean result=false;
    System.out.println("first");
    CallableStatement plsqlBlock =null;
    System.out.println("sec");
    String statement="BEGIN :3 = update_dname_func(:1,:2); END;";
    System.out.println("third");
    plsqlBlock=getDBTransaction().createCallableStatement(statement,0);
    try{
    System.out.println("forth");
    plsqlBlock.registerOutParameter(3,OracleTypes.BOOLEAN);
    plsqlBlock.setInt(1,deptNo);
    plsqlBlock.setString(2,newName);
    plsqlBlock.execute();
    result=plsqlBlock.getBoolean(0);
    catch(SQLException sqlException)
    throw new SQLStmtException(CSMessageBundle.class,CSMessageBundle.EXC_SQL_EXECUTE_COMMAND,statement,sqlException);
    finally
    try{
    plsqlBlock.close();
    catch(SQLException e)
    e.printStackTrace();
    } return result;
    while am runing my page is am getting error like
    Error
    1. JBO-29000: Unexpected exception caught: oracle.jbo.SQLStmtException, msg=JBO-27121: SQL error during statement execution. Statement: BEGIN :3 = update_dname_func(:1,:2); END;
    2. JBO-27121: SQL error during statement execution. Statement: BEGIN :3 = update_dname_func(:1,:2); END;
    3. Invalid column type
    callUpdateDepartmentNameFunction_deptNO          
    callUpdateDepartmentNameFunction_newName          
    callUpdateDepartmentNameFunction
    regards,
    Prabeethsoy P

    Hi,
    http://download-uk.oracle.com/docs/html/B25947_01/bcadvgen005.htm#sm0297
    has an example of how to call a stored procedure with out parameters. Please correct your code accordingly
    Frank

  • Calling a function in child window from parent window

    Hi,
    How can I call a method in child window from parent window in adobe air using javascript. In the following example I need to call mytest() function in
    child.html from parent.html file.
    Thanks,
    ASM
    //parent.html
    <HTML><HEAD>
    <script>
    var initOptions = new air.NativeWindowInitOptions();
    initOptions.type = air.NativeWindowType.NORMAL;
    initOptions.systemChrome = air.NativeWindowSystemChrome.STANDARD;
    var bounds = new air.Rectangle(300, 300, 600, 500);
    var html2 = air.HTMLLoader.createRootWindow(false, initOptions, false, bounds);
    var urlReq2 = new air.URLRequest("child.html");
    html2.load(urlReq2);
    html2.stage.nativeWindow.activate();
    html2.window.mytest();       //NOT WORKING
    </script>
    </HEAD><body></body></HTML> 
    // child.html
    <HTML><HEAD>
    <script>
    function mytest()
      air.trace("in child window");
    </script>
    </HEAD> <body></body></HTML>

    I suspect your problem is that the child window hasn't been created by the time you call the function in the parent.Loading the content is an asynchronous processes -- AIR doesn't stop executing your code until the window has finished loading child.html. So, you will need to add an eventlistener to html2 and call the function from there:
    html2.addEventListener( "complete", onChildLoaded );
    function onChildLoaded( event )
         html2.window.mytest();

  • My iphoto9 has not been able to open for over 10 days!!  I can't load my Christmas pics, etc.  I know the pics are still there because I can access them through a round about way.  Can anyone help me to OPEN iPHOTO!?

    My iphoto9 has not been able to open for over 10 days!!  I can't load my Christmas pics, etc.  I know the pics are still there because I can access them through a round about way.  Can anyone help me to OPEN iPHOTO!?

    To re-install iPhoto
    1. Put the iPhoto.app in the trash (Drag it from your Applications Folder to the trash)
    2a: On 10.5:  Go to HD/Library/Receipts and remove any pkg file there with iPhoto in the name.
    2b: On 10.6: Those receipts may be found as follows:  In the Finder use the Go menu and select Go To Folder. In the resulting window type
    /var/db/receipts/
    2c: on 10.7 they're at
    /private/var/db/receipts
    A Finder Window will open at that location and you can remove the iPhoto pkg files.
    3. Re-install.
    If you purchased an iLife Disk, then iPhoto is on it.
    If iPhoto was installed on your Mac when you go it then it’s on the System Restore disks that came with your Mac. Insert the first one and opt to ‘Install Bundled Applications Only.
    If you purchased it on the App Store or have a Recent Mac you can find it in your Purchases List.

  • Add code behind functionality that run when the user view the SP 2013 content pages

    I need to add code behind functionality that run when the user view the SP 2013 content pages, What is the best approach to do that?
    is it add Delegate Control to master page?
    is it add code behind to master page?
    is there an event reviver for that?
    Your answer will be highly appreciated

    Hi,
    According to me, for code behind stuff
    Create master page(using module etc..), have the required placeholders in it.
    Then, create a page that inherit from this master page, now you can use that placeholder in you page.
    Lastly, place web parts in that placeholder. So, code behind will come with that master page .
    Hope it helps.
    Thanks
    -Rahul

  • How can I change fullscreen background color, so that it is the same when viewing on mac and iPad? I want this to be able to use MathType in widget text.

    How can I change fullscreen background color, so that it is the same when viewing on mac and iPad? I want this to be able to use MathType in widget text.
    As an example, html widget has white background on iPad, and black on mac. The same goes for interactive widget.
    The MathType text inserted is inserted as a image, and will have the same color when in fullscreen as when not. So I need the textcolor to be the same in both views. Anyone know how to fix this?

    We're still not communicating. This is why I wanted an example .iba.
    Here's a re-creation of my own, going off what you described. You said "all html widgets and all gallery widgets" have this problem. So I inserted a blank HTML widget and a blank Gallery widget, and typed into both. Inserted a MathType equation into both. I don't see any difference when I preview it on my Mac compared to the preview on the iPad. I want to help, but I can't help if I can't duplicate the issue.
    I've attached the screen shots and the .iba file [link to .iba file].
    Feel free to email me directly at bobm at dessci dot com. If you're uncomfortable giving some information here, tell me anything you want in email. I work for the "MathType company", Design Science.

  • Can I reimage an external hard drive that is in the windows NT file format?

    can I reimage an external hard drive that is in the windows NT file format?

    With WinClone 3.x $20 for Mac or with Windows imaging - built into Windows.
    Some like Acronis didn't (may now) work on Macs. Many use a linux CD recovery boot..
    You can write to NTFS with a simple NTFS driver. There, I strongly recommend Paragon for OS X
    www.paragon-software.com
    They also have all the program and Apple Boot Camp support
    Image a system or image a hard drive or.... ?

  • I have a sign of a little lock on the top of my iPhone 4 screen and therefore I am not able to hear from the people who call me unless that I switch the speaker on. What should I do

    I have a sign of a little lock on the top of my iPhone 4 screen and therefore I am not able to hear from the people who call me unless that I switch the speaker on. What should I do

    The little lock has nothing to do with speaker volume.  It means you have locked the rotation on your iPhone.
    Have you tried using the volume control on the side of the iPhone to raise the volume when someone calls?

  • Can you specify a missing template handler that lives under another site?

    I have configured a dedicated site, separate from my website, for my ColdFusion administrator (CFIDE).  So I have my website here: http://www.public-site.com/ and my ColdFusion admin here: http://www.cfadmin-site.com/ .  They both live on the same server but under different directories.  So now I am configuring my ColdFusion settings and wondering if there is some way to configure the missing template handler and site-wide error handler to use files that live under the public site directory so that I can give my users a consistent look?
    I am guessing that this is not possible but thought I would ask.  I may be left with creating the modules under my ColdFusion admin directory and then using <cflocation> to redirect the user back to the public website environment.  Or embedding some javascript to redirect them.  Any other thoughts?

    OK, now I think I see where you are coming from about not needing to redirect *lightbulb* and perhaps I can explain to you what I am seeing.  Again, here is my setup:
    web root: D:\wwwroot\public-site\
    cf web root: D:\wwwroot\cfadmin-site\
    Now let's say I have a file in the web root like this: D:\wwwroot\public-site\error.cfm  If I try to enter that in my site-wide error handler in ColdFusion it tells me that the file does not exist.  Makes sense.
    So I moved my file to the cf web root like this: D:\wwwroot\cfadmin-site\error.cfm and set my site-wide error handler accordingly.  Now when I force an exception I get an error that my site-wide error handler failed.  In the logs I see this error:
    "Error","jrpp-26","11/08/10","14:02:30",,"'' The specific sequence of files included or processed is: D:\wwwroot\public-site\error.cfm'' "
    java.security.PrivilegedActionException: coldfusion.runtime.TemplateNotFoundException: File not found: D:\wwwroot\public-site\error.cfm
    So now that a template is executing ColdFusion is looking for the site-wide error handler in the web root of the public site.  But the ColdFusion administrator will not let me enter that path in the site-wide error handler setting of the administrator page.
    Did you run across this too?  Surely we don't need to have the file in both locations.

  • Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

    In the new iOS7, Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

    In the new iOS7, Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

  • Had to restore iphone from a backup that was done 1 week ago.  any way to get back the texts, call logs, etc. that happened within the last week?

    this morning, i had to restore iphone from a backup that was done 1 week ago.  is there any way to get back the texts, call logs, etc that happened within the last week?

    No

  • Can I load a purchased movie from my Mac onto the iPod ?

    Can I load a purchased movie from my Mac onto the iPod ?

    Can I load a purchased movie from my Mac onto the iPod ?
    Yes, if the iPod is a Fifth Generation iPod, iPod classic, iPod touch, or a third or fourth generation iPod nano, and the movie is in iTunes. A Fifth Generation iPod can't play rented movies.
    (40237)

  • How to launch a function/procedure without suspending the parent process?

    Hi everybody,
    I would like to know if I can define something as follows in PLSQL:
    procedure master
    begin
    call a procedure_child;
    End master;
    I would like that the procedure master does not suspend the execution and wait that the procedure_child finishes in order to resume the executions with the further code.
    Thanks a lot in advanced
    Tomeu

    In the future, please stick to posting in a single forum.
    Re: How to launch a function/procedure without suspending the parent process?

  • Someone that lives in the us bought me a itunes voucher, is there anyway i could use in the uk?

    someone that lives in the us bought me a itunes voucher, is there anyway i could use in the uk?

    No, all iTunes gift cards are country-specific - a US card can only be used in the US on a US iTunes account. You could give the card back to the person that gave it to you, or sell/give it to somebody else.

Maybe you are looking for

  • What have I done, how do I correct it , delete or even find it

    Have been trying to take a 'last import' and write it to toast, not sure why I can't do it or even make a folder for them to go in to but I cannot, but in any case I imported what I thought was a bunch of folders in my last 'import' to a folder I mad

  • DV file support in Lightroom 4

    Hi, I was hoping to use Lightroom 4 for my video asset management needs, and replace Elements Organizer which I am using for that purpose now. Unfortunately, I find that LR4 does not seem to support raw DV files (.dv file extension in the Mac) -- the

  • Assessment Cycle in Profit Center

    Hi, Need urgent help. I'm running an Assessment Cycle for Profit Center but every time system does not select any sender or receiver. Error message: Cycle 8ATEST1, start date 20070401, does not include any senders. Message no. GA749 Diagnosis No send

  • Alter chain (step) - restart_on_failure

    I have got Oracle 11gr2 I use dbms_scheduler, it works fine. :o) I'd like to use 'RESTART_ON_FAILURE'-mechanism in my chain and if it is possible, in my chain steps. But not with default Oracle settings Oracle PlSql Packages reference, on page 128-41

  • Relay denied exception!! Why can i do the same with sendmail???

    Hi, Everytime I try to send email from my code, I get the following exception: class javax.mail.SendFailedException: 550 5.7.1 <[email protected]>... Relaying denied But if I try to use sendmail and send email to the same address with the same SMTP h