Loading an external SWF in and displaying it behind overlay/watermark

I am building a SWF and the goal is to load in an external SWF file and then display that within my container. They are totally unrelated items and I do not want to modify the functionality of the item I am loading in. My SWF will briefly display a watermark overlay, but then disappear. Can anyone guide me into this best way of doing this?
Also, is there anyway to get the properties from the SWF I loaded in (namely height and width) so I might be able to easily adjust the size of my SWF to match?
Thanks!

just load your external swf using the loader class.  what you described doing is standard stuff and nothing special needs to be done.
however, you must wait until loading is complete before you can access the loaded object's width and height.

Similar Messages

  • Loading an external swf that loads an object from url

    i am trying to load an external swf that in turn automatically loads an object. i want the external swf to only be loaded once the object is loaded in it. right now it loads the external swf first and then the external swf loads the object specified at a url...

    thanks kglad. i think i need to try and load the external swf, wait for it to load its object, and then display it... will look into it and get back...

  • AS2 mc loads 1 external swf from group depending on cookies and .html location

    I am attempting to load an external swf banner into an empty movieclip (main.fla for argument), which seems straightforward enough. But the idea is that each .swf (banner) is a link to its own respective html page. I.E. bannerA.swf links to pageA.html etc.
    The first problem is that I dont want main.fla to display bannerA.swf on pageA.html since the user will already be on pageA. So I need main.fla to recognize the .html page that the user is currently on (I have to do this in one flash file, otherwise I would make 4 which exclude the banner for its own page– though, if this would greatly reduce headache, I might be able to talk the powers that be into it).
    Secondly, I need main.fla to remember which banner (or banners) the user has seen on previous visits to a page so that the banners will rotate with each consecutive visit.
    Im guessing this can be implemented with an array and some listeners, but Im no AS2 guru. Any help would be more than appreciated.
    Thank You,
    Ryan

    Oh, I know I am sorry about that! I have been fiddling around
    and updating that version... I changed it to be a pop-up after I
    posted the question because in the forum for where I purchased the
    main layout template, a lot of people had written in saying that
    they could not get any gallery features to work with the buttons...
    so its something in the main page code, I don't know what.. but I
    am a bit eager to get the site up so I reverted to a pop-up for
    now...

  • Loading an external swf and unloading the parent one

    Hi there i have made a navigation in flash and 3 buttons that load some external swf's. Problem is that when they load the parent swf keeps playing in the background. How can i make them play separately and make the navigation stage dissapear completely when they load?

    I have attempted to use the same Loader but it doesnt replace it i dont know why.
    var myLoader:Loader = new Loader();       
    var myLoaderMain:URLRequest = new URLRequest("main1.swf");
    var myLoaderQuiz:URLRequest = new URLRequest("quiz.swf");
    var myLoaderAnimation:URLRequest = new URLRequest("athens_animation.swf");
    var myLoaderVideo:URLRequest = new URLRequest("videogallery.swf");
    videogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);
    function videoFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderVideo);
              addChild(myLoader);
    Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);
    function quizFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderQuiz);
              addChild(myLoader);
    Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);
    function AnimationFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderAnimation);
              addChild(myLoader);

  • Loading external SWF fila and accessing variables/functions

    Hello everybody!
    My first post here. Actually I do search google for answers all the time, but now - it's tough one.
    public function loadScreen(swf:File):void {
         _content = swf;
         var swfBytes:ByteArray = new ByteArray();
         var file:File = _content;  
         var loadStream:FileStream = new FileStream();
              loadStream.open( file, FileMode.READ );
              loadStream.readBytes( swfBytes );
              loadStream.close();
         var loader:Loader = new Loader();
         var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
              loaderContext.allowLoadBytesCodeExecution = true;
              loader.loadBytes( swfBytes, loaderContext);
              loader.contentLoaderInfo.addEventListener(Event.INIT, accessSWF);
              loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
    public function errorHandler(e:Event):void {
         trace("PROBLEM LOADING BYTES");
    public function accessSWF(e:Event):void {
         var moduleLoader:LoaderInfo = LoaderInfo(e.target);
         moduleLoader.content.addEventListener(Event.INIT, readyHandler);
    public function readyHandler(e:Event):void {
         _initOptions = new NativeWindowInitOptions();
         with(_initOptions) {
              resizable = true;
              transparent = false;
         var boundsWin:Rectangle = new Rectangle(100, 100, 423, 430);
         _window = new NativeWindow(_initOptions);
         with(_window) {
              activate();
              bounds = boundsWin;
              stage.scaleMode = "noScale";
    The problem is that application loads the external swf with loadBytes, but it's not executing the script. Actually, I'm not able to use the loaded swf. I'm not able even to add it to Stage. But message in output still shows, that the swf file is loaded "[SWF] file.swf/[[DYNAMIC]]/1 - 2746 bytes after decompression"
    There are many solutions for this problem on the internet, but they're old (written in 2008 most of all) and not working either, because those solutions work only in older AIR versions
    Any help?

    Well I got a bit further:
    public function loadScreen(swf:File):void {
         var loadStream:FileStream = new FileStream();
         with(loadStream) {
              openAsync( swf, FileMode.READ );
              addEventListener(ProgressEvent.PROGRESS, loadProgress);
              addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
              addEventListener(Event.COMPLETE, loadComplete);
    public function loadProgress(e:ProgressEvent):void {
         trace("Loading " + e.target.bytesAvailable);
    public function errorHandler(e:IOErrorEvent):void {
         trace("Error ");
    public function loadComplete(e:Event):void {
         var swfBytes:ByteArray = new ByteArray();
         FileStream(e.target).readBytes( swfBytes );
         var loaderContext:LoaderContext = new LoaderContext();
         with(loaderContext) {
              allowLoadBytesCodeExecution = true;
         var loader:Loader = new Loader();
         with(loader) {
              loadBytes( swfBytes, loaderContext);
              contentLoaderInfo.addEventListener(Event.INIT, completedSWF);
    public function completedSWF(e:Event):void {
         var moduleLoader:LoaderInfo = LoaderInfo(e.target);
         moduleLoader.addEventListener(Event.COMPLETE, initiatedFinally);
    public function initiatedFinally(e:Event):void {
         _initOptions = new NativeWindowInitOptions();
         with(_initOptions) {
              resizable = true;
              transparent = false;
         var boundsWin:Rectangle = new Rectangle(100, 100, 423, 430);
         _window = new NativeWindow(_initOptions);
         with(_window) {
              activate();
              bounds = boundsWin;
              stage.scaleMode = "noScale";
         var loader:Loader = e.target.loader;
         loader.addEventListener(Event.ADDED_TO_STAGE, irAdded);
         _window.stage.addChild(loader);
    public function irAdded(e:Event):void {
         trace(e.target.content.vars); // Object Dictionary
    At this point ( function irAdded ) I'm able to retrieve external SWF's variables. But stil, it's not visible on the stage. And yet - there's another problem - rendering the same script , every second time application unloads the external swf movie.

  • What is or isn't possible on iOS?  (Not having Loader, loadBytes(), external swfs, etc)

    My basic question is:  "What are the classes which we should not use for iOS using the packager."
    I have been trying for a few days trying to get a simple Flash app to run on the iPad.  A very simple app (with sound!) with just 2 classes works fine (Performance is a whole other issue.  We will get to that).  But if I try anything else, all I get is a white/black screen on the iPad.  So it would be really nice to know what classes, functions, etc we CANNOT use for the Packager.
    I have fairly simple app (not as simple as 2 classes) which loads some art assets via URLRequest/Loader, puts them on the stage.  Fairly common standard practice in AS3.
    I've read about not able to load an external file using the Packager.  So to fix the situation of loading assets, I have looked into the [embed] tag, which seems to work.  I hope the blogger doesn't mind, but this page is an excellent source on what works and doesn't work with the [embed] tag in it's various flavors:  http://www.richardleggett.co.uk/blog/index.php/2010/03/08/flash_builder_and_flash_pro_asse t_workflows.  For example, AS3 in a swf is stripped out from an external swf using [embed].
    The best way to load an external swf file for iOS seems to be using [embed] with "application/octet-stream" and load the swf through ByteArray (Option #4 in the link above).  This works great on the PC.  HOWEVER, on iPad, it fails.  The [embed] tag works on the iPad with the other ways, so my guess is that loadBytes() does not work.  Is this true Adobe/Flash guys?  Can you confirm this?
    My initial question is "why is this not allowed on iOS?".  If it is because of the fact that it uses a Loader, can it be changed so it's not using a Loader to construct a MovieClip?  I have a ByteArray with the raw swf/MovieClip data.  Why can't I construct a MovieClip from it without going through Loader?
    This loadBytes() failure seems to be the only thing preventing me from using the normal pipeline of Flash development in loading external assets.  If there are other ways people have found, please share!
    Now on to performance.  Adobe, can you post some examples/samples of code which runs at decent performance?  Like a "tech demo" of what is possible using the Packager running on iPad/iPhone.  That would be extremely helpful for everyone.  I have done a lot of the optimizing suggestions on various sites and pages ( and by Adobe http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html), but I am not seeing the 30 fps performance that is MORE than possible on iPhone/iPad.  Displaying and moving around Bitmaps (I don't use any vector graphics) should be blazing fast.  Quake runs on iPad without any problems and that code is 10 years old.  Moore's law dictates that drawing Bitmaps using CPU should be faster than a 3D engine written 10 years ago...  I am trying out the new iOS 4.2 which is supposed to be "significantly" better, but I am still stuck on loadBytes().
    So at this point, I am blocked on loadBytes() and my performance for a simple app which draws a few Bitmaps and MovieClips is terrible.  I am hopeful some people out there have figured out some solution (there are lots of clever people out there) and I will stumble on to something.  But being forced to go native Objective-C seems to be my only option at this point.
    In summary, here are the questions I would like to ask the Adobe/Flash group for some more help/information/advise:
    - Why is Loader not allowed on iOS?  Is it a technical limitation of the hardware/os/Flash?  Will it never be supported?  What is the future of this class on iOS?
    - Why is loadBytes() not allowed on iOS?  I have the raw embedded data in memory.  I don't need to make a remote call so security should not be an issue.  Can I create a MovieClip without using Loader?
    - Why is AS3 stripped from the timeline when a Symbol is retrieved using [embed]?  Maybe this is the same reason loadBytes() fails, but if I could use [embed] and get a copy of the Symbol, that is what I need.  (There are issues with the mx.core.MovieClipLoaderAsset/Asset, but it is better than being blocked by loadBytes())
    - What are some apps you guys have written that we can use to compare PC vs iOS?  Again, a "tech demo" or sample code of what you as experts in Packager for iOS have done which runs at decent framerate (30+fps) would be of tremendous help.  If the Adobe/Flash group hasn't gotten the current Packager for iOS to handle more than 50+ 2D Bitmaps on screen running at 30+fps, that would be good to know.  Please let us know what the experts and owners of your software are capable of getting the most throughput using the Packager.  I'd hate to sound a bit fed up/angry, but I think you are wasting a lot of people's time and energy with a piece of software that, to me, seems like it was a bit early to release.  Flash can do some great things.  If it can do it on iOS, even better.  But PROVE it to us that it's possible, before having your customers run into barriers imposed on us by trial and error.
    Thanks.

    I have hardly ever seen a post here from someone at Adobe, so you may need to be patient.
    Read this article, and get its associated demo files, to see some good performing tech demos:
    http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
    Back to your main point, loaders are working, what isn't working for you is accessing of things in the library of a successfully loaded swf, that have been set to Export for ActionScript. That means that the swf you have loaded has an ActionScript Class, to represent the library symbol. iOS Flash apps are native ARM code, and don't include the virtual machines that a browser plugin has, and so it's not able to interpret ActionScript. That may be why it would fail.
    Now, I can think of at least a couple of reasons why you might want to have external swfs with elements that you want to reuse in the main swf. One would be if you're intending to make a lot of them, like say if you wanted to have an Asteroids game and the ability to use artwork from a set of different swfs. Another reason might be if you want to skin your interface, by taking specific elements from the loaded swf and using them in the main swf. That way you could have artists preparing those swfs for you, and you just include them in your package, and load the one you want.
    There is a way to do either of those things. The second one can be done by having the item as a named symbol on the stage of the loaded swf. With a to-be-loaded swf named "inner.swf", that has a movieclip on its stage named "mc1", this script in the main swf would load that external swf and use its symbol on the main swf's stage, without having to make the inner swf's symbol use ActionScript:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    For the other case, you can take the item off the stage of the loaded swf and draw it into a bitmapdata, and then make as many bitmaps from that as you like. Here's the above example, only it adds the original movieclip to the main swf stage, and also creates a bitmap that looks the same:
    var req:URLRequest = new URLRequest("inner.swf");
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,loaded);
    ldr.load(req);
    function loaded(e:Event) {
    var mc:MovieClip = e.target.content as MovieClip;
    var innermc:* = mc.mc1;
    innermc.x = 50;
    innermc.y = 50;
    addChild(innermc);
    var bmd:BitmapData = new BitmapData(innermc.width,innermc.height);
    bmd.draw(innermc);
    var bm:Bitmap = new Bitmap(bmd);
    bm.x = 150;
    bm.y = 150;
    addChild(bm);
    So, the thing to learn is that a native ARM code application does not have an ActionScript interpreter in it, and if you need to do something that normally requires interpreting ActionScript, find another way to do it.

  • FAQ: How do I load an external SWF file into a parent SWF file?

    A ton of Flash users visit Adobe’s we site every month wondering  about how to load an external SWF file from within another SWF.
    Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
    How do I load more than one SWF?
    How do I load a SWF into a specific location in the display list?
    How do I resize the loaded SWF?
    How do I set its X and Y location?
    Here are some additional resources that elaborate on loading content and on working with the display list:
    Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
    Help > AS3 Developer’s Guide > Loading an external SWF file
    Help > AS3 Developer’s Guide > Loading display content dynamically
    Loading multiple external SWFs within a main SWF – CreativeCow.net forums
    Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
    Video tutorial: Preloading in ActionScript 3.0.  By Lee Brimelow. A slightly more complicated example, showing how to  make the parent SWF display information about the progress of loading  the external SWF.
    Tutorial: Loading and unloading SWFs - FlashAndMath.com
    This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
    SWF to SWF Communcation via ActionScript 3.0 (by kglad)

    quote:
    Originally posted by:
    NedWebs
    You now seem to want to get rid of the swf once it has loaded
    and played itself thru. To do that you would need to have something
    in the swf itself that triggers its removal in its last frame. The
    following might work...
    MovieClip(this.parent).removeChild(this);
    Unfortunately I couldn't get this to work. I placed it on the
    last frame of the SWF to be called - is that right?
    I am not sure I am doing it correctly...

  • Why have I an error when I load an external .swf?

    Hello, everybody...
    I have this error message when I try to load an external .swf into my .swf:
    *** Violazione della sicurezza sandbox ***
    SecurityDomain 'http://192.168.1.2/fms3/Logopedia/AnalisiVisiva.swf' ha cercato di accedere a un contesto incompatibile 'file:///C|/Documents%20and%20Settings/TOSHIBA%20SATELLITE/Desktop/Tesi%20Magistrale/Prog etti/VideoComm/VideoComm.swf'
    SecurityError: Error #2070: Violazione della sicurezza sandbox: il chiamante http://192.168.1.2/fms3/Logopedia/AnalisiVisiva.swf non può accedere allo stage appartenente a file:///C|/Documents%20and%20Settings/TOSHIBA%20SATELLITE/Desktop/Tesi%20Magistrale/Proge tti/VideoComm/VideoComm.swf.
        at flash.display::Stage/requireOwnerPermissions()
        at flash.display::Stage/addEventListener()
        at fl.core::UIComponent/callLater()
        at fl.core::UIComponent/invalidate()
        at fl.controls::BaseButton/setMouseState()
        at fl.controls::BaseButton/mouseEventHandler()
    My external .swf is a project that write on a server side text file the words that I write into textInput on client side. So I have an .asc file.
    I use an Apache Web Server and FMS3.
    Can someone helps me? Please.
    Emiliano.

    Hi gymtrainger55,
    When having iTunes Store connectivity issues, the following articles provide the best solutions:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Thanks,
    Matt M.

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • Need help loading an external SWF

    I'm not very proficient in Flash, so any help will be greatly appreciated. I'm trying to load an external SWF with the following code:
    T1_Bttn_BloodCar.onRelease = function() {
    t1_images_mc.loadMovie("images/T1_Gallery/BloodCar_SWF/T1_BloodCar.swf");
    t1_images_mc._alpha = 0;
    It loads the SWF, but doesn't play it correctly when I test it. Here's how the loaded movie is supposed to look:
    http://www.theroboteye.com/T1_BloodCar.html
    But instead, it plays without the transitions, like this:
    http://www.theroboteye.com/TRE2009b.html
    I've been trying to figure this out for a few days and have tried adding "this._lockroot = true;" to the SWF I'm trying to load, but I can't get it to play correctly. Can anyone tell me what I'm doing wrong? Thanks in advance.

    Try using the MovieClipLoader class (loadClip method) instead of the loadMovie method.  That way you can have a listener that waits for the movie to be loaded and then pull it into play, assigning actions and properties to it after the fact.

  • Loading an external swf with a loader

    I have a .swf that loads different external swf's into
    loaders based on what frame it is in. For all but one frame this
    works fine. There's no lag, they load quickly and can be interacted
    with with no problem. But, for one .swf it gets really choppy. The
    swf itself runs fine but once it is loaded into another swf through
    the loader the performance really goes down the drain. I guess I am
    wondering if anyone has any suggestions or perhaps different
    methods I should try. Thanks in advance.

    It isn't creating it on the fly.
    Insert a new symbol and give it the instance name
    placeholder_mc. Drag that onto your timeline and scale it so that
    it is the exact same size as your external swf. Then just align the
    empty movie clip on the stage where you want to align the external
    swf.
    loadMovie("external.swf",_root.placeholder_mc);
    This just tells it "Okay, take this external flash file, and
    stick it INTO that empty movieclip"

  • Loading an external SWF from an external SWF

    Hello,
    I'm somewhat caught between a rock and a hard spot on a flash
    site project. Here is the situation:
    I have created a parent movie (which loads all external SWFs
    inside of it) that has the menu navigation built into it. However,
    my client wants me to place some more links inside of the external
    SWFs that lead to other pages (external SWFs) of the site. Is this
    at all possible? I was hoping there is a way to tell a button in an
    external SWF to make the parent movie switch between external SWFs.
    Any and ALL help is very much appreciated. Thank you.
    Another question: does this involve using the _parent script?
    Elijah

    Hello,
    Thank you for replying. Here is exactly what I'm needing to
    do:
    We will call the parent file "index.swf". Inside "index.swf"
    I have a "holder" for external swf files to load into when I call
    on them from the main menu buttons on "index.swf". When a customer
    comes to the site, the "index.swf" file initially loads
    "welcome.swf". Inside of "welcome.swf", I have some images that I
    want to make into links to other external swf files.
    My problem is when someone clicks on one of those pictures I
    want the "index.swf" file to open up the corresponding external swf
    file in its "holder", where "welcome.swf" currently resides. Also,
    all of these swf files ("index.swf" included) have stand-alone FLA
    files, none are attached to one another. I have never worked with
    "levels" before, would that be necessary in this case? I have
    attached the code for the external swf loader.
    I hope that gives you a better idea of what I'm trying to
    accomplish.
    Thanks again.
    Elijah
    CODE:

  • Loading an external .swf then referencing to it's label

    I'm new with Actionscript and am currently working at
    building a website. I've got a lot figured out so far but one
    problem I'm running into is when I try to load an external .swf
    using the loader component and then reference it or try to point to
    it within my main .swf I can only load the "gallery.swf." through
    myLoader.contentPath = "gallery.swf";
    I'm trying to load it and then point to a specific label so
    it loads that frame or label. I've created separate labels for each
    image in my gallery so that when I point to them with AS, it knows
    which image to load. It worked when I had the gallery in the main
    .swf but when I used the loader component it didn't work.
    The AS I used that worked before I made a separate .swf and
    used a loader was:
    on(release) {
    _parent._parent._parent.photos_MC.gotoAndPlay("img1");
    what I thought would work was:
    on(release){
    _parent._parent._parent.myLoader.contentPath =
    gallery.swf.photos_MC.gotoAndPlay("img1");
    I'm probably totally off, but if anyone could help out I
    would appreciate it!

    This looks like AS2 code, you may want to post there.
    Assuming this is AS2 code, the contentPath of the Loader specifies
    the url to load. Once the swf is loaded, you can then gotoAndPlay()
    to the label you want.
    Hope that helps.

  • Loading an external swf with coordinates

    I am using a simple loadMovieNum("movie2.swf",1); to load an
    external swf into my current swf (movie1). I would like to position
    movie2.swf within movie1. I'm sure I need to convey the x,y
    coordinates, but I am not sure where to start. Any help would be
    appreciated.

    It isn't creating it on the fly.
    Insert a new symbol and give it the instance name
    placeholder_mc. Drag that onto your timeline and scale it so that
    it is the exact same size as your external swf. Then just align the
    empty movie clip on the stage where you want to align the external
    swf.
    loadMovie("external.swf",_root.placeholder_mc);
    This just tells it "Okay, take this external flash file, and
    stick it INTO that empty movieclip"

  • Loading an external swf as a different size?

    Hello - this seems like it would be pretty easy, but I couldn't figure it out from searching through Flash's help documentation.
    I'm using Flash CS3 and AS2.0.  I'm using the loadMovie function to load an external swf into an empty movieclip.  The problem is that the external swf is bigger than the frame I am loading it into, so I'd like to load it in with specific width/height parameters (basically load it in and scale it down).
    What would be the loadMovie command to do that with?
    Thanks!!!

    You need to wait for the movie to load before you can change its size.  To know that the movie is loaded you want to use the MovieClipLoader.loadClip method instead of loadMovie.  The loadClip method supports having an evemt listener so that you can know when the file is loaded and ready to use.  If you look up the MovieClipLoader.addListener method in the help docs, there is an example there that should get you thru most of it.  It uses an onLoadInit event listener which is what you'll want to use since you need to wait for the swf file to be loaded and ready for use before you try to affect it.

Maybe you are looking for