How to load and resize a SWF in a MovieClip

Hello.
I want to download a SWF file and load it in a MovieClip.
Once the
downloaded SWF is loaded in the MoviClip I want to adjust its
size to
the parent MovieClip. I also want to restore the child clip
to its
original size and to drag it inside the parent MovieClip
But it doesn't work:
http://www.tel.uva.es/personales/jpozdom/moviClipLoaderWithPreload.swf
http://www.tel.uva.es/personales/jpozdom/moviClipLoaderWithPreload.fla
Could you help me?
Thanks

blemmo escribi�:
> you can't change the properties before the clip is fully
loaded. You already
> have a listener for onLoadComplete, that's the right
place to change the size.
> Just place the restaurar() call before the play() call
in that event.
I tried it before submit the question but it doesn't work. If
I call
restaurar() just before the play() call in the onLoadComplete
then I
don't view the loaded clip in the window. You can test it if
you want.
I have fixed this using onClipEvent ( load ) in the
contenedor_mc
moviecliep. If I call restaurar() in this event it does work.
You can test that in this example:
http://www.tel.uva.es/personales/jpozdom/moviClipLoaderWithPreload.swf
http://www.tel.uva.es/personales/jpozdom/moviClipLoaderWithPreload.fla
Know I'm trying to make drag works...
Thanks

