Resizing of the imported swf files...

I have a clip I want to import a swf file, the swf file is larger than area of the clip. I tried to use a resize code for the import of images that I found, but it makes the very small swf. Is there a way to control the size of the imported swf file?

Maybe something like this should work, based on what you say.

My code was a bit more complicated because my equivalent of the charger clip changed size and shape sometimes and I had to accommodate that.

There is also an another gotcha with this... it's easier if the content inside your charger clip has its top left corner at 0,0. Otherwise, you must assign target_mc _x and FLF properties in the onLoadInit region where I mentioned also.

To help understand the target_mc is just a reference to the element of the view inside "loader" that is passed to the listener, onLoadInit function after that the swf file is loaded.

Tags: Adobe Animate

Similar Questions

  • Text on the imported swf file input field is not "entrable" in presenter

    I created a swf file (created using Actionscript 2) in which the user can enter text. The file works fine as a stand-alone swf, but when imported and published from Presenter, the field is more entrable. Help!

    Hey BillG-Chicago,

    Greetings from Adobe.

    Can you please confirm the version of Adobe Presenter, in which you have imported and post your (created in ActionScript 2) SWF file?

    Since Adobe Presenter 7.0.7 or later only supports ActionScript 3 and which could be the reason why your SWF file does not work as it has been created in ActionScript 2.

    Kind regards

    Ajit

  • Communicate with the embedded SWF files

    So if I have several external swf into one big, how can I communicate with each other?

    More specifically,.

    -the swf principal needs to know when the keys were pressed in a shipped, and he needs to tell you all the other included those on this subject.

    -embedded SWFs must intelligently resize and shuffle around each other, while keeping their origins coordinated in the upper corner.

    How can I go about it?

    As long as you mean by "shipped" you load swf files in you main file dynamically, then there is hope for all that you have planned.  If you mean that import you into the library by embedded and plant them in the chronology of the main file, that does not work.

    The other event and the event or Manager is coded in the main SWF.  Are the code loaded SWF to displatch events than the main file of the headphones for.  If simply scream of the loaded swf when they will, not for mutual assistance who hears him... allowing them to compile without dependence on the master file.

    If in the film loaded, which triggers the need to rehabilitate the main file in action would send an event as follows...

    dispatchEvent (new Event ("eventName")); name of the event you want to

    To add the listener in your main swf file, listen for the complete event of load on the Loader.contentLoaderInfo which is used to load the file.  In the complete event handler, add the listener for the event on the loaded swf file.

    function loaderCompleteHandler(e:Event) {}
    MovieClip (e.currentTarget.content) .addEventListener ("eventName", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("load swf triggered event");
    }

  • control the loaded swf file

    Hi all

    I am loading a swf into another SWF, I want to controll loaded swf such as play and pause the swf. The loaded swf file is an animation file, all animations are kept in a movieclip, then please tell me how I can control the animation.

    In your first assignment, you tell the animation is present in a movieclip.  If this movieclip is in the loaded swf file you will probably need to target this movieclip to tell him to play rather than the SWF itself, as in...

    currentSWF.movieclipName.play ();

    where movieclipName is replaced with the name of the instance of movieclip in the loaded swf file.

  • How to unload the external .swf file when pass the other section?

    Hello

    The following code provided by Mr. kglad works very well to load an external .swf file on stage. Now, when I click on Contact (button), the file external .swf to disappear completely. How to encode on contact (button) to get by.

    Gallery.addEventListener (MouseEvent.CLICK, GalleryClick);

    function GalleryClick(e:Event):void {}

    If (currentClip! = Gallery_mc) {}

    currentClip.visible = false;

    Gallery_mc. Visible = true;

    currentClip = Gallery_mc ;}

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, ClipLoaded);

    Loader.Load (new URLRequest ("Gallery.swf"));

    function ClipLoaded(e:Event):void {}

    Gallery_mc. AddChild (Loader);

    Loader.x = 0;

    Loader.y = 120;

    Loader.Width = 1000;

    Loader.Height = 700

    }}

    I tried the following code for Contact_btn unload the Gallery.swf file that launches an error message: 1120: access of undefined property loader.

    Contact.addEventListener (MouseEvent.CLICK, ContactClick);

    function ContactClick(e:Event):void {}

    If (currentClip! = Cotnact_mc) {}

    currentClip.visible = false;

    Cotnact_mc. Visible = true;

    currentClip = Cotnact_mc;

    Gallery_mc.removeChild (loader);}}

    unloadAndStop() is supported by flash player 10 or higher (fp 10 +).

    p.s. Please check the useful/correct, if there is.

  • How the get function is available or not on the loaded swf file

    I have 100 swf file in one of my projects. And there is a common feature in some of the SWFs. All these files are loadded in the file main.swf. Here's my Question, "If have the common function is the swf file that is loaded, int how to trigger this funciton of the main.swf.

    Quite simply,.

                if(movieclip.test){
                    movieclip.test();
                }
    

    ('movieclip' is the loaded SWF file and "test()" is the function)

  • Too late to load the new SWF after unloading the current SWF file

    Hello

    In our application, we use more than 10 sovereign wealth funds. When you cross one SWF to others try to unload currently load SWF and load a new. We were successful to unload the existing SWF, but the problem, takes too long to load SWF again (more than 5 seconds). Please suggest a useful method to overcome this time for best performance.

    get an idea of the following code snippet.

    Thank you


    public void SwitchSWFs (): void

    {

    If (null! = SystemAgent.getInstance () .currentSWFLoader)

    {
    SystemAgent.getInstance ().currentSWFLoader.unload ();
    SystemAgent.getInstance () .currentSWFLoader = null;
    trace ("HomeUI: previous swf unloaded!");
    }
    on the other
    {

    }
    addChild (SystemAgent.getInstance (.swfLoaderSecondSWF));
    SystemAgent.getInstance () .currentSWFLoader = SystemAgent.getInstance () .swfLoaderSecondSWF;

    }


    will call by clicking a button
    public void LoadSecondSWF (): void

    {
    SystemAgent.getInstance (). swfLoaderSecondSWF.load (new URLRequest ("Second.SWF"));
    SwitchSWFs();

    }

    The delay is when you test locally?

    One thing you might try is to load all Chargers present you at the front they are needed so that there is more likely that they are ready to be added to the display list when it is called for.  So instead of having the button trigger loading the SWF, just it call the switchSWFs function.

    Another thing, you could try if you keep it where the Triggers button load the corresponding file to assign an event listener for the charger to detect when it has finished loading and then have this listener event handler function calls the switchSWFs function.  At least this way, the current swf file is not unloaded until a replacement is ready and waiting.

  • How to determine the total number of images in the external .swf file loaded

    I have to be able to load both external .swf files and make them play in order. To do this, I need to know the number of images in the first .swf file so I can check _currentframe against _totalframes to determine when he is finished playing so that I can load another.

    Most of the stuff I see indicate that _totalframes on an external .swf can be determined by loading the .swf in a container clip and then check using a listener in the .onLoadInit. Like this:

    ------------------------------------------------------------------------------------------ ----------------------------

    this.createEmptyMovieClip ("tester_mc", 1);
    var mcListener:Object = new Object();

    mcListener.onLoadInit = {function (target_mc:MovieClip)}
    target_mc.onEnterFrame = function() {}
    If (this ._currentframe > = this ._totalframes) {}
    trace ("total frames =" + this ._totalframes);
    delete this.onEnterFrame;
    } else {}
    trace (target_mc._currentframe + "OF" + target_mc._totalframes);
    }
    }
    }

    var test_mc:MovieClipLoader = new MovieClipLoader();
    test_mc. AddListener (mcListener);
    test_mc.loadClip ("Ad_Group.swf", tester_mc);

    ------------------------------------------------------------------------------------------ -------------------------------------

    Unfortunately, this doesn't seem to work. The trace will always return a total number of frames of 1.

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I would appreciate any ideas on how to raise the total number of frames of an external .swf file or, Alternatively, put it another way when it's done playing. (Not only the loading, but play until the end.)

    TIA,

    C

    I guess it's because the container clip has only 1 frame, and the external .swf timeline seems to be ignored.

    I wouldn't imagine. My guess is that the main scenario for the external swf file has only 1 frame and the rest of the animation is inside a movieclip in this timeline. You publish this swf? Can you open the FLA and check how many images is open on the main timeline?

    The approach that you have mentioned is about what there is. But he knows check a chronology. If there are many nested movieclips, it may be impossible to understand what timeline you really want to be 'THE' full chronology.

    If you have the FLA, you can have the video call function on the _root timeline which tells the main swf that has completed a movieclip or something like that.

    Also, I have in my head somewhere that I recently saw something that someone made similar to this one, but do not remember... If it appears in my head that I will post.

  • Preloader which modifies the external SWF files every 5 seconds

    Hello

    I made a web banner in flash that loads an external swf and another external swf changes after 5 seconds. The banner have a preloader, but the problem becomes when you load the first time. As sovereign wealth funds are not cached in the cache of the browser and yet, time 5 seconds start counting from the preloader, and when the external swf file, shows only 1 second rest and it is replaced by another. There is a way to 'freeze' the time for each external swf until it loads completely?

    The code that loads SWFs every 5 seconds (this code is placed in a layer of action):

    start of the code:

    var intervalId: number;
    var: number = 0;
    var maxCount:Number = 23;
    var duration: number = 0;
    var banners: Array = new Array)
    "abatrade.swf,"
    "bancobrasil.swf,"
    "caparao.swf,"
    "cedro.swf,"
    "cesama.swf,"
    "copasa.swf,"
    "damatta.swf,"
    "emtel.swf,"
    "engedrain.swf,"
    "extel.swf,"
    "feedback.swf,"
    "iti.swf,"
    "intermedium.swf,"
    "magnesita.swf,"
    "maquenge.swf,"
    "maxxdata.swf,"
    "orteng.swf,"
    "paiva.swf,"
    "paraibuna.swf,"
    "paraopeba.swf,"
    "sabesp.swf,"
    "serpro.swf,"
    "soll.swf,"
    'thawte.swf '.
    );

    function executeCallback(param:String) {}
    var duration: number = 5000;
    loadMovie (banners [count], loadmovie_mc);
    loadmovie_mc._x = 0;
    loadmovie_mc._y = 0;

    clearInterval (intervalId);
    if(Count < maxCount) {}
    Count ++;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    else {}
    Count = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    }
    }

    If (intervalId! = null) {}
    clearInterval (intervalId);
    }

    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);

    end of the code
    ----------------------------------------

    And the code to the preloader (this code I place in the movieclip that loads external SWF files):

    start of the code:

    {onClipEvent (enterFrame)}
    var gtT:Number = this.getBytesTotal ();
    var gtL:Number = this.getBytesLoaded ();
    var gtP:Number = int ((gtL/gtT) * 100);
    If (TWG > gtL) {}
    This ._alpha = 0;
    _root. Loader._alpha = 100;
    _root. Loader.bar._width = gtP;
    clearInterval (intervalId);
    } else {}
    This ._alpha = 100;
    _root. Loader._alpha = 0;
    intervalId = setInterval (Thi, "executeCallback", duration, banners [count]);
    delete onEnterFrame;
    }
    }

    end of the code

    Note that I tried to freeze the time using a clearInterval does in the second code, but he simply doesn't work...

    Any ideas? Thank you

    Edson

    Here's the correct code kglad send me. Thank you very much!

  • How to resize the external .swf files?

    Hello

    THA following the code is to resize the video Clips which are on stage. But how can I resize externally. SWF files? I am adding an external .swf file through Gallery_mc.addChild (loader);

    The following code works very well for resizing of video Clips on stage:

    var myStage:Stage = this.stage;

    myStage.scaleMode = StageScaleMode.NO_SCALE;

    myStage.align = StageAlign.TOP_LEFT;

    function initialDisplay(event:Event):void {}

    var swfWidth:int = myStage.stageWidth;

    var swfHeight:int = myStage.stageHeight;

    Gallery_mc. Width = swfWidth;

    Gallery_mc. Height = swfHeight ;}

    addEventListener (Event:ENTER_FRAME, initialDisplay);

    Help, please.

    Thank you.

    It is not supposed to resize an external swf, unless you load it.  If you load, use a complete listener to resize:

    var loader: Loader = new Loader();

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, f);

    Loader.Load (new URLRequest ("swf1.swf"));

    function f(e:Event):void {}

    addChild (loader);

    Loader.Width = Whatever;

    etc.

    }

  • Help with insert or import swf file in the model of the open fla file

    Can someone show me how insert or import a swf file in the template fla file.

    I have a FLA open temple and after importing a SWF file, run the test and the swf file does not work.

    Did I miss something?

    Thank you

    Import a swf in a fla is not the way to get to each other.  Any actionscript in a swf file is lost.  You need to load the file swf dynamically either or you must copy the timeline of the FLA that the swf is made from to the other fla.

  • Combine the Captivate .swf files?

    Anyone know if it is possible to combine the main data *.swf file with the file * _skin.swf in a single file? Which would require import of the script file in the mix as well?

    Thank you

    Jason

    Hi Jason

    Your question would be considered to be one of the more frequently asked questions since version 2 began shipping to the France.

    Caline Captivate to produce one. SWF is pretty painless. Click project > skin... > borders tab. Unselect the checkbox "Show borders". Dismiss the dialog boxes and publish again. Pouf! Unique. Output SWF.

    Note that your playback controls (if you use them) will now occupy part of the space for the movie and sit on top of your movie. If you don't like this behavior, you could resize the movie to make room for them. In addition, this does nothing to avoid you having to also include the moviename. HTM files and standard.js which are also usually required.

    See you soon... Rick

  • Impossible to import swf files in captivate 8

    I'm trying to import a swf file into the new Captivate 8 using the sensitive project. When I select my file and try to import, nothing happens. Import PNG files very well. This type of project not take swf?

    Hello

    SWF files are not supported in sensitive project. SWF files should work properly in a project inadmissible.

    Kind regards

    Alexis

  • Importing SWF files

    I import a SWF with start/stop keys in Captivate, and the sound is not playing.  I don't know if this is a Flash problem or a problem of Captivate.  I posted this same question on the Captivate forum and received no response.  The SWF seems to play very well, however, when I import into Captivate the sound will only play.

    A that someone has experienced this problem?  Should I publish the swf file somehow?

    use:

    var song_sound:Sound = new Sound (this);
    song_sound.attachSound ("Slide 5.wav");
    play_btn.onRelease = function() {}
    song_sound. Start();
    };
    stop_btn.onRelease = function() {}
    song_sound. Stop();
    };

  • Red screen on the page with the embedded swf file

    My application refused:

    I am testing your app on the BlackBerry Dev Alpha Device (OS version 10.0.9.1675). When I try to open the sub category of your app, it's only showing a red blank screen appears and does not respond.
    

    It works very well in ripple, but I can't get the Simulator working and I don't have an alpha of dev, so I can't test it myself. The subcategory is just a HTML with a built-in .swf file.

    Download the full source code

    Any suggestions?

    Hello

    You have this function in your config.xml file?

Maybe you are looking for