Loading a swf into an AS2 clip file

I had some problems with loading a swf into a clip.  The code I use is as follows

{We (Release)}
contentbox.loadMovie("contact.swf",0);
}

It works fine on the loading plan, but it loads the swf file so that the upper left corner is at the center of the content area, pushing the bottom and the right side of the way of content off the screen.

Looks like the contentbox registration mark is centered.

Tags: Adobe Animate

Similar Questions

  • load a SWF into another domain and access its functions and variables

    I need to load a swf file into another domain and call its functions and access to its variables, in the same field, I can load and access its functions successfully, but in different areas not.

    control the class security.  Depending on the browser version that you're targeting you might be able to get out of the allowDomain() method, but you'll probably want to use a cross-domain security file.

  • How can I load a .swf into all the customer?

    Hello world...

    I load a .swf file in all connected clients by pressing a button from another customer.

    Please, help me...

    Emiliano.

    Emiliano,

    What I see wrong in your code is lines like this:

    myLoader.load (new URLRequest ("myParam"));

    If you don't do that you try to load a file called myParam on your server. Try this:

    myLoader.load (new URLRequest (myParam));

    You will then load the file name, your server has sent to your customer.

    On the embeded Apache, when you install FMS Setup asks you whether you want to install a bundled Apache server. In this case you will find the Apache server inside FMS application files and it will be configured for the HTTP proxy for it. To be brief, FMS listen on HTTP port (80) and Apache on port 8134 (default). When FMS receives an HTTP request post it Apache on port 8134 on localhost and the Apache line is sent to the client. So if you need load a SWF over HTTP so it's how it's done.

    The 'train' film is a FLV video that you see on a mini-site comes with the installer of the FMS. When you install it by default your server contains on its base address, port 80, a HTML page where you can see the FLV video. It's a beautiful country side with an old train upview passing. When you read the FMS installation program is how you can check your FMS server and Apache are running.

    If you have installed Apache after FMs that you must do 3 things:

    1. Edit you Apache httpd.conf so that he listens to a port other than 80 (say 8134). Just add the line "Listen 8134" when the httpd.conf file refer to the parameter "Listen."
    2. change the configuration of your FMS applications of HTTP proxy on your localhost, port 8134.
    3. then stop FMS, restart Apache and start FMS then they enter in a port conflict listens.

    See the documentation for the SGF in the Administrator's guide to look at where you can do for the FMS proxy configuration.

    See you soon,.

    François

  • load the SWF into the centre in html file

    Hello

    I wrote the html file in flash.

    SWF load the high left side in html, but I have to load the html Center.

    How to configure the settings. Please help me

    tnks

    In the html code of the page, set the div holding the Flash content to be centered.

  • Preserve the cadence when loading a swf into another

    Is there a way to preserve the cadence of a swf file when loading into another swf that plays at a higher rate. I load some flash ads that work for most to around 12-15 frames per second in a portfolio site that revolves at approximately 40 frames per second. All my ads play too fast. The link is:

    www.dg8tal.com/portfolioidea.html

    Thank you!

    You can use the code below the dotted line to play (and stop) the movieclip to frame m to n fram to any framerate (fps) allows to manage the host computer:

  • Loading external swf into an Air application

    Hi all

    I have build an Adobe Air app for desktop PC and have problems to load an external swf. Whenever I try to load, I get:

    SecurityError: Error #2070: security sandbox violation... cannot access stage owned by app... blah blah

    The file is loading is in a local directory, but I understand its in an another "sandbox" that represents a security risk.


    Is there a way to get around this?


    Any help would be appreciated


    Thank you very much


    Matt

    That's why I added these comments on domain of the swf file.  for locally loaded SWF files, use:

    SFMltd wrote:

    Hi Kglad, thanks for the example.

    If I run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.

    The e-mail of swf file trying to load is stored locally, so I guess that this error is logical. However if I comment on this line, I get the same error "cannot access stage owned by app"?

    See below for the class:

    package {}

    import flash.display.MovieClip;

    import flash.filesystem.File;

    import flash.events.Event;

    import flash.net.FileReference;

    import flash.events.MouseEvent;

    import flash.display.Loader;

    import flash.net.URLRequest;

    import flash.system.LoaderContext;

    import flash.system.ApplicationDomain;

    import flash.system.SecurityDomain;

    public class assetPreview extends MovieClip {}

    private var loader: Loader;

    private var mainSWF:MovieClip = new MovieClip();

    public void assetPreview() {}

    addEventListener(Event.ADDED_TO_STAGE, initialise);

    }

    public void initialise(e:Event):void

    {

    removeEventListener(Event.ADDED_TO_STAGE, initialise);

    var allowSWF:LoaderContext = new LoaderContext (false, ApplicationDomain.currentDomain);

    allowSWF.securityDomain = SecurityDomain.currentDomain;

    loader = new Loader();

    Loader.Load (new URLRequest (settingsXML.pathToSWF), allowSWF);

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

    }

    public void viewPreview(e:Event):void

    {

    addChild (mainSWF);

    mainSWF.addChild (loader);

    }

    }

    }

  • LOAD AN EXTERNAL SWF INTO A CLIP

    Hello.

    I work in a project that load several SWF into a main movie. I use this code and works fine:

    btn_que.addEventListener(MouseEvent.CLICK, presionado); 
    function presionado(Event:MouseEvent){
       //Crea una variable llamda cargador para que cree un cargador//
       var newMedia:Loader = new Loader();
       //Crea una variable para generar un clip vacio (anteriormente host)//
       var cont:MovieClip = new MovieClip();
       //Ruta donde esta la pelicula a cargar//
       newMedia.load(new URLRequest("que_es.swf")); 
       //Posicion X que va a tener//
       cont.x = 0;
       
       stage.addChild(cont);
       cont.addChild(newMedia);
    }

    But I want to load the swf file into a clip (called host), when the person in the button click (really my button is a movi clip).

    What should I do?

    Thank you...

    See the code below (read comments):

    btncerrar.visible = false;
    // declare variable in this scope
    // so that it is visible by other functions
    var newMedia:Loader;
    // container should be in upper score too
    // Sprite is more efficient
    var cont:Sprite;
    
    btn_que.addEventListener(MouseEvent.CLICK, presionado);
    function presionado(Event:MouseEvent){
       //Crea una variable llamda cargador para que cree un cargador//
       newMedia = new Loader();
       //Crea una variable para generar un clip vacio (anteriormente host)//
       cont = new Sprite();
       //Ruta donde esta la pelicula a cargar//
       newMedia.load(new URLRequest("que.swf"));
       btncerrar.visible = true;
       //Posicion X que va a tener//
       cont.x = 0;
       stage.addChild(cont);
       stage.addChild(btncerrar);
       cont.addChild(newMedia);
    
    }
    
    btncerrar.addEventListener(MouseEvent.CLICK, cerrar);
    function cerrar(Event:MouseEvent){
         btncerrar.visible = false;
         cont.removeChild(newMedia);
         newMedia.unload();
         newMedia = null;
    }
    
  • Help with loading a swf from the Google Map API done in AS3 AS2 Flash site

    OK, maybe this can be done, I need to do everything in AS3, or it is a problem of the Google Map API.

    If someone could put me on the right track, I would be grateful.

    I created a Google Map API for Flash Add to my Web site.

    My site has been built using AS2 and the Google Map API was built using AS3

    My site Flash .swf works fine and the Google Map.swf, I created works very well.

    The problem is when I try and do not add the Google Map.swf on my website flash As2 will Google.swf no work.

    I'm trying just to eliminate the error.

    Is it because that...

    1. after having my site flash with AS2, I can't add a .swf with AS3

    2. I need to change the code...

    3. it has nothing to do with AS3, it's because this is a Google Map API.


    I have a button written in AS2 on my main flash site that has a a PreLoader.


    on (release) {}

    Stop behavior MovieClip
    this.gotoAndStop ("Google_Map");
    End behavior


    load film behavior
    If (this.mcContentHolder is {Number (this.mcContentHolder))}
    loadMovieNum ("PreLoaderGoogle.swf", this.mcContentHolder);
    } else {}
    this.mcContentHolder.loadMovie ("PreLoaderGoogle.swf");
    }
    End behavior
    }

    The PreLoaderGoogle.swf was then has a

    Instance of: charger

    contentPath

    Google_Map.swf

    If I change the Google_Map.swf instance in the PreLoader for an another .swf using AS2 it all works.


    or do I just have the wrong end of the stick.

    All advice appreciated.

    If you load an as3 swf into an as2 swf, none of the code in the as3 swf file will work.

    the simplest way around this is: you could create a loader swf (GER) as3 that loads your as2 swf and load your google as3 swf.

  • Load external swf file

    Hi all

    I am trying to load an external SWF file in my site... but it does not work. Here is my code

    public var CD:Loader = new Loader();

    protected function application1_creationCompleteHandler(event:FlexEvent):void

    {

    CD.load (new URLRequest ("http://localhost/assets/slide.swf"));

    addChild (this. (CD);

    CD.x = 2;

    CD.y = 170;

    / / TODO self-generated stub method

    }

    Can someone tell me what goes wrong...

    The url is correct and his works in my browser when I type " " http://localhost/assets/slide.swf ' in the browser... So the problem is with flex...

    I tried to load this swf into my project and it crashed the browser.  What is written this swf?  AS3 or earlier?  If I'm not mistaken load one previous VERSION other than 3 will cause additional problems and needs to work to spare but I'm not 100% sure.

  • Loading a SWF in my flash banner

    Hello

    I am creating a banner for a website, and I need to load an external images scroll swf located behind the layers in my flash banner.  Another example is the site: www.miracledetail.co.uk.

    I created managed to create everything in this banner except the scrolling images, so I have an external swf file to load into my flash banner project.

    I tried this...

    createEmptyMovieClip ("anim", 0); create a new, but empty film (anim) clip
    anim.loadMovie ("animation.swf"); load "animation.swf" into the void (anim) video clip
    Anim._x = 100; Adjust the position of the imported file "animation.swf".
    Anim._y = 100;

    I clicked on a first framework on a layer on the timeline and inserted the above actionscript code, with the anim.loadMovie function calls the external swf file.  However, when I do this, the drumming swf loaded and displayed on the top of my banner, and I see no banner at all.

    I tried to put the script on multiple layer action so that the swf file will play behind the other layers in the banner, but again it keep loading on the banner.

    I hope you know what I'm saying here and what I'm trying to achieve.  Also to add that I am not very good with flash at all (as you have probably already guessed) so ideas tutorial or instructions on how to do this would be ideal.

    Kind regards

    Volterony22

    Hello

    Just to make it simple, create an empty clip on the stage itself rather than use an actionscript and use the actionscript code just to load external swf file in the clip.

    Create an empty clip on a layer below your expected layer where you want to load an external swf on the stage. Now, you can position the empty clip to the desired direction x, y on the stage OR you can use actionscript code to do. Give an instance name to this empty clip called "loadermc" in the properties panel. Add the following at the top most layer code (have one devoted to stocks if you have not already)

    your movie clip instance void name.loadMovie ('your external SWF file URL');

    loadermc.loadMovie ("animation.swf");

    If you do not position the empty movieclip earlier, you can use your code to make

    Anim._x = 100; Adjust the position of the imported file "animation.swf".
    Anim._y = 100;

    I hope this helps.

    Thank you!

  • External loading. SWF in Flash

    OK, so I asked this question earlier:

    http://forums.Adobe.com/message/5135410#5135410

    I does not go into details. My first question is: did you Ishkur somehow a transparent background for its external .swfs, or he made a regular and used some sort of code or setting to do so it appears down right? And my second question is, where should I apply this code / where does go? He get couple with buttons which translate the flash to load the external .swfs? I sincerely apologize for my nonstop customer support. _.

    myMovieClipInstance.loadMovie ("myExternalMovie.swf");  Here, only the file name is given, indicating that the SWF file is in the same folder as the parent swf file

    You don't have to do anything to get a transparent background.  When you load a swf into another swf, the loaded file has no bottom, does only the primary file.

    You place the code based on what you intend to start loading.  If it is a button that will trigger loading, then you place the code in the button code.  If it happens when you enter a specific frame, then you put the code in this framework.

  • AS2 button table to load external swf files

    Hey everybody.  Someone here recently helped me tremendously with a question I had on the creation of a back button in my flash file, allowing the user to click the button and view the file before swf.  I hope someone can help me make the next button now, too.

    I have a movieclip that loads an external swf files table.  I thought that the next button would be as simple as changing a selection just few things for the previous button.  However, this does not work.  When I try it, the movieclip doesn't even load the swf files.  Here's my AS2 code for my folder.  I have bolded the part at the end is for the previous button.  Does anyone know how to make the back button?

    var currentSwf:Number = 0;
    var swfs:Array = new Array ("EZSmartStand/SmartStand.swf", "EZSmartStand/Warnings.swf", "EZSmartStand/LCDDisplay.swf", "EZSmartStand/Operation.swf", "EZSmartStand/Harness.swf", "EZSmartStand/Transferring.swf", "EZSmartStand/800lbvid.swf", "EZSmartStand/Ambulating.swf", "EZSmartStand/Accessories.swf", "EZSmartStand/HarnessLaundering.swf", "EZSmartStand/ChargingBatteries.swf", "EZSmartStand/EmergencyLowering.swf", "EZSmartStand/EmergencyLowering2.swf");

    var listener: Object = new Object();
    var mcl:MovieClipLoader = new MovieClipLoader();
    mcl.addListener (listener);

    Function to load the film "next".  It uses the current value of currentSwf
    to access the table of sovereign wealth funds, then increments this value.  This version loops
    around at the beginning after the last of them.

    function loadNext (): Void {}
    mcl.loadClip (SWF [currentSwf], theTargetClip_mc);
    currentSwf ++;
    If (currentSwf > = swfs.length) currentSwf = 0;
    }

    When the SWF load, put in place to constantly check its current image
    against the total number of frames, and so those that match, the SWF is done playing.
    If this is the case, then load the following.

    listener.onLoadInit = {function(targ:MovieClip):Void}
    theTargetClip_mc.onEnterFrame = function (): Void {}
    If (this ._currentframe = this ._totalframes) {}
    loadNext();
    delete this.onEnterFrame;
    }
    }
    }

    loadNext();
    function loadNext (): Void {}
    If (currentSwf > = swfs.length) return;
    mcl.loadClip (sovereign wealth funds [currentSwf], theTargetClip_mc);
    currentSwf ++;

    }

    function loadPrevious (): Void {}

    if(currentSwf>1) {}


    currentSwf-= 2;


    loadNext();


    }


    }

    rewind_btn.onRelease = loadPrevious;

    You must change your code so that the value of currentSwf reflects the real current swf being viewed.  It makes it easier to manage in the aspect of thinking.  While I'm not show all your code, here's how I recommend you change functions, by adding one specifically for loading, and change the other just increment/decrement the value currentSwf.

    function loadNext (): Void {}
    currentSwf ++;
    If (currentSwf > = swfs.length) currentSwf = 0;
    loadSWF (currentSwf);
    }

    function loadSWF (nextSWFToLoad) {}
    mcl.loadClip (SWF [nextSWFToLoad], theTargetClip_mc);
    }

    loadSWF (currentSwf);

    function loadPrevious (): Void {}
    -currentSwf;
    if(currentSwf==-1) currentSwf = swfs.length - 1;
    loadSWF (currentSwf);
    }

    rewind_btn.onRelease = loadPrevious;

  • AS2 loading swf that loads additional s AS2 swf into Flex

    My loaded AS2 swf can not seem to load the AS2 swf using loadMovie() and loadMovieNum().

    I have a file .mxml with a tag with an attribute of the source of mx:Image bound to a string variable. I can set this variable to a valid way to AS2 swf and swf file load as expected.

    However, the AS2 swf contains one or more statements loadMovie() to load additional SWFs 'child' in empty movieClips that fails silently.

    (I have to load several legacy/AS2 projects, I try to avoid the migration of these projects to AS3, also try to avoid incrustation of the SWF to the 'child' in a single AS2 swf).

    I tried both loadMovie and loadMovieNum, I change the publication for local file access and network access settings, I tried to replace the mx:Image bound by a mx:SWFLoader tag, tag none of these work. I even tried to switch the compiler Flex setting - use network.

    All the other features seem to work in the loaded AS2 swf.

    I found many posts/articles as intercommunication between an AS3 Flex swf and loading AS2 swf, but it's not my problem. I need not communication, a few features.

    Thanks in advance for any idea!

    OK, once more, during 5 minutes walk away a problem proved to be invaluable. I started to think that maybe there is a known issue with loadMovie(). Even if I was trying to avoid to touch the source code of these sovereign wealth funds AS2, I decided that it would be useful to test replacing loadMovie() by MovieClipLoader.loadClip () statements.

    It works! Even if it means that all the old AS2 files that I need to load will have to be revised, it is much less of a task of migrating to AS3 or incorporation of the swf file of the child in the movie alone. I hope at least that this will save someone else the frustration of trying to do the same thing.

  • Load swf into a native window

    How to load an external swf into an external window? I use the following code, it works if I add the swf file at the stage of the original window, but not if I add it to the stage of the new window.

    import flash.display.NativeWindow;

    import flash.display.NativeWindowInitOptions;

    var newWin:NativeWindow;

    var init:NativeWindowInitOptions = new NativeWindowInitOptions();

    init. Resizable = false;

    init. Maximizable = false;

    init. Minimizable = true;

    function openWindow (): void

    {

    PvE = new NativeWindow (init); Initialize the Native window

    newWin.activate ();

    newWin.width = 800;

    newWin.height = 600;

    newWin.title = "my new first victory!"

    }

    openWindow();

    var swfLoader:Loader = new Loader();

    newWin.stage.addChild (swfLoader);

    var bgURL:URLRequest = new URLRequest ("file:///C:/Users/Siggy2xc/Desktop/Mass Media UI/Project/swf/standard.swf");

    swfLoader.load (bgURL);

    Yes, I tested with air 2.6, but your code should work for air 1.0 +.  I loaded a local swf using a relative path to the security settings are not relevant.

  • Flash player 10.3.181.14 broke my site, multiple loading of SWF files in a table

    I load several SWF files into an array, I have add and remove objects on the stage, it is a carousel.

    All locations of the items are set in xml format. If I only have one loaded in the table it works very well, if I have more so we have) play the swf file, or b) display the swf file.

    Sovereign wealth funds themselves contain code that trigger events in the main container. Causing other elements to play or load.

    Does anyone else have this problem?

    Hi howet,

    EDIT:

    I opened a bug of flash in their system of bug that I was able to reproduce the problem, I found: https://bugs.adobe.com/jira/browse/FP-7071

    There are workaround solutions I found there.

    ORIGINAL MESSAGE:

    I had a similar problem using a load component which I use for several years with no problems. As with you, the question arose when you load multiple SWFs (or even a swf, then a jpg file) on 10.3 and later. It works fine on 10.2 and below again.

    I found a solution that I'm looking for an appropriate response and it is to delay the subsequent charges using a setTimeout hacky.

    For example:

    protected function manageLoaded (p_event: Event): void {}

    setTimeout (loadNext, 1);

    following line breaks the loaded SWF stop.

    loadNext();

    }

    I hope this help you, let me know.

    See you soon,.

    Dan.

    Post edited by: Dan Wilkinson, 06/01/2011 11:37 CEST (GMT + 1)

