How can I call functions from a SWF loaded in to another SWF?

Hi there,
Please excuse my ignorance, I am very new to actionscript and flash.
I have 2 SWF's - a.swf and b.swf.
I load b.swf into a.swf with the following code:
var swfLoader:MovieClipLoader = new MovieClipLoader();
swfLoader.loadClip("b.swf", container_mc);
Now in b.swf, I have a function as follows:
public function sendData(){
  trace("I ran the function!");
So I have done a lot of reading, from what I can tell I should be able to run the sendData() function from the code in a.swf, by typing:
container_mc.sendData();
but its not working. What am I doing wrong?
Thanks in advance,
Adam

Thanks heaps mate, after a bit of trial and error it works! Here is the code that I added:
var loadingListener:Object = new Object();
swfLoader.addListener(loadingListener);
loadingListener.onLoadStart = function(container:MovieClip):Void  {
    trace("The MovieClip "+container+" started loading");
loadingListener.onLoadInit = function(container:MovieClip):Void
    trace("The MovieClip " + container + " has been initialized");
  container_mc.test();
Marked your answer as correct :-)
Thanks again, I really appreciate your help.
Cheers
Adam

Similar Messages

  • How can I call functionality of ALV Grid by event of button outside grid?

    Hello,
    How can I call functionality of ALV Grid by event of button located outside ALV Grid? For example how to fire printing of this ALV Grid by button click elsewhere on the screen (not in toolbar of ALV Grid).
    Best regards,
    Josef Motl

    hi Motl,
    these are steps to create a button in ALV and trigger an event from it..
    1.Use the parameter i_callback_pf_status_set in the function module REUSE_ALV_GRID_DISPLAY
    i_callback_program = gd_repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    form set_pf_status using rt_extab type slis_t_extab.
    set pf-status 'NEWALVSTATUS'.
    endform.
    You have to copy the standard ALV pf stauts to 'NEWALVSTATUS' and add your button.
    2.You have to do the following to process the new button click.
    i_callback_user_command = 'USER_COMMAND'
    form user_command using i_ucomm like sy-ucomm
    is_selfield type slis_selfield.
    case i_ucomm.
    3. to copy the standard pf status to a new one.go to the ALV screen and take the menu System -> Status.  Then look for the standard pf status. Copy this to Z range and then add your new button.
    reward points if helpful
    regards
    satesh

  • How can I transfer songs from one computers iTunes library to another library?

    How can I transfer songs from one computers iTunes library to another computers iTunes library?

    See Here
    iTunes: How to move your music to a new computer

  • How can i authorize music from one apple id acount to another

    how can i authorize music from one apple id acount to another? My IPhone 5 wont play my songs that were purches from my old apple id account

    timss22 wrote:
    how can i authorize music from one apple id acount to another?
    You cannot. iTunes purchases remain on the iTunes account they were purchased with.
    My IPhone 5 wont play my songs that were purches from my old apple id account
    So just upload them from iTunes.
    You have mulitple AppleIDs?
    Why?

  • How can i copy files from one external hard disk to another using macbook pro with retina display

    How can i copy files from one external hard drive to another using macbook pro with retina display?

    That's odd - if you open Disk Utility (Applications->Utilities) and select the disk(s), how are they formatted? If you're only going to be used with your Mac, they should be formatted as "Mac OS Extended (Journaled)".
    Clinton

  • HT1918 How can I transfer albums from one of my accounts to another?  My new account (Apple ID) email address is no longer available to me since I lost my job.

    How can I transfer albums from one of my accounts to another?  My new account (Apple ID) email address is no longer available to me since I lost my job.

    OK, now I have another problem.  I typed in my email address wrong.  Instead of optonline.net I typed in optimum.net.  Though I can google my email address and it defaults to the optonline.net the email to confirm the change is not showing up.  I know, real stupid.  Now I cannot log onto either address as the original is not changed and the email has not showed so am I done here?  I appreciate your help!!!  Carl

  • How can I call AM from another page

    Hi,
    I have come across a situation which I am not sure how to solve it. Here is the issue. I have a custom requirement to add another page to an already existing custom page. The first page used to hold the data and commit buttons however because of requirements, we want users to add some comments on the second page and then save the data. In other words the save button is now suppose to move to the second page.
    The dilemma I have is that the method that used to be called from the PFR CO of Page 1 was linked to page 1 AM which had that commit method.
    I still want to re-use the method from the Page 1 AM since there is a lot of logic involved. How can I call that method while I am in my second page from my CO?
    I am using setForwardURL and I am retaining AM from page 1.
    Also, if this is not feasible what are other alternatives. Any ideas would be appreciated.
    Edited by: user501998 on Jan 7, 2010 12:21 AM

    Hi,
    Can you give me an example? I mean do I just call the AM like in the example below...in my PFR...of Page 2 Controller. I thought this would be giving me an error method not found or something since it would be looking at the AM of my current page. I will try it and see but if there is another syntax can you please provide it.
    Thanks
    Partial code from PFR of Page 2
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if(eventName.equals("save"))
    if ( respName.endsWith("Admin") )
    am.invokeMethod("commitTransaction"); --- This is the AM Method in Page 1...
    } else
    throw new OAException("Shipper successfully updated.", OAException.CONFIRMATION);

  • How can I call functions in packages using flash builder?

    a new guy in flash developnet, I need to find out a way to import multiple packages into frames and call functions. I know how to import packages, but an error occurs error 1120 : access of undefined property. How can ı solve them?
    Is there any easy way to add Mediapomise object to the stage form the package? "addChild(loader);" does not work? or ı do not know whether it works or not, ı could not see the photo that ı took from camerauı object in android.
    thank you 

    I need to find out a way to import multiple packages into frames
    Usually, no matter where you use any classes of any package, the imports happen always in the beginning.
    If you have a specific problem with flashbuilder you should post in this forum:
    http://forums.adobe.com/community/flash_builder

  • How can I call contacts from my list without the country code that is registered with that contact?

    I have all my contacts registered with a country code. When I want to make calls from my iphone, I do not want the phone to dial the country code, but only the area code. How can I make that happen?

    Your 3G backup contains your contacts already, you don't need to sync them to Outlook or anything just restore the backup file from the 3G onto the 4S and you should be good to go.
    This kb article should help:
    http://support.apple.com/kb/ht1414

  • How can I call EJB from JSP/Servlets in iWS?

    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

    Park,
    Why Are you running your JSP/Servlets in iWS instead of iAS? For whatever
    reason,
    look at the Converter sample from iAS. You will be doing RMI/IIOP in this
    case and the sample explains in detail what to do.
    hth,
    -robert
    "SungHyun, Park" <[email protected]> wrote in message
    news:9jpfmt$[email protected]..
    Hi!!
    My JSP/Servlets are on iWS, and I deploy EJB on iAS.
    In this case, I don't know how JSP/Servlet call EJb on iAS.
    I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
    I will thank you if you give me a simple example source using JSP/Servlet
    and EJB.
    Thanks in advance!!!
    - Park-

  • How can i use function from microsoft DLL in an ABAP program?

    Hi
    Is there a way to use a function from a standard DLL file in an ABAP progrm ????
    The dll is stored in c:\winnt\sttem32.
    Do i need to upload the dirver to the ECC server? do i need to put it some Tcode before i use it in my program?
    i tried to fined some clear exaple but without any success .
    Hope to get some help here ,
    thanks ,
    E.

    this is not really possible, a dll cannot be uploaded, eg. sap could run in a non windows-environment so this won't work
    Why not?  You can query the local operating system for type/version, you can detect the presence of a file if you have the access, and you can run local executables using GUI_EXECUTE.  However, if you've got any level of decent security in place, you're not going to be allowed to run a DLL in that location...

  • How can use  CALL FUNCTION   READ_TEXT

    Dear SAP Expert,
    I am working in Journal Voucher of smart form.  I want to show Long Text in SF. 
    So i am  using  the READ_TEXT function module to read SAP long text. and use Range of Clear Doc. in driver program.
    i have one ITAB which have 20 rows.
    problem is that CALL FUNCTION   READ_TEXT is not working properly ...........
    i WANT  store Long text   clear Doc. no. wise in my ITAB .
    DATA: FORMNAME TYPE     TDSFNAME VALUE 'ZFI_S_JOUR_VOUCHER'.
      DATA: FM_NAME  TYPE     RS38L_FNAM.
    lv_name = ITAB-BELNR.            
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id        = c_id
          language  = 'E'
          name      = lv_name
          object    = c_object
        TABLES
          lines     = lt_lines
        EXCEPTIONS
          id        = 1
          language  = 2
          name      = 3
          not_found = 4
          object    = 5.
        IF sy-subrc = 0.
        ELSE.
          LOOP AT lt_lines INTO wa_lines.
            CONCATENATE ld_text wa_lines-tdline INTO ld_text.
          ENDLOOP.
        ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME = FORMNAME
        IMPORTING
          FM_NAME  = FM_NAME.
      DATA: V_PRCTR LIKE BSIS-PRCTR.
      CALL FUNCTION FM_NAME
    EXPORTING
        V_TYPE_DES                 = V_TYPE_DES
        P_BUKRS                    = P_BUKRS
    TABLES
          IT_BKPF                    = IT_BKPF
          ITAB                    = Itab
          TY_BSIS                    = TY_BSIS.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " call_sm

    hI [See this |http://wiki.sdn.sap.com/wiki/display/BOBJ/FunctionExampleREAD_TEXTABAPwrapper+function]
    Check out the wiki session .
    FUNCTION Z_AW_READ_TEXT_ALL.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(ID) TYPE  THEAD-TDID
    *"     REFERENCE(LANGUAGE) TYPE  THEAD-TDSPRAS
    *"     REFERENCE(NAME) TYPE  THEAD-TDNAME
    *"     REFERENCE(OBJECT) TYPE  THEAD-TDOBJECT
    *"  EXPORTING
    *"     REFERENCE(TEXT) TYPE  CHAR2000
    DATA BEGIN OF TEXTHEADER.
            INCLUDE STRUCTURE THEAD.
    DATA END OF TEXTHEADER.
    DATA BEGIN OF TEXTLINES OCCURS 10.
            INCLUDE STRUCTURE TLINE.
    DATA END OF TEXTLINES.
    CLEAR TEXTHEADER.
    data: l_name type TDOBNAME."TR
    l_name = name."TR
    CALL FUNCTION 'READ_TEXT'
           EXPORTING
                OBJECT                  = OBJECT
                ID                      = ID
                LANGUAGE                = LANGUAGE
                NAME                    = l_NAME "TR
           IMPORTING
                HEADER                  = TEXTHEADER
           TABLES
                LINES                   = TEXTLINES
           EXCEPTIONS
                ID                      = 1
                LANGUAGE                = 2
                NAME                    = 3
                NOT_FOUND               = 4
                OBJECT                  = 5
                REFERENCE_CHECK         = 6
                WRONG_ACCESS_TO_ARCHIVE = 7
                OTHERS                  = 8.
    LOOP AT TEXTLINES.
       CONCATENATE TEXT TEXTLINES into TEXT SEPARATED BY space.
    ENDLOOP.
    ENDFUNCTION.
    Regards,
    koolspy.

  • How can I transfer music from one user's account to another on my Imac?

    I want to transfer some music from my Imac user account to another user account on the same Imac.  How can I do this?

    Here are the instructions to do that:
           http://support.apple.com/kb/HT1203?viewlocale=en_US&locale=en_US

  • How can i leave audio from one clip playing, while showing another one in i

    i am editing a movie, using iMovie 08, and want to use sound for a clip in the video for the end credits. how can i do this?
    just to be clear, i am not trying to add audio. i am trying to leave the audio from ONE CLIP playing, while viewing a new frame. thanks.

    This is simple in iMovie 11 (drag and drop), but in iMovie 08, you can still do it.
    [See this blog post for details|http://imovie08.blogspot.com/2007/08/how-to-extract-audio-from-clip.htm l]

  • How can we call methods of one web dynpro component in another one

    Hello Team,
    How do I call  one Web Dynpro component methods in another Web Dynpro component.
    How do we use public parts.
    thanks

    Hi,
    You want to use Comp2's getData() method in Comp1
    If both the WebDynpro components are in the same DC:
    1. Create a wrapper method (with the same signature) in the Comp2's Interface controller. And invoke the Component contorller's getData() method in this method using the below code.
    wdThis.wdGetComp2Controller.getData()
    2. Now Go to the Comp1 and right click on UsedWebDynproComps and add this Comp2 as a UsedWebDypro component.
    3. Now go to the Component Controller of Comp1 and in properties tab add the usage declaration of Interface controller of Comp2.
    4. Now using this below code you can access the method of InterfaceController of Comp2.
    wdThis.wdGetComp2Interface().getData();
    If both the WebDynpro components are in different DCs:
    1. Right click on Comp2 and select Add to public part on Comp2 in DC2.
    2. Now Add this public part in DC1 UsedDCs.
    Now repeat the above stpes 1...to..4. of  "If both the WebDynpro components are in the same DC" same.
    Regards,
    Charan

Maybe you are looking for