How to load external SWF used sharing library.

Hi~~~
Before ask the question, plz understand my bad English..
Recently I try to load the Swf file that is maded by Flash CS 6.0.
Especially it used shared library..
When I try to load this SWF, I used FileStream instead URLRequest.
This is because the target SWF File located same device with the Swf Application.. So when I use the URLRequest
it give me the warning - Sandbox security violation.
But by using FileStream, the warning did not occur.
This is the sample code below..
  var myFile = new File(path);
  var myStream = new FileStream();
  myStream.open(myFile, FileMode.READ;
  var myBytes:ByteArray = new ByteArray();
  myStream.readBytes( myBytes );
   mSwfLoader.loadBytes( fileStream, context );
   mSwfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadedComplete);
As you can see, I made a event listener to get the content of the Loader, after receving Complete Event(I guess.. after decording?).
But I can't receive any event call, so I removed symbol used sharing library in the SWF.
And this gave me the result as I respected... So I guess the problem caused by using sharing Library..!
(In parenthease, I can see the valid result in running debug time on the Flash CS6..)
What should I do? I respect that using sharing libary give saving memory.  So I want to using it as possible.
Thanks for your reading...!

Here is one way:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f9c.html
HTH,

Similar Messages

  • Loading External SWF using Absolute Path

    Hi,
    I am having trouble loading an external swf on a server using the absolute path. This external swf uses webcam streams and is loaded in the original swf file using the URL request code. I can load other swfs but just not that one. I have set the permission of the external swf to allow write/read/execute. Any help is apprieciated.
    P.S. I have also tried changing the location and name but still doesn't help.
    //Loads the augmented SWF into the main timeline.
    var request:URLRequest = new URLRequest("http://www.reminisce.me/files/jz_AR.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    arHolder.addChild(loader);
    arHolder.x=300;
    arHolder.y=125;
    Thank you for your help in advance.
    -John

    I can´t get the linked swf to run in any browser, are you sure that it compiled right?

  • How to load external swf and handle events of external swf by passing data .

    Hi all
    I have to laoad external swf (made in flash).On loading i have to pass data and hndle events which occurs on this swf.
    Can any one suggest me how can I achieve this.
    Regards
    Munira

    Here is one way:
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f9c.html
    HTH,

  • How to load External swf file in AIR

    I try this code its working in computer but when I publish this file in .apk or .ipa , my external swf file is not opening
    (I include my external file as well)
    places_btn.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
    function newvid(event:MouseEvent) {
         trace("you clicked me");
         var loadit = new Loader();
         addChild(loadit);
         loadit.load(new URLRequest("scene02.swf"));

    thx boss its working great
    I have 3 scenes; load scene code is working great
    1. How can I unload the scene?
    2. Can I unload all scenes or one by one?
    can I unload some think like this
    Load scene 2 , unload scene 1 and scene 3
    Load scene 3, unload other all scene
    i try this
    load2.addEventListener(MouseEvent.MOUSE_DOWN, newvid);
    function newvid(event:MouseEvent) {
              trace("you clicked me");
              var loadit = new Loader();
              addChild(loadit);
        var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
        loadit.load(new URLRequest("scene02.swf"), _lc);
              loadit.unload();
    load3.addEventListener(MouseEvent.MOUSE_DOWN, newvid1);
    function newvid1(event:MouseEvent) {
              trace("you clicked me");
              var loadit = new Loader();
              addChild(loadit);
        var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
        loadit.load(new URLRequest("scene03.swf"), _lc);
              loadit.unload("scene01.swf scene02.swf");

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

  • HELP! How to load multiple swfs using the following code?

    In actions for Frame 1:
    var myrequest:URLRequest=new URLRequest("A.swf");     
    var myloader:Loader=new Loader();
    myloader.load(myrequest);
    img1.addEventListener(MouseEvent.CLICK, clickButton);
    function clickButton(event:MouseEvent):void{               
        stage.addChild(myloader);
    img1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
    function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
         gotoAndStop(13);
    In action for Frame 13:   (img2 is another button)
    img2.addEventListener(MouseEvent.CLICK, unloadFunction);
    function unloadFunction(event:Event):void{
         stage.removeChild(myloader);

    do you want to load another swf (eg, B.swf) when you're in frame 13 and img2 is clicked?  if yes, and you don't want A.swf to continue to play, use:
    //In action for Frame 13:   (img2 is another button)
    img2.addEventListener(MouseEvent.CLICK, loadF2);
    function loadF2(event:Event):void{
        myloader.load(new URLRequest("B.swf"));

  • How to load external swfs in air for android?

    All swfs have actions in thier timeline.

    Do you mean external from local filesystem where is your files? Or from the web?

  • Loading external swf files in a swf - Error#1009

    I have been having trouble using a swf file within a swf file.   The external swf files all work as expected.  However when used within another swf file I get the standard TypeError #1009 for some of my swfs.   The external swf files are mainly actionscript 3 files.  A typical swf file will have an object (or objects) in the library which has an export for ActionScipt property enabled and an addEventListener(Event.ENTERFRAME, somefunction).   About four years ago when I had to do some work with AS2 I seemed to get around a similar issue with the _lockroot method but this is no longer part of AS3. I have searched various forums and note that I am not the only one with this issue but did not find any relevant solutions.   If anyone could give me any ideas on how to get around this it would be appreciated.
    Regards
    Norman

    Hi,
    I have added a download to rapidshare and its link is:
    Download link: http://rapidshare.com/files/380202712/ExtSwfs.zip
    The main file Training01.fla has been set up with links to download several swf's.   The links that do not work properly are those labelled :  Module6 and Module 8.   The first Module 6 connects to a function that is a variation of how I was trying to load external swfs using Application Domain, while Module 8 is a link to a swf that uses and external class.  Module 8 is supposed to load with rotating stars, while Module 6 loads the same file as the link called Module 1.   As soon as I use the two links Module 6 or Module 8 the whole lot ceases to work properly.  I did also follow through the examples on the Adobe site.  The examples for Module 6 and Module 8 are tutorials I have used from the Internet as part of my training from the site FlashMyMind.com but they replicate the type of work we have been doing with respect to using ActionScript3.
    Re my background, at this stage I am self-taught using tutorials on the web and whatever books I can lay my hands on here.  There is no structured training available where I live as there is insufficient demand and no books available on Flash or ActionScript at the local book stores or libraries so the books are ones I have ordered via the Internet.  The one I am currently using apart from Adobe Classroom in a Book Flash CS4 is O'Reilly's Learning ActionScript 3.0 a Beginners Guide.
    The other problem I have been trying to solve and still researching is why one loses sound in the flash player when playing flv files, if the user has selected or restarted a video (or videos) many times eg 25 to 30 times as we create video training files and serve them to the user within the flash environment using Flash Player 9 and IE6.
    Regards
    Norman

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • How to Load an external swf using loadmovie in AS3

    I need to create a button with script, on rollover load an external swf into movieclip in AS3.  This was able to create this in AS2, but I need to create this in AS3

    Thanks again Ned.
    Kenneth Russell
    graphic artist, Sr.
    Lockheed Martin - MS2
    2323 Eastern Blvd., Baltimore, MD 21220
    Phone 410.682.0554    Fax 410.682.0543
    From: Ned Murphy <[email protected]>
    Reply-To: [email protected]
    Date: Thu, 23 Jul 2009 19:08:25 -0600
    To: kenneth russell <[email protected]>
    Subject: How to Load an external swf using loadmovie in AS3
    In AS3 you use the Loader class to load external swf's and image files.  You
    should be able to find examples both in the Flash help files and these forums
    if you search.  If you aren't aware of how to code buttons in AS3, that can be
    found as well.  In AS3, just about any kind of interction involves the use of
    event listeners in combination event handler functions... in the case of a
    button rollover an example would be...
    btnName.addEventListener(MouseEvent.ROLL_OVER, overHandler);
    function overHandler(evt:MouseEvent):void {
         // your loading code or whatever
    >

  • Loading from library conflicts with loading external swf

    I'm very new to ActionScript, so this might be incredibly basic. However, I've Googled and read myself into a coma and I'm not finding a solution.
    I have a movie with 6 navigation buttons.  Four of them load external .swf slideshows, and they work fine - as each file loads, the previous one clears the stage, etc.  The other button that I currently have set up is loading, from the library, an image.  The problem I'm having is that the slideshows replace each other on the stage - they're not stacking, they're replacing - but when the user selects the button that loads the image, the image overlays the last-selected slideshow.  If the user selects the image first, the image is visible when two of the external files transition.  Because of that 6th button, which is not yet even started, it's not desirable to me to simply set up the single image as another external file; if it's at all possible, I need to be able to pull from a library file when I build that last button.
    What I'd like to do - because there is no logical order that the buttons should be selected in - is figure out how to tell every button to remove the image file on click.  I've tried using this in the four buttons that link to the slideshows, to deal with the image (that's the one called quoteImage):
         if(myLoader != null && contains(quoteImage)){
            myLoader.removeChild(quoteImage);
    which has the advantage of not giving me any errors, but doesn't actually fix my problem.  I've tried many, many other things, and I'm just really stumped on what exactly I need to do to make this work the way I want it to.  Based on the fact that the books and online resources I've been using don't really cover this specific example, I suspect it might be an incredibly idiot thing to do, but I'd really like it to work this way if that's possible.
    The code as it stands, with the global variables and the first two buttons (the next three are identical to the second button and the sixth button doesn't exist) looks like this:
    var myLoader:Loader=new Loader(); 
    var quoteImage:Bitmap;
    stop();
    // Loads quoteImage from library
    btnQuotes.addEventListener(MouseEvent.CLICK, showquote);
    function showquote(event:MouseEvent):void {
    var myBitmapDataObject:myBitmapData = new myBitmapData(500, 350);
    var quoteImage:Bitmap = new Bitmap(myBitmapDataObject);
    quoteImage.x=150;
    quoteImage.y=180;
    addChild(quoteImage);
    // Loads industrial.swf from external file
    btnIndustrial.addEventListener(MouseEvent.CLICK, showindustrialcontent);
    function showindustrialcontent(event:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("industrial.swf");
    myLoader.x=150;
    myLoader.y=180;
    myLoader.load(myURL);
    addChild(myLoader);
    Help is very much appreciated.

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Unable to load external swf which has runtime sharing with another swf.

    Hi,
    I am getting issues on loading external swf say "importer.swf" file into another swf file say "loader.swf" for second time like
    ReferenceError: Error #1065: Variable testSymbol is not defined. VerifyError: Error #1014: Class testClass could not be found.
    at global$init()
    In the external swf "importer.swf", i am trying to import the symbol "testSymbol" from another swf file say "exporter.swf", which exports through runtime sharing option for the symbols.
    I am having some buttons in loader.swf file and on each button click i am loading different swf files into the loader.swf after unloading the previous one.
    I am able to load and unload different swf files but unable to load the importer.swf file which is sharing symbols from external swf and that too for the second time i.e., when i click the button twice.
    When trying to debug with flash debugger, all the other swf files are being unloaded before loading of another swf but the swf which is sharing symbols/classes with another swf is not getting unloaded.
    Output when i am trying to load two files example and importer files into loader.swf file on two different button clicks. On first button click example.swf is loaded. On second button click , example.swf is unloaded and importer.swf is loaded which is successful. On first button click again importer.swf is unloaded and example.swf is loaded. On second button click again, example.swf is unloaded and importer.swf is loaded, here i am getting issues shown above.
    Attemping to launch and connect to Player using URL D:\runtime issue\loader.swf
    [SWF] D:\runtime issue\ loader.swf - 8181 bytes after decompression
    [SWF] D:\runtime issue\example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    [SWF] D:\runtime issue\importer.swf - 441708 bytes after decompression
    [SWF] D:\runtime issue\ example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\ example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    ReferenceError: Error #1065: Variable xxxxxx is not defined.
    Debug session terminated.
    Code i am using
    b1.addEventListener(MouseEvent.CLICK, b1Clicked);
    b2.addEventListener(MouseEvent.CLICK, b2Clicked);
    var ldr:Loader;
    function b2Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("importer.swf"));
        addChild(ldr);
    function b1Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("example.swf"));
        addChild(ldr);
    If i try to open the swf using IE, i am not getting any issues at all. But i need to open this loader.swf in a air application. Also when i use loaderContext for the loader instance i am able to get rid of this issue but i cant use it in my application.
    So, please help me in resolving this issue.
    Thanks

    I got my answer. I had to append the photo url to the 'movie' value of the javascript embed method. Like this:
    <script language="JavaScript" type="text/javascript">
       AC_FL_RunContent(
          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
          'width', '550',
          'height', '400',
          'src', 'lesson2',
          'quality', 'high',
          'pluginspage', 'http://www.adobe.com/go/getflashplayer',
          'align', 'middle',
          'play', 'true',
          'loop', 'true',
          'scale', 'showall',
          'wmode', 'window',
          'devicefont', 'false',
          'id', 'lesson2',
          'bgcolor', '#ffffff',
          'name', 'lesson2',
          'menu', 'true',
          'allowFullScreen', 'false',
          'allowScriptAccess','always',
          'movie', 'lesson2?photo=http://www.flash-mx.com/images/image1.jpg',
          'salign', ''
          ); //end AC code
    </script>
    Thanks,
    srb.

  • Dynamic plug-ins: How to dispatch MediaFactoryEvent.PLUGIN_LOAD after loading external swf

    Hi,
    I'm creating a dynamic OSMF plugin. That plugin needs to load external SWF file before sending the PLUGIN_LOAD event to the player.
    How can I override the dispatch of the PLUGIN_LOAD event on my MyCustomPluginPluginInfo custom class ?
    If it's not possible, the solution is to create a new MediaElement within my MyCustomPluginPluginInfo:
    var mediaElement:MediaElement = mediaFactory.createMediaElement( new URLResource(null) ); //the resource is null at this point
    On the player side I add that line when the plugin is loaded successfully:
    //Add listener on Media Element creation
    mediaFactory.addEventListener(MediaFactoryEvent.MEDIA_ELEMENT_CREATE, onMediaElementCreate);
    Is it a god solution or not ?
    Is there another way to do that ?
    Thanks !

    Hello!
    I'm not sure you can do it through loadPlugin stage due to an swf loader is used in factory on that moment.
    As for loading an extra swf "per instance" way I'd rather do it using an element LoadTrait than try to bypass the standard factory way.
    Regards!

  • Load external SWF's help

    I am using this thumbnail gallery attached but instead of loading images through the xml I want to load external SWF'S. I also want to be able to control each SWF loaded in individually apparently in order to do that I need to give the container different instance names..however I don't know how to extend the code inorder to achieve this..can anyone help?

    Hello Kglad,
    Thank you for the swift reply, I don't know how to apply this to my code. At the moment it loads in images but it will load in external SWF's I pressume this is the section of code relevant;
    function thumbnailer(k){
    total_thumbs = _global.total;
    var container = thumbnail_mc.createEmptyMovieClip("th"+k,thumbnail_mc.getNextHighestDepth());
    container._visible=false;
    container._alpha=0;
    var image = container.createEmptyMovieClip("img", container.getNextHighestDepth());
    tlistener = new Object();
    tlistener.onLoadInit = function(target_mc) {
      target_mc.pictureValue = k;
      target_mc.onRollOver = function() {
       this._alpha = 50;
      target_mc.onRollOut = function() {
       this._alpha = 100;
    image_mcl = new MovieClipLoader();
    image_mcl.addListener(tlistener);
    image_mcl.loadClip(thumbnails[k], "thumbnail_mc.th"+k+".img");

  • Loading external swf fonts created with fontswf, loaded with a Loader, compatible with iOS

    Let me immediately start out by saying that I do in fact have a current working solution for using embedded fonts, generated by fontswf and working in an AIR ActionScript mobile application, and also currently working fine with iOS.
    My current app needs CFF fonts, so I currently use the fontswf tool to pre-generate the .swfs using:
    fontswf -4 -a [SomeAlias] -o [SomeFont.swf] [SomeFont.ttf]
    and then I am currently embedding them in my app source code .as for compilation using:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    I then have no problem registering them using Font.registerFont(SomeFontClass) and everything works fine.
    However, I would prefer to take the use of these swf fonts one step further and load them dynamically using a Loader so that I do not have to take the hit of having multiple CFF font swfs embedded in the main compiled SWF and so that I could even load an unknown future set of fonts without having to supply them as part of the app build.
    Now I have seen and read many blogs and tutorials where people have exported font swf from Flash Builder where you add an explicit 'Class' name or even made standalone .as static files compiled into standalone swfs only including the two lines:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    so that you also have a 'Class' involved. Then people use some form of appropriate applicationDomain.getDefinition("className") as Class
    to pull out the class for the font registration.
    My question is, how does one perform the same font loading and registration of fonts using a Loader only loading the .swfs produced directly from fontswf?
    It seems only a DefineFont4 is tagged in the swf, there doesn't seem to be a 'Class' per se to call on.
    More importantly, iOS apps cannot load external swfs with code in them, so my understanding is any extra wrapped swf that would contain a custom Class technique would fail the iOS requirement of only having one main SWF with any ActionScript compiled code.
    Is there an alternative to the 'Class' technique by grabbing the DefineFont4 tagged resource from the swf and instantiating a proper working Font class from that? One that would still be compatible with the restrictions placed on AIR mobile apps running on iOS?

    Ironically, just after posting this, Adobe released AIR 3.5 beta onto labs, and added multiple SWF support for iOS.
    While this new support makes it easier to manage your content across multiple SWFs and technically allows you to use the class based separate .swfs for each font if desired, the system still requires that all these SWFs be present at compile time when making the final app .ipa for iOS.
    So this still doesn't solve trying to load fonts after the app is already built. For example, as part of a downloaded in-app purchase mechanism.

Maybe you are looking for

  • Issue with importing music manually.

    Apparently, I should be able to load songs on to my ipod manually by dragging them from my library to the ipod icon in itunes; however, this is not working. When I drag a file a circle with a line through it appears and it does not allow me to manual

  • Fibre Optic in my area?

    I live in Shipton Bellinger (SP9) a little village at the edge of Hampshire. It is a highly military village and contains a lot of families who all need good usage of the internet. However the speeds we have are abysmal. At the best of times we strug

  • Apple id for kids not logging in to imessage and facetime

    I created a new apple id for my child and added it to my family sharing. I have used the apple id to successfully login to icloud and the itunes store on the ipod. But it keeps rejecting the same account for imessage and facetime - error message is t

  • Import Process without BCD value

    Dear All, Normally in an Import scenario,7 duties will be there(CVD,ECessCVD,Hig EcessCVD,BCD,EcessBCD,Hig EcessBCD,Spl Addl duty). We fill the 7 values while doing Customs MIRO and the MIRO number will be given while doing MIGO which adopt the value

  • IMovie won't import gameplay files from Elgato.

    I recently got an HDPVR (The Elgato Game Capture HD) to record gameplay from my Xbox 360. I recorded about an hour of gameplay and used the Elgato's software to import the file into iMovie. It began it's import but got hung up on a part that said "Ge