Problem loading one SWF into another in Flash AS3

I am trying to load an SWF file in another SWF file. The child SWF file works fine when run standalone like if I set visibility of an item to true or false, it works fine. But when the SWF is loaded into a parent SWF, I am not able to execute such commands, neither I get any errors...

are both swfs as3 swfs?
is the code in the loaded swf and is that code referencing objects in the loaded swf?

Similar Messages

  • Preserve frame rate when loading one swf into another

    Is there a way to preserve the frame rate of a swf when
    loading it into another swf that plays at a higher frame rate. I'm
    loading some flash ads that mostly run at around 12-15 frames a
    second into a portfolio site that runs at around 40 frames per
    second. All my ads play too fast. The link is:
    www.dg8tal.com/portfolioidea.html
    Thanks!

    As far as I understand it, there is no option to override the
    frame rate designated by the main movie you are loading into. The
    SWF file you are loading always inherits the framerate of the SWF
    you are loading it into. Here are some suggested work-arounds that
    might help:
    1) Lower the frame rate of the main movie on the website that
    you are loading into.
    2) Expand the timelines of the advertisements just for use in
    your portfolio
    3) Put your menu and thumbnails in one HTML frame that can
    then load each item in another HTML frame above it. Since each SWF
    would load on its own, the framerate of your main swf would not
    matter. You would lose your nice resizing effect though unless you
    did some more complicated integration with javascript I imagine.
    I would recommend going with option 2, since that will take
    the smallest amount of work while preserving your overall design.
    However, with the faster framerate, your advertisements would have
    difference performance characteristics that you'll need to assess.
    I'm trying to think of more options, but these seem to be the
    first things that come to mind.

  • Load one swf after another?

    Hey!
    I've created a presentation in Flash that exceeds the maximum number of frames. I broke it up into a few different files, and now I need these .swfs to load one after another automatically, without prompting or clicking anything on the screen.
    The presentation is for an interpretation program at work and will be played for an audience several times a day. It was originally a 6-slide-projector presentation that I simplified, and this is the last step to replacing the old projection system altogether.
    Does anyone know how to solve my problem, as simply as possible?
    Thank you!

    you'll probably want to load them all at the start of you presentation so they're ready for display without waiting.
    so, use standard preloader code to load your swfs.  use a loop or dispatch an event to detect when one ends and another needs to start.

  • Problems loading Flex3 swf into AIR app

    This is a challenging problem that I have reduced down to the
    bare minimum and it is still reproduceable. I have built a minimal
    AIR application and added a SWFLoader to it which loads a SWF file
    named "Junk.swf" using an absolute path.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" title="Hello World">
    <mx:Style>
    WindowedApplication {
    background-color:"0x999999";
    background-alpha:"0.5";
    </mx:Style>
    <mx:SWFLoader
    source="C:/myProjectFolder/renderers/Junk.swf" width="100%"
    height="100%" />
    </mx:WindowedApplication>
    This works fine if I run the application from within Flex3,
    however when I build an installer, install the application to my
    windows vista system and execute it from the desktop the Junk.swf
    will not display. If I replace the Junk.swf with another SWF of the
    same name created in Flash CS3 then it will display properly when
    my test app is executed from either Flex or the desktop.
    The contents of the loaded SWF don't appear to be an issue
    since even the simplest of Flex3 SWFs fail to display.
    Interestingly when I add listeners to the SWFLoader to
    determine if any errors are happening no error events are sent, but
    I do receive both the INIT and COMPLETE events which tells me that
    the Junk.swf is found and loaded, just not displayed.
    Any assistance or even ideas that I could try would be
    appreciated.

    that's why i added those comments about the swf's domain.  for locally loaded swfs, 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 swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
    See below for 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 function assetPreview() {
      addEventListener(Event.ADDED_TO_STAGE, initialise);
      public function 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 function viewPreview(e:Event):void
      addChild(mainSWF);
      mainSWF.addChild(loader);

  • How do you load an swf into another FLA document

    Well, the headline pretty much says it all. I have gotten some swf files from another designer. I need  to show them in my presentation. I am using Flash CS3 for mac. Any advice would be helpful.
    Thanks,
    Rich

    I did find a tutorial on this. It was helpful. I am using Actionscript 3.0
    Here is the code I used and it works. Except, I need to load another one after this one. Basically it is like a slide show of swf files. I need to play 3 swf files after another without any interaction by the user.
    I am thinking I need to tell it to unload the first one and load the second one after the first one is finished and so on. I appreciate any advice.
    Rich
    var Xpos:Number=0;
    var Ypos:Number=0;
    var swf:MovieClip;
    var loader:Loader=new Loader();
    var defaultSWF:URLRequest=new URLRequest("swfs/dannon_1.swf");
    loader.load(defaultSWF);
    loader.x=Xpos;
    loader.y=Ypos;
    addChild(loader);

  • Need Your Help with Loading SWF into another Flash Movie!

    Hello,
    I have created TWO Flash movies. They work just fine
    individually, but I get problem when I put one into another one!
    The main Flash is a Menu and the second one if a Photo Album.
    The Menu is series of animation (Moving Objects) which finally
    comes into rest and create the menu. The photo album is another SWF
    file which is called with in the first Flash Movie (The Menu). The
    SWF file is loaded as follow into the Main Flash.
    MovieClip.prototype.drawRect = function(x, y, w, h) {
    this.beginFill(0xFF0000, 100);
    this.moveTo(0, 0);
    this.lineTo(0+w, 0);
    this.lineTo(0+w, 0+h);
    this.lineTo(0, 0+h);
    this.lineTo(0, 0);
    this.endFill();
    this._x = x;
    this._y = y;
    this.createEmptyMovieClip("mc6", 6);
    mc6.lineStyle (3, 0x000000, 100);
    mc6.drawRect(-77, -17, 20, 20);
    mc6._xscale = 100;
    mc6._yscale = 100;
    loadMovie("photoAlbum.swf", mc6);
    Problem arises when I click on the Play Button of the
    photoAlbum.swf (Photo Album) since the execution of the play button
    causes the Flash starts once again from the beginning of the entire
    Flash Movie (Beginning of the animation creating the menu) and it
    simply jumps into the Firm One of my Flash Movie.
    Could you tell me how I can isulate what is in layer 6 (Where
    the photoAlbum is loaded to) from the rest of my Flash Movie?
    I hope I managed to explain my problem. I would like to take
    this opportunity to thank you in advance for your help.
    Cheers,
    Babak

    Hello Anya,
    I have realized the problem arises from the Wait Function
    which causes the Photo Album to pause for a period of time (Two
    Seconds) once a Photo is fully displayed (I have Fade in/out Photo
    Album). I realized everything works OK once I remove the function
    and rather left the Photos to be flipped without any pausing (This
    is an Auto-loading Album which simply Flips the photos!).
    Here is the Wait Function which is causing all the trouble.
    function wait()
    stop();
    var myInterval = setInterval(function ()
    play();
    clearInterval(myInterval);
    }, 2000);
    Thank you so much for your help.
    Cheers,
    Babak

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • Flash player 10.3.181.14 broke my site, loading multiple swfs into an array

    I load multiple swfs into an array, I add and remove the objects on the stage, this is for a rotating carousel.
    All the items locations are established in xml. If I only have one item loaded into the array it works fine, if I have more then one it will not a) play the swf, or b) show the swf.
    The swfs themselves contain code that fire events in the main container. Which cause other items to play or load.
    Is anyone else having this issue?

    Hi howet,
    EDIT:
    I've opened a flash bug in their bug system as I found I could reproduce the issue: https://bugs.adobe.com/jira/browse/FP-7071
    There are some workarounds I found on there.
    ORIGINAL MESSAGE:
    I was having a similar issue using a loading component which i've been using for several years with no issues. As with you the issue arose when loading multiple swfs (or even one swf and then a jpg) on 10.3 and above. It works fine on 10.2 and below still.
    I found a workaround whilst I look for a proper answer and that is to delay subsequent loads using a hacky setTimeout.
    For example:
    protected function manageLoaded (p_event : Event) : void {
    setTimeout(loadNext, 1);
    // following line breaks the gotoAndStop of loaded swfs.
    // loadNext();
    I hope this helps you too, let me know.
    Cheers,
    Dan.
    Message was edited by: Dan Wilkinson, 01/06/2011 11:37am BST (GMT + 1)

  • I have a problem, I had to reload my hard drive, I didnt erase it, I load xp pro into another folder(windows2) and everything(files) remained in regular(corrupt) windows folder. System32 error came up and corrupt it and it couldnt load the os. I want to

    I have a problem, I had to reload my hard drive, I didnt erase it, I load xp pro into another folder(windows2) and everything remained in regular windows folder. System32 got corrupt and it couldnt load the os. I want to be able to bring my bookmarks over from windows into current windows2, how do I do it.

    See this:
    http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile

  • Passing variables from one swf to another

    I am facing problem to pass variable from one swf to another.
    I am using loadMovie to load another swf. how can I pass a variable
    value to another swf. Can anyone help me plz? It is somewhat
    urgent.
    thanx in advance.

    first of all:
    this is the Flash Media Server and your problem is not
    related to FMS....
    second thing related to the "somewhat urgent" :
    we, users on this forum, are not there to do your job... so
    calm down otherwise no people will answer your question. This forum
    is a free support forum that community of Flash developer use to
    learn tricks and to solve problems.
    Possibles solutions:
    If the two swf are seperate you can use LocalConnection to
    establish a connection between different swf.
    If you load a second swf into the first one you can interact
    like a standard movieClip(only if there from the same domain or if
    you a policy file on the other server)
    You can use SetVariable(via Javascript) to modify a root
    variable on the other swf and check with an _root.onEnterFrame to
    see if the variable had changed in the second swf.
    * MovieClipLoader will do a better job, in your specify case,
    than the loadMovie. Use the onLoadInit event to see when the swf is
    really totaly loaded into the first one otherwise you will have
    timing issues.
    My final answer(lol) is the solution 2 with the
    notice(*)

  • Problem Loading a SWF

    I want to load a SWF form another SWF and a have one error:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at MoverBall$iinit()
    Any help?
    here is the actionscript code:
    package {
    import flash.display.*;
    import flash.events.*;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.geom.Point;
    public class MoverBall extends MovieClip{
    private var gameSprite:Sprite;
    private var ball:Ball2;
    private var xpos:Number = 0;
    private var ypos:Number = 0;
    private var zpos:Number = 0;
    private var vx:Number = 0;
    private var vy:Number = 0;
    private var vz:Number = 0;
    private var friction:Number = .95;
    private var fl:Number = 250;
    private var vpX:Number = stage.stageWidth / 2;
    private var vpY:Number = stage.stageHeight / 2;
    public function MoverBall(){
    // INICIALIZAR SPRITE
    gameSprite = new Sprite();
    ball = new Ball2();
    stage.addChild(gameSprite);
    gameSprite.addChild(ball);
    addEventListener(Event.ENTER_FRAME, onEnterFrame);
    stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
    function onEnterFrame(event:Event):void{
    xpos += vx;
    ypos += vy;
    zpos += vz;
    vx *= friction;
    vy *= friction;
    vz *= friction;
    if(zpos > -fl){
    var scale:Number = fl / (fl + zpos);
    ball.scaleX = ball.scaleY = scale;
    ball.x = vpX + xpos * scale;
    ball.y = vpY + ypos * scale;
    ball.setCentro(new Point(ball.x+10, ball.y+10));
    ball.visible = true;
    else{
    ball.visible = false;
    function onKeyDown(event:KeyboardEvent):void{
    switch(event.keyCode){
    case Keyboard.UP :
    vy -= 1;
    break;
    case Keyboard.DOWN :
    vy += 1;
    break;
    case Keyboard.LEFT :
    vx -= 1;
    break;
    case Keyboard.RIGHT :
    vx += 1;
    break;
    case Keyboard.SHIFT :
    vz += 1;
    break;
    case Keyboard.CONTROL :
    vz -= 1;
    break;
    default :
    break;
    function getBall(){
    return ball;
    And the code in my FLA is:
    // Request the content
    var url:URLRequest = new URLRequest("Ball2.swf");
    // Create a loader object
    var loader:Loader = new Loader();
    // Load the content
    loader.load(url);
    // Add loader into the Display List
    addChild(loader);

    here is the code of Ball2
    package {
    import flash.display.Sprite;
    import flash.geom.Point;
    import flash.display.*;
    public class Ball2 extends MovieClip{
    private var centro:Point;
    private var aux:int;
    public function Ball2(){
    graphics.beginFill(0xff0000);
    graphics.drawCircle(0,0,10);
    graphics.endFill();
    this.x=100;
    this.y=100;
    centro = new Point(this.x+10, this.y+10);
    aux=1234;
    public function getCentro(){
    return centro;
    public function getVar():int{
    return aux;
    public function setCentro(c:Point){
    centro=c;
    }

  • One swf to another

    I don't know if this can be done but here it goes. I have 2
    flash anamation on my site. Both have several scenes in them. My
    question is? When linking over from one swf. to another. Can you
    script it to start at a specific scene or must you start at the
    begining of the swf.
    Thanks

    from the loaded swf's main timeline:
    MovieClip(parent.parent)
    will reference the timeline to which the swf's loader has been added.  so, to reference a variable (eg, scoreVar) on that timeline, use:
    MovieClip(parent.parent).scoreVar

  • ABAP Function Module Example to move data from one Cube into Another

    Hi experts,
    Can any please help out in this ..?
    A Simple ABAP Function Module Example to move data from one Cube into Another Cube
    (How do i send the data from one client to another client using Function moduel).
    Thanks
    -Upen.
    Moderator message: too vague, help not possible, please describe problems in all technical detail when posting again, BI related? ("cube"), also search for information before asking.
    Edited by: Thomas Zloch on Oct 29, 2010 1:19 PM

    This is the start routine to duplicate records in two currencies.
    DATA: datew   TYPE /bi0/oidateto,
          datew2  TYPE rsgeneral-chavl,
          fweek   TYPE rsgeneral-chavl,
          prodhier TYPE /bi0/oiprod_hier,
          market  TYPE /bic/oima_seg,
          segment TYPE /bic/oizsegment.
    DATA: BEGIN OF S_DATA_PACK OCCURS 0.
            INCLUDE STRUCTURE /BIC/CS8ZSDREV.
    DATA: END OF S_DATA_PACK.
    S_DATA_PACK[] = DATA_PACKAGE[].
      REFRESH DATA_PACKAGE.
      LOOP AT S_DATA_PACK.
        move-corresponding s_data_pack to DATA_PACKAGE.
        if DATA_PACKAGE-loc_currcy = 'EUR'.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalgrc.
          DATA_PACKAGE-CURRENCY = 'USD'.
          APPEND DATA_PACKAGE.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalloc.
          DATA_PACKAGE-CURRENCY = 'EUR'.
          APPEND DATA_PACKAGE.
        else.
          DATA_PACKAGE-netval_inv = DATA_PACKAGE-/bic/zsdvalgrc.
          DATA_PACKAGE-CURRENCY = 'USD'.
          APPEND DATA_PACKAGE.
        endif.
      ENDLOOP.
    This is to load Quantity field
    RESULT = COMM_STRUCTURE-BILL_QTY.
    This is to load Value field
    RESULT = COMM_STRUCTURE-NETVAL_INV.
    UNIT = COMM_STRUCTURE-currency.

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

Maybe you are looking for