SWFLoader Help!

Hi,
Is there a way to access function of a flash movie that has
been loaded in by the swfloader?
I.E. In a flex app, a flash movie has been loaded via
swfloader. I want to access functions of that swf movie through
flex. Is this possible? How?

Use mySWFLoader.content.myPublicMember();
Be aware that the loading instantiating process of a swf in
SWFLoader is complex, so be sure the loaded content is ready before
you attempt to access its members.
Here is a full example:
http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=690
Tracy

Similar Messages

  • Please help about SWFLoader security

    I have a Flex4.5 application who run on Flash Player.
    I'm uploading a swf file by FileReference controls, then preview it by SWFLoader controls.But I do not want the action script in uploaded swf can visit my action script in my Flex main application.How can I do?
    Thanks!

    Again, you can use allowCodeImport to block running script in the child.
    Did you run your test from http://  The security rules are tighter there, and the loaded SWF should be calling from the main apps domain.  It is my understanding that you’ve effectively done a WGET.

  • Help me!!! SWFLoader loads black screen in front of Flashpaper2

    if(printVB.getChildByName("fpSendfax")){printVB.re  moveChild(printVB.getChildByName("fpSendfax"));}
    var ldr:SWFLoader = new  SWFLoader();
    ldr.name = "fpSendfax";
    var url:String =  "flash/flashpaperloader.swf";
    ldr.load(url);
    ldr.addEventListener(Event.COMPLETE,  function(event:Event):void {printVB.addChild(ldr)});
    I use the above code to load a flashpaper which is generated by coldfusion cfc.  When I load the movie for the first time it works great.
    If i reload another movie I get a black screen and the flashpaper loads in the  background.
    why???
    It there anything we can do?

    I'm having the exact same problem... did you find a solution????

  • Help needed on SWFLoader

    I am making a flex app which includes multiple embedded swfs
    of different charts. These are xml/swf charts i downloaded from
    maani.com. You assign the data and styling of these charts via an
    xml page which you would normally define under the "FlashVars" in
    your AC_FL_RunContent of a normal html page. These charts were
    intended for embedding into html/js pages.
    As i am making a flex webapp, not air, i cannot use mx:html
    so the only other solution is to directly load it with an
    SWFLoader. However, I cannot figure out how to define the data
    normally defined in the AC_FL_Runcontent function, i.e. which chart
    t ype it is and what xml file to look for. This is necessary for
    the charts to load at all.
    Does anyone have any ideas on this?

    This forum is nearly dead. All the action is on the "Flex
    General Discussion Forum". If this is really about flex 1.5, please
    note that in the subject.
    Tracy

  • Error after close popup with swfloader

    Hi all, hope some one could help me with this i get this
    error ( Error: Unable to load '' ) each time after i close a popup
    with a swfloader the error popsup when i click on the datagrid
    *****************************main mxml
    private function ShowPano():void
    var SWFLoaderInstance:Panoramica2 =
    Panoramica2(PopUpManager.createPopUp(this,Panoramica2,true));//
    instantiate and show the title window
    PopUpManager.centerPopUp(SWFLoaderInstance);
    SWFLoaderInstance.mainAppPano = this //Reference to the main
    app
    scope
    *******************************this is the mxml Panoramica2
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="doInt()"
    cornerRadius="10" width="600" height="450">
    <mx:Script><![CDATA[
    import mx.controls.PopUpMenuButton;
    import mx.managers.PopUpManager;
    import mx.collections.ArrayCollection;
    import mx.controls.Button;
    [Bindable]public var mainAppPano:Object = null;
    //called by the close event raised byclicking the close
    button
    private function closeWindow():void
    PopUpManager.removePopUp(this);
    }//closeWindow
    private function doInt():void
    PopUpManager.centerPopUp(this);
    ]]>
    </mx:Script>
    <mx:TitleWindow layout="absolute" right="10" left="10"
    showCloseButton="true"
    close="closeWindow()" top="10" bottom="10">
    <mx:SWFLoader
    source="{mainAppPano.datagrid.selectedItem.pano..src}"
    scaleContent="false"
    horizontalCenter="0" verticalCenter="0"/>
    </mx:TitleWindow>
    </mx:Canvas>
    ********************************xml structure
    <catalog>
    <libro>
    <name><![CDATA[<b>Biblioteca Central
    </b> ]]></name>
    <desc><![CDATA[Se inauguró el 20 de noviembre
    de 1978 ]]></desc>
    <imagen>FOTOS/est/Biblioteca Central Manuel Bartlett
    Bautista.jpeg</
    imagen>
    <pano nombrePano="Biblioteca Central Bautista">
    <src>FOTOS/Panoramicas/PanoZoom642007.swf</src>
    </pano>
    <ico>BOTONES/gifs/video.gif</ico>
    <video nombreVid="Biblioteca Manuel Bartlet">
    <src>VIDEOS/Biblioteca Manuel Bartlet.flv</src>
    </video>
    <audio/>
    <pie>Biblioteca Central Manuel Bartlett
    Bautista</pie>
    </libro>
    </catalog>

    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>javascript does not wait for the current action to complete and then perform the next line.
    means in your function call
    doSubmit('SUBMIT');is triggered and it carry on's to next line that is
    $x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
    what you need to do is amend your js function like below
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    </script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
    and set the branch source to below
    htp.p('window.close();');
    htp.p('window.opener.doSubmit(''REFRESH'');');

  • SWFLoader in Air can't access Camera/Mic?

    I have a Flex swf file I'm loading into an Air 1.5 app that does a video chat. Flex app standalone in a browser works fine, but when loaded into the Air app  by SWFLoader, it can not stream cam/mic. logging shows it successfully connecting streams and running localVideo.publish(name).
    Is this a security issue or something that is going make me cringe?
    Really need an answer, any help appreciated,
    Greg

    When loading SWFs inside a Flex/AIR app, you can see restrictions depending on how each SWF was compiled, and what resources it is trying to access.
    See these Flex Builder help sys pages, or LiveDocs for more info:
    Loading local assets
    SWFLoader control
    Using multiple SWF files

  • SWFLoader Memory - At my wits end! Ugh!

    I am pulling my hair out trying to make sense of why SWFLoader controls consume so much memory?
    I'm trying to load SWF's that are pages of a document.  Each page is about 100k in size.  In this example, I'm loading 100 pages (the same page actually).
    I fully understand that 100 * 200k = 20MB of memory.  Lets assume the SWFLoader has a *ton* of overhead - 1MB of memory per instance - that math still means the app shouldn't consume more than 120MB of memory - but in this instance it is consuming up to 1GB of memory!!
    I can't / don't understand what is going on or why it would consume this much memory.
    When you first load the example, all is well (sort of at somewhere around 80MB of memory).  However, if you click and drag the scroll thumb up and down slowly, you'll see your memory balloon to well over 1GB of memory - and continue to balloon until crash.
    Note that I'm not attaching *any* event handlers or even attempting to unload anything(!)  This is as plain vanilla as it gets!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
         <mx:Script>
              <![CDATA[
                   import mx.controls.SWFLoader;
                   private function loadDocs() : void {
                        var sl : SWFLoader;
                        for(var i : uint = 1 ; i < 100; i++){
                             sl = holder.addChild( new SWFLoader() ) as SWFLoader;
                             sl.load('e514508fa074478cbef52d2662925246_1.swf' );                    
              ]]>
         </mx:Script>
         <mx:VBox height="100%" width="100%">
              <mx:HBox width="100%" height="100">
                   <mx:Button click="loadDocs()" label="load docs"/>
              </mx:HBox>
              <mx:VBox id="holder" height="{this.height - 130}" width="{this.width - 30}"/>
         </mx:VBox>
    </mx:Application>
    Attached is the test document I'm loading.. so you can try this for yourself.
    I just can't figure out what is going on or how to approach this any differently.
    I know it is Friday and we've all checked out at this point mentally, but if anyone can please help me solve this, I'll paypal you a $100 bounty instantly to buy you and yours a few rounds on me over the weekend (and saving my sanity)!  
    Thanks for any ideas you have in advance
    -Nate
    [email protected]

    My apologies - after exhausting everything else, I started to test the client's generated swf and apparently it is their swf file specifically that is causing the problem.
    So, turns out I'm not taking crazy pills after all.

  • Issue with Parent child dashboards using SWFLoader component

    Hello Gurus,
    I am using Parent-child dashboards approach in our project.
    I have multiple child files embedded in Parent dashboard using the SWFLoader (directly passing the URL as SWFLoader value) to load child dashboards. All the child, parent swf's are saved in the same intranet folders.
    When I open the parent SWF, everything loads fine in the intranet.
    But for some users, when they open from the intranet, the child dashboard doesnt load up properly or size of the dashboard gets reduced to a small version. (Iam sure that it has nothing to do with the access/privileges)
    Any thoughts/ideas what could be causing an issue with child dashboard/resizing of the child dashboard.
    Please help!
    regards,
    S R

    Check whether the machine has compatible flash version in error specific machine and your machine.

  • Click event on SWFLoader

    Hello,
    In my FLEX application i have a SWFLoader where i load some wsf files that are located in others places in the web. Some of the swf files loaded contain an hyperlink associated and, when the swf file is clicked, a new web page is opened.
    So, i need to count the number of clicks made in the SWFLoader but, in the case when the swf file has an hyperlink associated, the click event is not fired. What can i do to detect if a click was made in the SWFLoader?
    Thanks in advance for your help.

    Hi carlos_sousa4,
    Check the below code loading the Flash SWF in to Flex application.. and handling a click event on the Flash SWF Button in the Flex app..
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    backgroundAlpha="0"
    backgroundColor="#FFFFFF">
    <mx:Script>
      <![CDATA[
       import mx.controls.Button;
       import mx.controls.Alert;
       private var loadedSWFMainTimeline:*;
       public function onSWFLoadComplete():void {
        Alert.show("onSWFLoadComplete");
        //loadedSWFMainTimeline gets you a reference to the Flash SWF MainTimeline
        loadedSWFMainTimeline = swfLoader.content;
        if(loadedSWFMainTimeline)
         var _button:SimpleButton = loadedSWFMainTimeline.button_btn as SimpleButton;
         _button.addEventListener(MouseEvent.CLICK,onMCButtonClick);
       public function onMCButtonClick(event:MouseEvent):void {
        if(loadedSWFMainTimeline)
         Alert.show("HELLO SWF LINK CLICKED");
      ]]>
    </mx:Script>
    <mx:SWFLoader id="swfLoader" source="assets/flashswf.swf" complete="onSWFLoadComplete();"/>
    </mx:Application>
    Note : In the above code  button_btn is the Flash button instance of the SWF file and the corresponding type in the Flex will be SimpleButton...In your post you said that you are using a HyperLink so may be you should flash.text.TextField datatype instead of SimpleButton.
    Try to debug by putting a break point at onSWFLoadComplete function and watch the loadedSWFMainTimeline varibale you will come to know the exact type and the other parameters in the SWF file.
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • .removeEventListener(Event.ENTER_FRAME  is not working please help

    hey guys... so i have a new problem... basically im trying to load a swf, and for this swf to load properly i need to pass it an id, and when the swf, after using the id gets all the necessary data, sets a variable called loadCompleted to true
    The problem is after my code encounters the loadComplete == true, it adds an image of that swf to my tileList, and it adds a million of these images, indicating that my event never got removed.... any ideas??
    i have the following code
    private function swfLoaded(event:Event):void{
         trace("-------------> in function swfloader");
         childSwf = new MovieClip();
         childSwf = event.target.content;
         childSwf.init(name[1]);
         childSwf.addEventListener(Event.ENTER_FRAME, compFrameEntered);
    private function compFrameEntered(event:Event):void{
         if(childSwf.currentFrame == childSwf.totalFrames){
              if(event.target.loadComplete == true){
                   trace("<<<<< load complete: " + event.target.loadComplete);
                   childSwf.removeEventListener(Event.ENTER_FRAME, compFrameEntered);
                   var myClip:MovieClip = event.target as MovieClip;
                   var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(myClip);
                   var imgData:Bitmap = new Bitmap(imageBitmapData);
                   slideImages.addItem(imgData);
                   trace("load complete company ");
    it not only adds a million same images, but it also displays "load complete company" a million times....
    any ideas?? any help is greatly appretiated! ive been having this problem for a couple of days now

    hi,
    It seems they have changed how it works,
    https://acrobat.com/    when I go here it is automatically logged me in to a page that allowed me to start a meeting
    David

  • Objects with IDs not instantiated inside Accordian using SWFLoader

    Flex SDK 3.2.1
    We are using SWFLoader to load one application from another application.
    The second (child) application uses Accordian component which contains datagrid with a specified ID attribute.
    When the code tries to access the datagrid using the specified ID the application throws the following error.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Any help will be greatly appreciated.
    Thank you,
    Srini

    I figured it out!
    For anyone else out there who might be looking for the same effect, here's how you do it:
    1) Create a cool shape with a cool stroke in Illustrator. 
    2) The stroke can be any color, but make sure that the Fill is white (not transparent).
    3) Copy and paste to InDesign. 
    4) Once in ID, the object will apear as a Group.  Go to Object -> Ungroup.
    5) Because the white centre of the object is filled with white, this will apear as one of the items in the group.  It will have it's own object frame. 
    6) Go to File -> Place.  Choose a photo and place it in the frame of the white space.  You'll get a lovely effect that can be manipulated as per usual in ID!

  • Need some help with security sandbox stuff asap please

    hey guys... so im trying to do a swfLoader call to a swf on a server from my actionscript on my local machine, when i do that i get the security sandbox violation error.... i tried adding a crossdomain.xml file to the server that has the following code in it
    <cross-domain-policy>
         <site-control permitted-cross-domain-policies="master-only"/>
         <allow-access-from domain="*"/>
         <allow-http-request-headers-from domain="*" headers="SOAPAction"/>
    </cross-domain-policy>
    and in my actionscript on application initialize i do
    initialize="init(); Security.loadPolicyFile('http://myServer.com/crossdomain.xml')"
    i also do
    Security.allowDomain("http://myServer.com");
    any ideas???? oh and i also went to this website http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml and set the always allow trust locations to "/"
    any ideas on how i could possible fix this problem?? ive been trying to get around this problem for the last 2 days!!
    please help!!!!

    Hi,
    Please use policy file logging to check the exact error. This should shed some light on the problem.The procedure is detailed here.
    http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_05.html
    Nishad

  • How to access the function in loaded application using swfloader?

    Hi,
    I have a main flex application which has a view stack, panel
    and swfloader in the below hierarchy.
    Flex main app --> Canvas1(Viewstack) --> Panel1 -->
    Swfloader
    Please view
    http://www.probe7.com/flex_ques.gif
    for better understanding.
    I have a function in the loaded application which has to be
    called from a function within the main application. I am not sure
    of the syntax to access the swfloader content which is placed in a
    canvas -> panel.
    I tried this example (
    http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html),
    it works when the swfloader is placed in the main application
    without the viewstack or panel. How can I do this, Is there a way
    to access all the running applictaions, regardless of the
    hierarchy? Any help will be greatly appreciated.
    Also any links for quick reference on various components and
    their access will be helpful.
    Thanks for your time.

    You are probably seeing the deferred instantiation behavior
    which is the default for ViewStack.
    The Swfloader component does not exist until a user navigates
    to the View that contains it.
    Use events to determine when the swfloader content is ready
    for interaction. Here is an example:
    http://www.cflex.net/showFileDetails.cfm?ObjectID=690
    Tracy

  • HELP PLEASE - loading external swf scale problem

    I have a Flex 3 Actionscript Project. Basically all it does it take some flash vars, set the sound volume,  and load an external swf using a loader and add the loader as a child. The problem is I want the loaded external swf to be scaled to fill the entire stage, even if it distorts it, and that doesn't seem to be happening.
    I really need to resolve this. ANY HELP APPRECIATED.
    Marcus

    Thanks for the reply!
    Here's basically what my code looks like (note: I cut some stuff out that wasn't relevant for the sake of clarity).
    private var swfLoader:Loader = null;
    public function MySwfContainer()  
        stage.scaleMode = StageScaleMode.EXACT_FIT;
        stage.align = StageAlign.TOP_LEFT;
        var request:URLRequest = new URLRequest(swfUrl);
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,SWFLoader_Complete);
        swfLoader.load(request);       
    private function SWFLoader_Complete(event:Event):void
        addChild(swfLoader);
    What I am observing is that if a swf larger than the stage area is loaded it clips it rather than scale it down and make it fit.
    Marcus

  • Sync movie clips loaded by swfloader

    hi guys,
    i have 5 separate movie clips (swf) represent 5 flower petals,
    each of them is showing up from center,
    i load them in flex app by 5 separate mx:SWFLoader tags.
    the problem is they should sync with each other to open up the flower,
    but due to being loaded from network, they don't start at the same time.
    please help me, how to sync these flower petals?

    according to http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/SWFLoader.h tml
    it doesn't seem like SWFLoader has a method called "rewind()" or "gotoAndPlay(...)"?

Maybe you are looking for

  • Can I use Mac Mini as a "server" for a MacBook Pro and iMac?

    I want to develop a simple system for accessing my files from multiple devices. I heavily use iTunes (190 GB), iPhoto (120 GB) and iMovie (30 GB, but want to do more when I get time).  Additionally, I store lots of old videos on circa 10 portable har

  • Routine in infopackage for selection

    I am writing an ABAP routine in an infopackage to select data upto a certain year. I want to load data for all the years upto 7 years ago. However, if I leave the l_t_range-low blank, the infopackage throws an error when I run it saying invalid date

  • Which payment method allows 12 month subscription

    When I try to buy a subscription 12 month susbcription is disabled. I have tried a credit card (Amex) and Paypal payment methods. What I see is the following, "Unfortunately, you cannot purchase this amount of Skype Credit as it will exceed the month

  • Can u create a 'slow merging' link between pages

    I'm creating a link so when u click a word it loads another page but instead of an 'instant' transition, can u make it blend/merge slowly? Thx

  • USB Interface Not Working With Logic Pro 9

    Hello, I've had a Tascam US-1641 for several years now with absolutely zero issues on my old PC. Ever since I upgraded to Mac (early 2011 17 inch Macbook Pro running Snow Leopard) I've had nothing but problems with the US-1641. No matter how many tim