Loading swf into movieclip object

I am trying to load a swf file into a movieclip object on the
stage. The movieclip object is sized smaller than the screen, and
placed in the middle. I have defined a loader with:
var myMovieClipLoader:MovieClipLoader = new
MovieClipLoader();
then use it like this:
_level0.myMovieClipLoader.loadClip("moviename.swf",
_level5.movieclipinstancename);
(the movieclip object is used in a swf loaded in level5)
When I load the swf like this, the swf loads at the correct
location according to where I have placed the movieclip object,
however it "blows up" to fill the screen from that point down and
across, ignoring the size of the movie clip object (the loading swf
actually expands beyond it's created size to fill the screen,
making all the graphics and text much larger than intended). The
actual pixel size of the swf I'm trying to load matches the size of
the movieclip object (1024x350 in a 1280x1024 screen).
What is the magic setting or property that will tell the
loading swf to honor the size of the movieclip object I'm loading
into?
Thanks for your help!
Barb

Something I've been working on:
Place the following code in a new file <your project
folder>\as\MovieContainer.as
Then open the properties for the symbol you want to be your
movie container
Set the AS 2.0 Class to as.MovieContainer and give it a name
(I named mine 'loader').
To load the movie, simply call:
loader.queueSWF('my.swf');
Hope that makes sense. Basically, it's just a self contained
class for loading into an object on the scene. It draws a simple
progress bar on the center of the symbol when it's loading and it
resizes the loaded object on init to conform to the size of the
object on the stage. Why queueSWF? Well, if it's currently loading
a SWF, it will wait till it's finished and load a new one. The
biggest problem right now is the progress bar, but it's fairly easy
to remove if you don't like it. Hopefully it helps.
If anyone else is reading this. I'm trying to figure out if I
can load these movies into an array of movieclips. So far I've had
no luck. If you know of a way, feel free to drop some input.