Maybe you are looking for

  • E gift card

    I bought a gift card of e from the app store, always the card is not received at the receiver. Although, in the status of the order in app store shows as "sent email". How should I go to apple on this. Help, please.

  • OfficeJet PageWide Pro 477dw: Officejet PageWide Pro 477dw D3Q20B drivers for Mac?

    Where can I download HP PageWide Pro 477dw D3Q20B drivers for Mac? 'HP Easy Start' is no solution.I need to install on 30 laptops. I can't click on Gui and wait for downloads on 30 machines. Driver is not included in El Capitan 10.11.6 updating. Empt

  • New XPS 13 cannot turn off Adaptive brightness

    I can't turn off Adaptive brightness on the i5 HD 5500 1080 p on new XPS 13 version. Once I consult a dark page, the screen turns off, and when I discover a brilliant page, the screen will get brighter. It's extremely embarrassing, and all the option

  • Mixture of software Blackberry blackBerry for Z3

    Dear all, Introduction of the Blackberry mixture is a very good decision. With, I hope that we can access our balckberry devices completely. But why is that it is limited to the Passport only. I am tired with Z3 it did not work. Z3 is also a recent i

  • Hourly alarm of blackBerry Smartphones

    Hello, you please help, I have this irritating alarm that goes off every hour, I don't know what I did. I know this has something to do with the appointments on my calendar, I can't remove it. Also when I go on the clock icon, I have two faces of the