Similar Messages

  • Load and resize a SWF inside a MC

    Hi,
    I'm using AS2 to load an SWF inside an MC. The MC measures
    800x600, while the SWF (which can vary in size) measures in this
    case 14x60, even though, looking at it, it seems to be about half
    the size of the hosting MC. This makes me think that the dimension
    scales are different. I'm loading the SWF using MovieClipLoader and
    I'd like to resize it so that it fits as proportionally snug as
    possible within the MC. How can I do this? If I try to resize the
    SWF to the MC's dimensions, it become way too large and goes off
    screen. If instead I try to rescale the hosting MC to fit around
    the SWF, the SWF itself rescales as well. I'm going nuts! How can
    accomplish this?
    Thank you,
    Tatiana

    To make things simple, I'd like to take an existing SWF (the
    picture) and load it into a FIXED SIZED MC (the frame) and I'd like
    to rescale the SWF so that it fits perfectly into the frame.
    By all means, I know that what you said should work and I
    admit my inexperience with AS2, but somehow the SWF's I'm loading
    in, have scales that are totally different with respect to my
    Stage. I even tried loading the SWF directly onto the stage and
    then I loaded the frame separately onto the stage and tried to
    resize it to the SWF's _width and _height. The frame became a tiny
    dot on the screen, while the SWF filled half of my Stage.
    Thanks again for your help.

  • How to load and replace random swfs into same loader on stage?

    Hi...this is very simple, but, for some reason escapes me: using AS3 how can a swf load another swf to replace itself in the same loader on the stage, while simultaneously calling a randomizing function in the first frame of the main timeline, to randomize the next swf?
    At the end of each swf (called "koan_#.swf") there is the following old AS2 code...it was used to randomly select and then play a swf from koan array:
    _root.index++
    if(_root.index>_root.koan.length-1){
    _root.index=0;
    _root.koan.shuffle();
    _root.koan_loader_mc.loadMovie(_root.koan[_root.index]);
    This code on the first frame of the main timeline loads a random koan swf properly, but, after the koan plays I would like to load a new random koan swf.
    function shuffle(a:Array):Array {
    var len:Number = a.length-1;
    for (var ivar:Number = len; ivar>=0; ivar--) {
      var p:Number = Math.floor(Math.random()*(ivar+1));
      var t = a[ivar];
      a[ivar] = a[p];
      a[p] = t;
    return a;
    var index:uint = 0;
    var koan_loader:Loader = new Loader();
    var koan:Array =["swfs/koans/koan_1.swf","swfs/koans/koan_2.swf", "swfs/koans/koan_3.swf", "swfs/koans/koan_4.swf", "swfs/koans/koan_5.swf", "swfs/koans/koan_6.swf", "swfs/koans/koan_7.swf", "swfs/koans/koan_8.swf", "swfs/koans/koan_9.swf", "swfs/koans/koan_10.swf", "swfs/koans/koan_11.swf", "swfs/koans/koan_12.swf"];
    koan = shuffle(koan);
    koan_loader.load(new URLRequest(koan[index]));
    MovieClip(this).koan_loader_mc.addChild(koan_loader);
    Thank you very much.  I've tried multiple variations of updated AS2 code but am at my wits end. 

    Alright, the bloody forums won't attach the file for some reason, so here is the code:
    Copy and paste this code into a text file and save it as InterfaceEvent.as
    package {
         import flash.events.Event;
         public class InterfaceEvent extends Event {
              public static const KOAN_FINISHED:String = "koanFinished";
              public function InterfaceEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, index:int = -1, item:Object = null) {
                   super(type, bubbles, cancelable);
                   this.index = index;
                   this.item = item;
              public var index:int = -1;
              public var item:Object = null;
              override public function clone():Event {
                   return new InterfaceEvent(this.type, this.bubbles, this.cancelable, this.index, this.item);

  • How to load and unload same SWF with different xmlFilePath?

    I have a slideshow on my homepage and try to load and unload same instance with different xmlFilePath based on language on the same page.
    var flashvars = {
            xmlFilePath: escape("http://www.bodto.com.tr/kik.aspx"),
            xmlFileType: "OPML",
            lang: swfobject.getQueryParamValue("lang")    
            //initialURL: escape(document.location)   
          var params = {
            bgcolor: "#000000",  
            allowfullscreen: "true",
            wmode:"transparent",
            allowScriptAccess: "always"
          var attributes = {}
              swfobject.embedSWF("/swf/slideshowpro.swf", "flashcontent", "550", "400", "10.0.0", false, flashvars, params, attributes);
    Actionscript3
    var langPath = root.LoaderInfo.parameters["xmlFilePath"]+root.LoaderInfo.parameters["lang"];
    my_ssp.xmlFilePath = langPath;
    var fileType = root.LoaderInfo.parameters["xmlFileType"];
    my_ssp.xmlFileType = fileType;
    Based on above informations, how could I achieve it?

    Suddenly that code in the following gives me some error
    var langPath = root.LoaderInfo.parameters["xmlFilePath"]+root.LoaderInfo.parameters["lang"];
    my_ssp.xmlFilePath = langPath;
    var fileType = root.LoaderInfo.parameters["xmlFileType"];
    my_ssp.xmlFileType = fileType;
    Access of possibly undefined property LoaderInfo through a reference with static type flash.display:DisplayObject.
    The only code snippet works is
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (var param in paramObj) {
       if (param == "xmlFilePath") {
          my_ssp.xmlFilePath = paramObj[param];
       if (param == "xmlFileType") {
          my_ssp.xmlFileType = paramObj[param];

  • How to load and unload external .swfs in a main .fla then load another external .swf on top

    I know that the question sounds confusing. I am new to AS3 but a little dangerous with it.
    The project
    I'm putting together a website tour with has a main .fla with navigation buttons. The navigation buttons load external .swfs using X and Y properties. Every external .swf houses a scrubber bar, play pause buttons which calls to a movie clip which houses the animation.
    The problem:
    Everything was working great, until someone mentioned "Hey, what if at the end of each loaded external .swf, a button appears that says "go to next section".
    So basically we are trying to give the user another way to get to the next section in the left hand navigation once the animation ends, in addition to being able to click in the left hand navigation for the next section. It's kind of like when a youTube video ends and it displays a button to go to the next movie that's in line, but you can also do it in the thumnail navigation as well.
    Ok, let's try it. Well, after many nights, searching the web and trying everything I am waving the white flag. I went through the lynda.com book over and over but I get an error message when I add code related to the parent timeline. I can actually get the next section to load on top of the previously loaded .swf, but it's buggy and I think the previous section is showing through underneath. Plus the scrubber isn't really working right. Since every .swf has a scrubber to control it, shouldn't it just load on top of the previous .swf? Do I need to add coding related to the parent timeline?
    I don't know if I should paste my code here, I have a sample .fla too. Help is so greatly appreciated!!!! If this can work, I think it would be very useful for anyone else doing something like this - I would definitely share any knowledge gained!
    Thanks.
    Jen

    If you want to utilize that code as a starting point (hopefully you understand what it does, and that the code actually works), then you need to modify it such that the array at the start has your filenames instead of the three it now shows, and the three buttons it uses are changed to the next and previous buttons you intend to use.  Here are the functions you need to make adjustments to...
    function onCompletePreloading():void {
            _loadedSWFs = 0;
            contentContainer.addChild(_swfClipsArr[_loadedSWFs]);
            next_btn.addEventListener(MouseEvent.CLICK, setContent);
            prev_btn.addEventListener(MouseEvent.CLICK, setContent);
    function setContent(event:MouseEvent):void {
            var _swfToAdd:MovieClip;
            if(event.currentTarget.name == "next_btn") {
                _loadedSWFs += 1;
                if(_loadedSWFs == _swfClipsArr.length){
                       _loadedSWFs = 0;
            } else if(event.currentTarget.name == "prev_btn"){
                _loadedSWFs -= 1;
                if(_loadedSWFs == -1){
                       _loadedSWFs = _swfClipsArr.length-1;
            _swfToAdd = _swfClipsArr[_loadedSWFs];
            contentContainer.removeChildAt(contentContainer.numChildren-1);
            contentContainer.addChild(_swfToAdd);
            trace(_swfToAdd.customID);

  • How to load and unload more than one external swf files in different frames?

    I do not have much experience on Adobe Flash or Action Script 3, but I know the basics.
    I am Arabic language teacher, and I design an application to teach Arabic, I just would like to learn how to load and unload more than one external swf files in different frames.
    Thanks

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • How to load and unload Multiple External SWF

    hello there,
    i need help to figuring out how to load and also unload(removing) multiple external SWF.
    so here is what i;m trying to do,
    i want to load multiple external SWF and play it on my main SWF now i hove no problem with just loading multiple SWF and placing it in the display list .The problem came up when i tried removing those loaded SWF from the display list ,The problem exist because i have no way to refer to what i have loaded and placed on the display list,
    i used a single loader instance to load all that external swf,
    i do know that we have to remove all the event listener related to the external SWF that we want to remove and for this purpose i have crated a function called destroy which the main objective for this function is to remove all event listener inside the swf and also isolating all variable so it would be eligible for garbage collecting, here is what the code look like:
    // Create this in every object you use
    public function destroy():void
         // Remove event listeners
         // Remove anything in the display list
         // Clear the references to other objects, so it gets totally isolated
    sorry it just a kind of pseudocode cause this function will customize with it's own property i did this just for the purpose of simplicity and easy understanding..,
    so now back to main problem how should i solve this problem??
    i tried used an arraf to save all the loaded swf
         the array is just used to save the what the loader is loading but the adding to display method is using
    movieClipActAsContainer.addChild(e.target.content); //the event is from the Event.COMPLETE
    but i have a hard time using that arrya back and matching it to the one i got from the display list.
    please do help me,
    any suggestion would be greatly appreciated,
    and if can pleas show me a source code or pseudocode of what you're suggesting to me cause my english is not so fluent yet,
    thanks before.

    Hey EI,
    I had done this kind of project recently and for loading and unloading different swfs. I had used loaders specific to that filename and for removing I had used a single movieclip instance name and on clicking that specific loader request name that needs to be removed will be requested from the specific function. As mentioned below
    Loading SWF:
    ===============================
    swfLoaderIndia.load(swfRequestIndia);//This will load the request
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).addChild(swfLoaderIndia);//This will load swf on stage
    or else
    Stage.addChild(swfLoaderIndia);
    Unloading SWF
    =====================================
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).removeChild(swfLoaderIndia);//This will unload swf on stage
    or else
    Stage.removeChild(swfLoaderIndia);
    Above code will be in specific function which will be requested when the loading and unloading is required.
    I hope this helps you in your project.
    With Regards,
    Sagar S. Ranpise

  • How to load and instantiate FXG at runtime?

    Hi
    Let's say I have a Flex 4 app whose SWF size in KB/MB should be small. While the app runs, the user might want to make the app load 10 of 1000 FXG components that are available. How to load and instantiate these 10 FXG components?
    (I want to avoid compiling an SWF that would contain 1000 FXG components and thus would be large in file size.)
    Here are snippets from an example which can instantiate FXG components, but would probably be too large in SWF size if would contain all the FXG components.
    fxgstuff/rect.fxg and fxgstuff/circle.fxg contain this:
    <fxg:Graphic xmlns:fxg="http://ns.adobe.com/fxg/2008" version="1">  
       <fxg:Group>
    Snippets from the main MXML file:
      import fxgstuff.*;
      import spark.core.SpriteVisualElement;
      public function addRect():void {
        var _rect:SpriteVisualElement = new rect;
        _rect.x = _x_rect;
        _rect.y = _y_rect;
        container.addElement(_rect);
      public function addCircle():void {
      <s:Button label="Add rectangle" click="addRect()"/>
      <s:Button label="Add circle" click="addCircle()"/>
      <s:Group id="container"/>
    Tobi

    You put each graphic into a MXML Module (not MXML Component) which stays on the server and is loaded at runtime when you request it, as in:
    // >>>>>  Imports  <<<<<
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequest;
    import mx.events.ModuleEvent;
    import mx.modules.IModuleInfo;
    import mx.modules.ModuleManager;
    // >>>>>  Variable Declarations  <<<<<
    private var urlLdl:URLLoader;
    private var modInfo:IModuleInfo;
    private var oneGraphicsModule:Object;
    // >>>>>  Methods  <<<<<
    private function moduleLoader( pathToModule:String ):void
      // Loading one Module
      modInfo = ModuleManager.getModule( pathToModule );
      urlLdl = new URLLoader(  );
      urlLdl.dataFormat = URLLoaderDataFormat.BINARY;
      urlLdl.addEventListener( Event.COMPLETE, bytesLoadedHandler );
      urlLdl.load( new URLRequest( pathToModule ) );
    private function bytesLoadedHandler( event:Event ):void
      modInfo.addEventListener( ModuleEvent.READY, moduleLoadedHandler );
      modInfo.load( null, null, event.target.data );
    private function moduleLoadedHandler( event:ModuleEvent ):void
      oneGraphicsModule = modInfo.factory.create();
      // Do with the module what you need to . . .
    So all of your graphics stay on the server, you "just" need to put each graphic or group of graphics into a MXML Module.
    David

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • How to load the google map into an empty movieclip

    how to load the google map into an empty movieclip ?  Thank you

    if you're using as3, check the google maps api for flash.  if you're using as2, check the google maps api for javascript and use the externalinterface class in flash.

  • How to load and show PDF on stage in Flash using AlivePDF or PurePDF external libraries?

    Hello,
    I searched a lot on internet but didn't find a proper way to load and open/show PDF on stage in Flash. Following are my understandings about this topic.
    I know Flash does not have the built-in functionality to load and show pdf document on stage.
    I know you can do this in AIR application using HTMLLoader class but it required adove reader to be installed on your machine.
    I have used AlivePDF/PurePDF and I know how to export/generate a PDF File using these libraries but I don't know how to use them to load and show PDF document on stage in Flash. According to my research, I think these libraries can accomplish my task but how, I don't know. That's because I am here for your help.
    People suggest to first convert pdf into an image or swf file and then import it into Flash but I don't want this solution because my clients will be importing/uplading PDF file into my software.
    Some people suggest to "Convert PDF renderer code written in C/C++ using Alchemy to flash library" and then use that library to my project. I don't have any idea how to do this. If anyone can help me to achieve required functionality this way, please guide me.
    Now you know about my understandings, so you can guide me in better way. Let me give you an example what kind of functionality I want. Please visit: https://www.pdffiller.com. Upload a pdf file there and you will see that it shows that pdf to user (At the moment, I want this functionality) and pdf annotation i.e. write text on pdf and other functionalities.
    NOTE: I am not a Flex and AIR developer. I am a Flash (Actionscript 3.0) Developer. So please first help according to flash. If you want to offer the solution according to Flex and AIR, you are most welcome.
    I specially want "ADOBE EXPERTS - Adobe Flash developer from Adobe" to comment on this and help me out. It's about 4th day I am without a solution. I am afraid, I'll loose my client if I'll not have a solution in next couple of days.
    Thanks,
    momersaleem
    eLearning Specialist

    Just to throw in a $0.02, I looked at those libraries myself quite a while ago and all they had the ability to do was give you information and assets from the PDF. At that point you literally had to read each page in the PDF (whatever the library could extract), use the information it extracted (position, type size, images, etc) and create a layout engine that could "reconstruct" the page piece by piece.
    I hope it's better these days but that's what I took from those libraries quite a while ago and it may still be true. That would explain "Convert PDF renderer code written in c/c++ using Alchemy to flash library". Someone may already have written a quality layout engine. Otherwise there was no "load pdf, run this ShowPDF() function to add to display list" functionality at all.

  • How to load the xml from swf

    Hi,
    I have one intro.swf from that am loading one interface.swf by using loader.In interface i am loading some of the swf and xml am getting the swf but the xml files are not loading.When i run from interface file it is loading fine. only when i load the intro file the xml files are not loading. can any one tell me what is the problem how to access the xml content.
    This is the code am using in interface.swf to to get the xmlpath
    MovieClip(root).param1 = xmlPath;
    to access the xml content i have written the code
    var xmlPath:String=MovieClip(stage.getChildAt(0)).param1;
    I am using one moviclip in interface to load the other swf and xml. I am not using any moviclip in intro file to load the interface swf for that i am using only the loader.

    Where are the files located relative to each other?  If the intro and interface are in different folders then the problem could be that you need to adjust the path the interface uses for targeting the files it loads.

  • Loading and modifying a SWF file within an AIR application

    I bet you get this question a lot, but I was wondering, if possible, anyone knows how to edit and save the changes to a SWF file loaded inside an AIR application?
    Thanks in advance!

    I'm sorry, but I happen to digress greatly with Michael's approach. I started using AIR  just yesterday ( 3 hours or so ), and I firmly believe in reinventing the wheel as a strong method of learning. Just to be clear, I do this on my own free time, so I have no need to worry about COGs, after all, I'm just learning. Otherwise, though it's a strong and great response if I were to build a somewhat bigger application, it's way too much more than the original scope of the application. It's like using a bazooka to kill ants . Regarding the scope of the application, it should support loading / writing of SWFs, and editing of XMLs for certain pre-defined entities. As I stated already, I am certain that I'd be able to do this in a very short span of time with another approach (more xmls, embedding assets directly to the SWF that loads the edited swf, etc.) It's more of a challenge to myself than anything else . I'm really grateful for all your help, so if you want, I can keep you up to date on how I deal with the issue.

  • Problem with loading and unloading external swfs

    Hello Forum,
    I'm pretty new to as3, and it's giving me a great challenge. I have a large number of captivate files that I want to play inside a simple container built in CS5.5... but switching back and forth between all the movies hogs the memory like crazy, so I need something to clean it up. All code is in a single frame on the main timeline. First, I create the loader:
    var FlashLoader:Loader = new Loader();
    var flashUrl:URLRequest = new URLRequest("placeholder.swf");
    FlashLoader.load(flashUrl);
    addChild(FlashLoader);
    The actual movies are located via an XML... but as I said the memory problem is huge, so I tried to build something to get rid of that. Ideally, I want the loader to clean up everything and start life anew with a single mouse click, like so:
    function _mouseClickHandler2(event:MouseEvent):void {
              FlashLoader.unloadAndStop();
              FlashLoader.parent.removeChild(FlashLoader);
              FlashLoader = null;
              var flashUrl:URLRequest = new URLRequest(event.target.href);
              var FlashLoader:Loader = new Loader();
              addChild(FlashLoader);
              FlashLoader.load(flashUrl);
              FlashLoader.x = 120;
              setChildIndex(FlashLoader,0);
              trace(FlashLoader.parent.numChildren);
    //          System.gc();
    //          System.gc();
    //          try {
    //                    new LocalConnection  .connect('gc');
    //                    new LocalConnection  .connect('gc');
    //          } catch (e: * ) {
    //          trace(getMemory ());
    //trace(event.target.href);
    //trace(event.target.text);
    Upon clicking on the menu (and thus switching movies), I get the following error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at Treeview_working_fla::MainTimeline/_mouseClickHandler2()
    And this doesn't make sense to me. The FlashLoader is given a placeholder swf at the beginning, so why would the FlashLoader inside the function be recognized as having a null object reference?
    Thanks in advance

    In my quest to tackle this problem, I've decided to try and isolate the problem, and have made a simple "click to load, click to unload" when I stumbled upon a curious problem. The movie loads fine, and the UNLOAD function upon mouseclick also works perfectly. However, upon clicking again to activate RELOAD, it gives the error "No active security context" and refuses to load the same exact swf with the same exact path that successfully loaded the first time!
    import flash.events.MouseEvent;
    import flash.display.Loader;
    import flash.net.URLRequest;
    var FlashLoader:Loader = new Loader();
    var flashUrl:URLRequest = new URLRequest("folder/subfolder/movie.swf");
    FlashLoader.x = 120;
    FlashLoader.load(flashUrl);
    stage.addChild(FlashLoader);
    stage.addEventListener(MouseEvent.CLICK, UNLOAD);
    function UNLOAD(event:MouseEvent) {
              flashUrl = null;
              stage.removeChild(FlashLoader);
              FlashLoader.unloadAndStop();
              stage.removeEventListener(MouseEvent.CLICK, UNLOAD);
              stage.addEventListener(MouseEvent.CLICK, RELOAD);
    function RELOAD(event:MouseEvent) {
              var FlashLoader:Loader = new Loader();
              var flashUrl:URLRequest = new URLRequest("folder/subfolder/movie.swf");
              FlashLoader.x = 120;
              FlashLoader.load(flashUrl);
              stage.addChild(FlashLoader);
              stage.removeEventListener(MouseEvent.CLICK, RELOAD);
              stage.addEventListener(MouseEvent.CLICK, UNLOAD);

  • Need help loading and positioning a swf into a swf

    This is the swf  I'm trying to load.
    These actions load and position a small simple swf just fine and the trace in the onLoadProgress function indicates that it loads completely
    but I can't see it.  What am I doing wrong?
    this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
    var my_listener:Object = new Object();
    my_listener.onLoadComplete = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    my_listener.onLoadProgress = function(target_mc:MovieClip) {
    trace(target_mc.getBytesLoaded() + " out of " + target_mc.getBytesTotal());
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    //my_loader.loadClip("little.swf", container_mc);
    my_loader.loadClip("cam01.swf", container_mc);

    do you see a rotated swf if you use:
    this.createEmptyMovieClip("container_mc", 1);
    var my_listener:Object = new Object();
    my_listener.onLoadInit = function(target_mc:MovieClip) {
    target_mc._x = 150;
    target_mc._y = 100;
    target_mc._rotation = 22;
    var my_loader:MovieClipLoader = new MovieClipLoader();
    my_loader.addListener(my_listener);
    my_loader.loadClip("cam01.swf", container_mc);
    if yes, either:
    1.  you are repositioning your swf and for some reason don't recognize that or
    2.  you're changing container_mc or one of its parents _x,_y properties elsewhere.

Maybe you are looking for

  • BT Infinity Noise/Speed questions

    Is my noise margin good or bad? 1. Product name: BT Home Hub 2. Serial number: +068543+NQ42955553 3. Firmware version: Software version 4.7.5.1.83.8.173.1.6 (Type A) Last updated Unknown 4. Board version: BT Hub 5A 5. VDSL uptime: 0 days, 19:59:25 6.

  • How to Duplicate a Page in Wiki Server 3

    I have just set up a Mac Mini Lion Server to use as a staff information portal / intranet. I would like to use the wiki to keep our standard procedures up to date and all in one place. Is there any way to set up a page template in Wiki Server? All th

  • How to delete only events I previously imported from .ics files?

    I have a very frustrating problem. A few months ago I added a few .ics calendars and merged them with my main calendar on iCal. For example I added a list of dates of baseball games for my favorite team, a list of holidays in Britain, and a few other

  • Signing on to Business Catalyst is timing out

    I have not used my Creative Cloud allotment of Business Catalyst testing sites in a while, and I want to manage them - remove unused ones and add anew site that I am testing. I don't know where to do that or how to sign on to that. Also when I just h

  • Deleting Photos in Bridge

    When I open Bridge I see 100's of thumbnails from previous sessions.  There are so many that it makes working with Bridge very cumbersome.  How can I get rid of these just in Bridge without actually deleting them from my computer?