Similar Messages

  • When time line reaches a certain frame load swf into movieclip.

    Hi,
    I need some help with some actionsscript. When the timeline reaches a certain frame, I want an swf to load into a movieclip in that particular frame. I need this to occur on level 1 as the root of the site is pre loader. Any help would be much appreciated. Cheers

    In that frame, on an actions layer, use either the loadMovie method or the MovieClipLoader.loadClip method to load the swf into the movieclip.  There should be examples of using either in the help documents and via Google.

  • Load swf into movieclip // play pause buttons

    I am going out of my mind trying to get this to work. I can do it in AS2 without a hitch - but not AS3.
    I just need to load an external swf file into an empty movieclip. Then I have 2 buttons play and pause that need to be on the top layer of the new movie and they need to play and pause the loaded swf file.
    I have tried a number of things and nothing is working. Please help.
    Thank you in advance.
    Shawna

    you can use:
    var ldr:Loader=new Loader();
    addChild(ldr);
    ldr.load(new URLRequest("yourswfthatyouwanttoload.swf"));
    addChild(yourplaybtn);
    addChild(yourpausebtn);
    yourplaybtn.addEventListener(MouseEvent.CLICK,playF);
    yourpausebtn.addEventListener(MouseEvent.CLICK.pauseF);
    function playF(e:Event){
    MovieClip(ldr.content).play();
    function pauseF(e:Event){
    MovieClip(ldr.content).stop();

  • Controling a loaded swf into movieClip

    help!!
    i have loaded a {slide swf} into a movieClip .. on stage ..
    using the
    var loader:MovieClipLoader();
    using a button movie clip the is embeded into a seperate swf
    file that is loaded in at run time
    but the {slide swf} is runing a Interval that i need to clare
    ... so is there a way to talk to swf file after you load it into a
    movie Clip how do you address that

    var kglad : Master = new Master();
    Kglad .onReply=function(){
    " you are on to somthing big [ only the second picture fade
    in and thats where it stop ] it deos not seem to bee loading any
    more ... but when you click the next _btn.
    the caption keep changing ... but pictures don't change
    "........ i am sending you a better view of what ihave
    done<<<<<<<<<<start... // create
    variables
    var x:XML = new XML();
    x.ignoreWhite = true;
    var urls:Array = new Array();
    var captions:Array = new Array();
    var captions2:Array = new Array();
    var whoIsOn:Number;
    //XMl function
    x.onLoad = function() {
    var photos:Array = this.firstChild.childNodes;
    for (i=0; i<photos.length; i++) {
    urls.push(photos
    .attributes.url);
    captions.push(photos.attributes.caption);
    captions2.push(photos
    .attributes.caption2);
    holder.loadMovie(urls[0]);
    caption.text = captions[0];
    caption2.text = captions2[0];
    whoIsOn = 0;
    //Load XML
    x.load("pics/kingslandMarks/lmlist.xml");
    // The Button envents
    previous.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    next.onRelease = function() {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    clearInterval(transitionI);
    transitionI = setInterval(transitionF, 50, wholsOn);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    function transitionF(index) {
    if (!fadedOut) {
    holder._alpha -= 4;
    if (holder._alpha<0) {
    fadedOut = 1;
    holder._visible = 0;
    } else {
    if (!loadStart) {
    holder.loadMovie(urls[whoIsOn]);
    loadStart = 1;
    if (!loadComplete) {
    if (holder.getBytesLoaded()>0 &&
    holder.getBytesLoaded()>=holder.getBytesTotal()) {
    holder._visible = true;
    loadComplete = 1;
    holder._alpha = 0;
    } else {
    holder._alpha += 4;
    if (holder._alpha>=100) {
    clearInterval(transitionI);
    /*next.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    var s;
    //Experimenting with auto play slide show
    var nInterval:Number;
    autoPlay();
    function autoPlay() {
    function neXt():Void {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    if (whoIsOn == urls.length) {
    clearInterval(nInterval);
    whoIsOn = 1;
    function prEv() {
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    auto.onRelease = function() {
    nInterval = setInterval(neXt, 2000);
    this._visible = false;
    sTop._visible = true;
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    sTop.onRelease = function() {
    clearInterval(nInterval);
    this._visible = false;
    auto._visible = true;
    //try to fade the movieClip holder
    function fade():Void {
    holder._alpha -= 5;
    if (holder._alpha == 20) {
    holder._alpha = 100;

  • Load SWF into empty movieClip?

    Hello,
    Could anyone please point me in the right direction to find
    out how to load an external SWF into an already existing movieClip
    instance that is already placed on the stage? This is the way I've
    always worked in AS2, but I can't find how to do it in AS3. Can
    anyone point me to an example where URLRequest works with a
    specified movieClip instance?
    Thank you!

    I understand why you might think I was ignoring your advice,
    but this isn't the case. You're expertise is much valued and
    respected.
    My purpose for continuing to experiment with loading into a
    movieClip was an attempt to find an easy way to layer the SWF
    behind other elements, but as you know, although it works for this
    purpose, it doesn't allow control of the loaded SWF from the main
    timeline. For others struggling to learn as I am, here's a link
    where I found the answer to my question above:
    http://www.hostingforum.ca/776586-as3-controlling-loaded-swf.html
    The transition to AS3 is not as easy for some as for others,
    and there are new concepts to understand.
    Don't know what "nvm" means... curious, but might be better
    off not knowing ;) Thanks again for all the help you offer to all
    of us who are struggling.

  • Load swf into RAM via an asset manager

    Hi.
    I have an AS3 virtual world and we are continually loading external resources such as swfs and sounds.
    A few of my menu screens that take a damn long time to load. Read a tut that said we should load them into RAM using an asset manager.
    I'm assuning the asset manager is simply a Class used specifically for loading and unloading graphics, swfs and sounds. So the important part to ask is:
    What do they mean by loading into RAM.
    I thought all swfs were automatically loaded into RAM ie: cached or in the flash player cache or the browser cache. Or do I have to do it specifically myself with some code. We are importing external files so we thought that was a great idea as they are shared by many games.
    btw: RSLs I have read about but I don't understand. I thought my externally loaded files were RSLs (runtime shared libraries) or would I have to do some physical coding do convert them into RSLs.
    This is so important because I am not very experienced but I am getting a lot better due to help receied in this forum and my current programmer is leaving me. I have been studying up on As3 and design patterns and I understand basic coding a lot better now.
    CHEERS
    EDIT: Just read that I am using a http call. - I use urlloader - well that's what you use isn't it or how would you load an external swf. Just read that you can hold the swf as a variable which loads it in RAM and therefore will be available immediately. Know I don't understand anything as I have never read that anywhere.

    Hi Andrei, nice to see you around here.
    Well, somebody helping me says that normally we make a http request with urlLoader to the server and that is what was happening each time. We weren't getting the cached swf. (that bit I don't understand and doesn't sound right - anyway...)
    So he says if we create a dictionary class to hold that swf then the next time we make a request we will get the movie from there and not from the server.
    I have highlighted the main parts of code below.
    What I don't understand about all this is that I have never seen anything like this in my life. I have read extensively and read all about loading external files and using this type of asset manager with the dictionary class does not ring a bell and goole comes up with nothing.
    I hunch is that as you say, we are doing something wrong somewhere because the only way to get an external file is via urlLoader to the server the first time and then the second time it should look for it cached on our computer is that right? Or when we make the urlLoader request how does it know to look on our computer first before going to the server or are these innner workings of the flash player I know nothing about. This is so important as when I get 10 kids on the computers they wait for as long as 5 minutes for movies that have already been downloaded many times before.
    Cheers in advance.
    package com.Gerry.managers.assetManager
        import flash.display.Loader;
        public class AssetLoader extends Loader
            private var _assetName:String;
            public function AssetLoader()
                super();
            public function get assetName():String
                return _assetName;
            public function set assetName(value:String):void
                _assetName = value;
    The asset manager loading class
    package com.Gerry.managers.assetManager
        import flash.display.Loader;
        import flash.display.LoaderInfo;
        import flash.display.MovieClip;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.net.URLRequest;
        import flash.utils.Dictionary;
        public class AssetManager extends Sprite
            public static const ASSET_LOADED:String = "assetLoaded";
            private static var _instance:AssetManager;
            private var _assetsLoaded:Dictionary = new Dictionary();
            private var _assetsBeingLoaded:Dictionary = new Dictionary();
            public function AssetManager(pvt:SingletonEnforcer)
             * loads and asset and keeps a reference to the loaded content
             * @param name
             * @return null if the asset is not loaded yet
           public function loadAsset(name:String):MovieClip
                var asset:MovieClip;
                if (_assetsLoaded[name])
                    asset = _assetsLoaded[name];
                else if (_assetsBeingLoaded[name] == null)
                    var skinloader:AssetLoader = new AssetLoader();
                    skinloader.assetName = name;
                    skinloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteF);
                    skinloader.load(new URLRequest(name));
                    _assetsBeingLoaded[name] = true;
                return asset;
            protected function loadCompleteF(e:Event):void
                var skin:MovieClip = e.target.content as MovieClip;
                var name:String = ((e.target as LoaderInfo).loader as AssetLoader).assetName;
                _assetsLoaded[name] = skin;
                delete _assetsBeingLoaded[name];
                dispatchEvent(new Event(ASSET_LOADED));
             * gets an instance of the class
             * @return
            public static function get instance():AssetManager
                if (_instance == null)
                    _instance = new AssetManager(new SingletonEnforcer());
                return _instance;
    internal class SingletonEnforcer
    The function inside a class called Screen which is used by menus classes to load their swf menus.
    protected function loadSkin(path:String = null):void
                trace("skin to load: " + path);
                Home.instance.addPreloaderF();
                _path = path + Home.instance.cacheString;
                if (_usingAssetManager)
                    loadSkinFromAssetManager();
                else
                    if (_skinloader.content)
                        _skinloader.unloadAndStop(true);
                    _skinloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteF);
                    _skinloader.load(new URLRequest(_path));
            protected function loadSkinFromAssetManager(e:Event = null):void
                _skin = AssetManager.instance.loadAsset(_path);
                //if no skin we have to wait to be loaded it
                if (_skin == null)
                    AssetManager.instance.addEventListener(AssetManager.ASSET_LOADED, loadSkinFromAssetManager);
                else
                    AssetManager.instance.removeEventListener(AssetManager.ASSET_LOADED, loadSkinFromAssetManager);
                    loadCompleteF(null);

  • Loading swf into SWFLoader before it is added to a container

    I want to dynamically load a SWF file, before a particular view is created in a Flex 4.5 mobile app. Is it possible to load a SWF file into a SWFLoader before the SWFLoader is added to a container? I tried this but it didn't work.
    I tried doing this using the AS3 Loader class and movieclips, but when I compile for iOS this method does not work for me. Is there a way to do what I want?

    Hello,
    Firstly, why do you want to do this?
    Secondly, you cannot run runtime-loaded SWF files on iOS devices.
    By that I mean you can probably only use static SWF files like assets, but code inside them will not work.
    If you still want to load it, try inside the initialize event handler.

  • Can't load swf into editable region

    Am using DW CS4 in W7 64.
    Have designed an html site with one page that has a swf to control dynamic content with php.
    All the pages are created based on one template and al is fine until I try to place the flash file in the editable area of the html page. It seems that no swf files can me placed in this or any other editable area of the page.
    When the swf is put in the follwoing error comes up "While executing object Tag in Flash htm, a JavaScript error occurred"
    Any one else had this issue? More to the point anyone found a work around?

    Cevema wrote:
    To test the theory, as I had previously loaded CS4 onto my old XP pro machine, following a fresh install of XP Pro, and as Dreamweaver had never been started on the is machine before, I then created a brand new page from the template and tried to load in a swf file, but got the same error message. For a fresh install this couldn't be a corrupt file. A friend also tried this on his machine and had the same result.
    I don't normally use either templates or SWFs, but I have just done a quick test in Dreamweaver CS4 on Windows Vista 32-bit. Dreamweaver inserted the SWF into an editable region without demur. It's definitely not a Dreamweaver bug.
    Did your friend use the same template?
    Since a JavaScript error is being generated, I suspect you have invalid code somewhere in your template, or perhaps you have given more than one element the same ID. Validate your page with the W3C validator (http://validator.w3.org/), and eliminate any errors it finds.

  • How to load swf into a movie clip?

    i have an swf file i want to load into a movie clip within my
    flash file, i think im supposed to use loadmovie () instead of
    loadmovienum, can anyone help me out? thanks

    loadMovie("X",Y);
    Where x is: the url of the swf file you want to load.
    Where y is: the name of the movieclip you want to load it
    into. You must give the movieclip an instance name.
    For example, if I wanted to load '1.swf' into a movieclip
    with an instance name of "loaderclip," my code would be:
    loadMovie("1.swf", loaderclip);

  • Loading swf into swf in exact position

    It's very simple to load an external swf into a main swf with
    loadMovieNum("name.swf", 50);
    But how do I control the position of the loaded swf?
    Currently it just pops in the top left.

    Try loading your external .swf into a pre-positioned
    movieClip, for example myMovie.loadMovie("name.swf). If you do not
    want to do this you can position the loaded movie later in your
    application or onload by setting the x and y pos with some
    AS.

  • (MX04) Pausing a loaded swf with sound objects within it

    Hi,
    I'm working on a PowerPoint-esque presentation where a user
    watches and listens to a loaded swf in the main movie, clicks the
    next button (which unloads the swf, advances to the next frame and
    loads the next swf), and watches the next one. Lather, rinse,
    repeat. Some of the sections are rather long, and I'd like to give
    the user the ability to pause and play by button click.
    I know how to stop and start the container MC, but that
    doesn't stop the sound object (and the embedded MCs). I also know
    how to pause and start a sound object using the object's instance
    name. Is there a way to pause everything from the main timeline,
    and keep the AS general enough so that any sound object pauses when
    clicked?
    Any help is most appreciated! MX04 and AS2.0.
    Thanks!

    Kglad,
    I tried your code and ran into some problems with stopping
    the mc's, as the embedded mc's within the loaded swf need to stop
    as well. I found the attached code to stop the mc's, but now am
    having trouble with the sound objects.
    Here's the issue, I used this:
    this.soundPosition = currentMovie.loop1.position/1000;
    this.currentMovie.loop1.stop();
    ... for the sound object stop commands and listed a new one
    for each loop I was using. On the play button I started them back
    up again. This all works, but when I start them up again they all
    play, not just the one that is currently paused. Do you mind giving
    me some guidance with the for (obj in mc) loop? My loop experience
    is nil. What I want to do is have the code cycle through all of the
    loops to see which one is playing, then store that information in a
    variable, then pause and play the variable. Does that sound right?
    Thanks again for the help!
    -Sandy

  • Loading SWF into level and setting height/width/location?

    Hi folks, I am an old AS2 guy who gave up on Flash heavy coding when it switched to AS3. Always thought it was less intuitive, longer, and a brand new language and I got tired of trying to keep up when most of my clients did not want to pay for a full flash site. But I got this client...
    Here's the problem, I can load a swf into my main stage or into an MC , but I cannot find out anywhere how to set parameters or load into a level so it doesn't replace the current material or fix to a size that doesn't block my other material.
    I've gotten this far:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    loadGallery();
    function loadGallery():void
    var l:Loader = new Loader();
    var req:URLRequest = new URLRequest("shortstack.swf");
    l.load(req);
    l.contentLoaderInfo.addEventListener(Event.INIT, galleryLoaded);
    function galleryLoaded(e:Event):void
    addChild(e.target.loader);
    What i want to do is load shortstack.swf into level 5, say, and fix it to the bottom left corner of the stage, and set its height to 400px and width to 980. 
    I have a an MC on the stage at those exact dimensions called placeholderMC, but I cannot figure out a way to target it, and the tutorials I've read have to do with loading on CLICK (I want it to load on enterFrame), and none of them tell me how to set parameters, as I could in old AS2.
    FWIW, AS3 may be more powerful, but AS2 was easier to understand.
    TIA,
    Jeff

    http://www.adobe.com/devnet/flash/quickstart/display_list_programming_as3.html

  • Load .swf into .swf with linked .flv

    Hi all,
    I'm trying to load swf-2 into swf-1, with swf-2 externally
    loading an .flv.
    When I go straight to swf-2, it works fine. And when I embed
    the flv in swf-2, and open swf-1, it works fine.
    It's only an issue when swf-2 is pulling the EXTERNAL flv.
    Any ideas?
    Thank you,
    Tracy

    are the files all in the same directory? if you load a swf 2
    in a swf 1, then the code used by swf2 to load the flv file would
    be executed as if the code was executed from swf 1 location. is swf
    2 and the flv in a different folder from swf 1?

  • Load swf into mc frame by frame

    Hi, I have a movieclip to dynamically load swf's. Some of my
    swf's are slideshows and contain jpgs that are quite large.
    Therefore I do not want to wait till the end of a complete load to
    show the swf. Say, if i want to show picture 3 (at frame 3), i'd
    like to show it as soon as the frame is loaded. However, I also
    need to rezie the swf to fit my mc's fixed size. Resize only works
    after all bytes of the swf are loaded I believe.
    How do I solve this problem?
    Ted

    Can you be more specific? I read at the MCLoader apis, but
    still have no clue how to solve this problem.

  • Load swf into an instance

    In the first frame of my movie, I want to load a swf into
    'cwgmap' mc instance, which is inside 'thumbs' mc instance. I am
    attempting (with no joy!)
    thumbs.cwgmap.loadMovie("2014_map/thumbs.swf");
    Any ideas how I can achieve this? The action must be in the
    first frame of the movie - not attached to the mc itself. Driving
    me mad!
    many thanks

    Managed to fix the issue - the scripting was correct but in
    the wrong frame.
    Cheers!

Maybe you are looking for

  • How do i switch a facetime email address from one ipod to a different one. thanks

    how do i switch a facetime email address from one ipod to a different one. when i try to use the address on the new ipod it says it is already to use

  • Pay as go data issue

    Hi I am new to ee pay as you go I cant use my data but says I have 2gb left I don't have credit so wanted to know if that's the issue I have a Nokia Lumia 530

  • Air on android is not support sharedintent??

    hello.. i want to register shaedIntent by air application, so i insert intent-filter in description xml below.. [xml in Air] ------------------------------- <application android:enabled="true"> <activity android:excludeFromRecents="false">      <inte

  • Changing item order in playli

    aloha. i picked up a Vision:M a few months back after a long absence when my Xtra finally bit the dust. i absolutely love it, but one of the things that used to make the Xtra really fantastic, particularly at a party, was being able to change the ord

  • How to install new font on safari for windows??

    i have problem when i go to certain international sites.. for eg: http://www.deepika.com/ in the help section the site provides the required font mlkr0ntt_TTF.ttf no luck just wont work..