Load SWF inside the [AIR] naviteWindow

Hello

I have an AIR application where I need to load a SWF file from a server.

At some point, the user will click on a button and this button will create a new nativeWindow.

Inside this nativeWindow, we have a reference of the scene.

I want to just load a SWF file, addChild for the stage and be happy!  : PEI

But I get this error:

SecurityError: Error #2070: Security sandbox violation: caller http://somewhere.com/swfapp.swf cannot access Stage owned by app:/Teste.swf.
at flash.display::Stage/get stageWidth()
at com.swfapp::MainClass/initApp()
at flash.display::DisplayObjectContainer/addChild()
at flash.display::Stage/addChild()
at NativeWindowSWFLoader/loadSWFURLComplete()[C:\Users\hats\Desktop\teste\NativeWindowSWFLoader.as:93]

I use a normal charger:

private function loadSWFFromURL():void
{
          var context:LoaderContext = new LoaderContext();
          context.applicationDomain = ApplicationDomain.currentDomain;
          context.securityDomain = SecurityDomain.currentDomain;
          context.allowLoadBytesCodeExecution = true;
          context.allowCodeImport = true;

          loaderSWFURL = new Loader();
          loaderSWFURL.contentLoaderInfo.addEventListener(Event.COMPLETE, loadSWFURLComplete);
          loaderSWFURL.load(new URLRequest(urlSWF));
}

private function loadSWFURLComplete(e:Event):void 
{
              //var loaderInfo:LoaderInfo = LoaderInfo(e.target);
              //var byteArray:ByteArray = loaderInfo.bytes;

               this.stage.addChild(loaderSWFURL);
}

Can someone hep me on this?

Thank you.

you need a file permissions cross-on you domain somewhere.com using the loader class.

or you can use the HTMLLoader class without one:

var htmlLoader:HTMLLoader = new HTMLLoader();

htmlLoader.width = stage.stageWidth;

htmlLoader.height = stage.stageHeight;

htmlLoader.load (new URLRequest ("http://somewhere.com/swfApp.swf"));

addChild (htmlLoader);

Tags: Adobe Animate

Similar Questions

  • cannot package animation swf inside the AIR application with API-ad-hoc of the target

    I have included a small animation today in my AIR application using a clip from movie to swf as below

    private var myLoader:Loader = new Loader();  animation connection

    private var url: URLRequest = new URLRequest("..) /.. /.. (' / data / ConnectingAnim.swf ');

    ... code to add the loader and position

    It works fine when I deploy on my device via USB, but when I try to package for ad-hoc distribution, the ipa resulting isn't fair. The screen with the animation is broken.

    I'm guessing that the packaging for the app store is probably broken too.

    Am I missing something?

    Thank you!

    Post edited by: mu.a

    You must use a loader context, unless you use the interpreter mode. Read this article:

    http://help.Adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204 - 7de0.html

    You want the context.applicationDomain = ApplicationDomain.currentDomain;  variation.

  • Loading the SWF in the AIR for iOS

    Hello

    I'm working on a project in the AIR for iOS.  It's great that we, flash developers are now able to compile our code actionscript for iOS.

    The project that I am working on is divided into different SWF files.  There is a main SWF file that loads the others if necessary.

    Now I can't get a working swf file loading.  The only thing I see is the background of the child being displayed, but then the program freezes and no child actionscript code is exectuted.

    Children SWFs are loaded with a simple charger:

    var loader: Loader = new Loader();

    childLayer.addChild (loader);

    var url: URLRequest = new URLRequest ("child.swf");

    loader.load (url);

    When I post the main swf file I include children swf files in the package.

    Is it really possible to use several swf in your iOS projects?
    And what are the limits for this?

    Thank you.

    greeting,

    Bert

    Yes, it is possible to include any swf in your main application, but your external swf should not contain action script code. Just you can have graphics, symbols, textfield etc on the timeline, but with no timeline script.

  • Its inhibition in a loaded swf to the main swf

    I have a swf file that I'm loading and I need to be able to cut the sound of these soundChannels in the keyframes inside the other swf file.

    I have a mute button that I am activating / deactivating its visibility on and outside, one for a mute for the sound. I need to be able to access the audio clip in the external swf file. Any ideas?

    Thanks in advance.

    the best way to proceed is to use the correct path/name to your sound instance.  a popular sloppier way to use:

    SoundMixer.stopAll ();

  • SWF inside the Accordion widget Muse continues to play when you click on another tab.

    I placed a swf inside a Muse Accordion widget. I would like that to stop and return to the beginning, when I click on a button on the widget. Is this possible? Thank you... and besides, I can do a bit of copy and paste javascript, but I'm not a coder.

    Please try to use the composition with video container.

    Thank you

    Sanjit

  • Problem loading swfs to the server group.

    Hi all

    I have a SWF that has dependent files, and it does not load on the server so that it plays. It plays on my computer when I click on the index.html file that accompanies the swf file that I want to play, but not when I load it on the server for my web site.

    The file I was sent to load on the server includes

    a subfolder with the swf file that I need to play, but also

    an index.html file,

    a file menu.swf

    a file debug.swf

    a file exit.swf and

    an AC_RunActive Content.js file.

    Everything on the site, no matter what path I'm going to get there, loading appears a white screen. The files are there on the server, I can see them, and the size of the file is the same as on my local machine, so I think they have loaded correctly, they just don't play. The closest I've seen is when I make the path to the menu, but a progress bar appears for the menu and he never finishes loading.

    I don't do flash files myself, so I don't even think that I have the vocabulary to ask the right questions. Y at - there a name for this kind of grouping of files (as described above)?  How can I load it on the server so that it plays?

    I work in a Dreamweaver site. I don't know if the problem is how I do the path in Dreamweaver or how I'm loading the files on the server... or something else. I tried to ask this question in the Adobe Flash forum and they sent me here.

    Help!

    P.S. I have other .swf online files that work very well, but these are independent files that have all of these files are associated with them.

    The link in question is the BCBS button on this page

    http://skillbridgetraining.com/custom-training-Temp2.shtml

    Thanks in advance for your help.

    Too bad! It was a problem of capitalization in the code. Apparently, the one who built this ravises thing halfway through and had the menu in the Menu somewhere.

  • Control loaded swf on the main timeline

    Hello

    I'm working on loading external swf files for ios. I am able to load swf files and assembled visible or invisible in different settings. I have trouble controlling the swf files loaded on the main timeline. Specifically, I would like to have a button on the main timeline, that when you click on will move a swf loaded to frame 1.

    Here is a code that loads a swf file:

    var myLoader1:Loader;

    var loaderContext1:LoaderContext = new LoaderContext (false null, ApplicationDomain.currentDomain),

    if(myLoader1 == null)

    {

    myLoader1 = new Loader();

    addChild (myLoader1);

    }

    myLoader1.load (new URLRequest("folder/file1.swf"), loaderContext1);

    myLoader1.visible = true;

    backbutton.addEventListener (MouseEvent.MOUSE_DOWN, backbutton1);

    function backbutton1(myEvent:MouseEvent):void {? myLoader1.gotoAndStop (1) ;}}  (this line does not work)

    (Once I load file1.swf, in the file1.swf I click a next button to move on to different periods.) My question is: hHow do I code the "backbutton" on the main timeline so that it causes the file1.swf to go to frame 1?)

    Thank you for your help.

    After loading is complete (and assuming that you load an as3 swf), you can use:

    MovieClip (myLoader1.content) .gotoAndStop (1);

  • Problem loading swf on the page-desperately need help html.

    I recently made a website (www.doneanddone.co.nz) that has two sovereign wealth funds on him. The first is a sound swf that works perfectly, but my another swf is a video swf that runs again and again does not appear now, I have loaded on my host.

    I just get this error message-

    SecurityError: Error #2148: SWF file http://www.doneanddone.co.nz/images/kissCouple.swf cannot access local resource C:\Users\Frazer\Desktop\

    Files\iStock_000011299333Small Office We.mp4. Only SWF files local local - with system files and trust can access local resources.
    at flash.net::NetStream/play()
    to fl.video::VideoPlayer /http://www.adobe.com/2007/flash/flvplayback/internal::_play()
    to fl.video::VideoPlayer /http://www.adobe.com/2007/flash/flvplayback/internal::_setUpStream()
    to fl.video::VideoPlayer /http://www.adobe.com/2007/flash/flvplayback/internal::_load()
    at fl.video::VideoPlayer/load()
    at fl.video::FLVPlayback/doContentPathConnect()

    I did my swf using the video import wizard and adding an actionscript loop.
    Could someone help me?

    In the fla file, there must be sonething that is encoded in order to call this address.  You must go through the code in the file and find it.  If you used a FLVPlayer, check the \parameters put in place for this in the properties panel.

  • Load swf to the last image

    Hello

    I have several files SWF is meant to be read in order (like a book). I can load the previous swf file, but I need to go to the last image. Is this possible with the code that I have?

    lastPage2.addEventListener (MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_1);

    Import fl.display.ProLoader;

    var fl_ProLoader_1: ProLoader;

    var fl_ToLoad_1:Boolean = true;

    function fl_ClickToLoadUnloadSWF_1(event:MouseEvent):void

    {

    If (fl_ToLoad_1)

    {

    fl_ProLoader_1 = new ProLoader();

    fl_ProLoader_1.load (new URLRequest ("CEAS_I_1_16.swf"));

    addChild (fl_ProLoader_1);

    }

    on the other

    {

    fl_ProLoader_1.Unload ();

    removeChild (fl_ProLoader_1);

    fl_ProLoader_1 = null;

    }

    fl_ToLoad_3 =! fl_ToLoad_1;

    }

    It doesn't work at all, but I could find another code that you suggested on another thread: go to a specific external swf image

    It worked!

    var loadmod2:Loader;

    lastSection.addEventListener (MouseEvent.CLICK, loadlast);

    function loadlast(e:MouseEvent):void

    {

    {if(!loadmod2)}

    loadmod2 = new Loader();

    loadmod2.contentLoaderInfo.addEventListener (Event.Complete, loadCompleteF);

    }

    loadmod2. Load (new URLRequest ("CEAS_I_1_16.swf"));

    }

    function loadCompleteF(e:Event):void {}

    addChild (loadmod2);

    MovieClip (loadmod2.content), .gotoAndPlay (33);

    }

  • How a loaded swf sets the height and width of the scene?

    I have a parent swf that loads another swf (this is for a customer).  Dimensions of the stage of the parent swf don't match the child.  How the adjustable child the dimensions of the stage?

    I tried this after the child was loaded, but it does not work:

    stage.scaleMode = StageScaleMode.NO_SCALE;

    stage.stageWidth = 700;

    stageHeight = 600;

    Thank you!

    Flash can not set the size degree. You must call JavaScript to change the size of the object Flash via ExternalInterface.

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Load swf of the directory of the local machine

    I'm hoping to get an answer less confusion than the white papers on this site. I'm working on creating a Web site for my church. We want to include an introduction small swf. Our meeting space has no internet connectivity, etc, so I can't show the progress of the development group, etc. other than the site running from my laptop. The film, of course, will not load on my local disk.

    I added the file, the SWF, the URL when I open it in my browser firefox, etc to the security manager and player-coach. Still nothing.

    Can anyone offer some advice on workaround? Obtain an internet connection (wireless) is in the plans, but he won't be in place for a few weeks but I need workaround for tomorrow night.

    TIA!

    Please do not take into account. I suddenly had a flash (no pun intended) of shine and it works now. :) Thank you!

  • access loading swf movieclip classiquee on as3

    Hi, I use external swf files add skins to an application. Currenlty, I'm loading elements isolated successfully by using the Loader class. However, now I want to load a more complex structure of skin that will have some movieclips already placed on the stage of the loaded swf. The question is: when I insert a swf athe edit that day, I placed a few elements on stage and that he gave them instance names, how can I access this external swf movieclip structure? It is something like this:

    1. first of all, I create the external file by placing some items on its stage, naming instances of these elements, such as 'console_bar' and 'console_button '.
    2. then I load this swf using the Loader class (in a magazine called "playerConsole", for example) and, when he finished loading I try to access the items placed on stage:

    this.addChild (playerConsole);
    playerConsole.console_bar.x = 0; won't work no-how can I access this instance?

    mount the content as a movieclip.

  • To access the elements of the scene, via a SWF file that is loaded inside the scene

    -J' I A.fla.

    -A.fla includes buttons, video clips and also B.swf is loaded in A.fla with a CHARGER

    -I want to access the elements in A.fla, from codes actionscript inside B.fla to change these video clips and buttons based on the actions going on in B.swf

    for example, lets say there is an X button in A.fla and there is a button there B.fla, B.swf is loaded into A.fla, and I want the key Y to delete X when you click the button.

    General question: to access the elements in a stage, via a file SWF loaded in this stage.

    This is a way silly to explain: there is this pregnant mom, a child is loaded inside him, now, I want the codes inside the child, access to MOM

    elements, such as lets say, I want the code of the child can make the eyes of MOM flashing faster. logically there is something inside something else, but I want to have access to the bigger picture of what is loaded. I hope I can get my point across.

    I repeat what I replied to your other psoting for this same question and adding just a little bit more...

    If you load a swf into another using the Loader class, then the charger itself is the parent of the loaded swf file, so MovieClip (parent.parent) could help you target the timeline that the charger was born.

    The way to have a loaded file to speak to a parent file is through the sending of events that the parent assigns headphones for after the file has been loaded.  Here is a link to an announcement that could help explain how to implement this.

    http://forums.Adobe.com/thread/470135?tstart=120

    And here's a quick example...

    Example:

    Add something to raise the event in the child:

    dispatchEvent (new Event ("eventTriggered"));

    In your SWF to loading/parent, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf file.

    triggered when external swf loading event handler
    function loaderCompleteHandler(event:Event) {}
    (event.currentTarget.content as MovieClip) .addEventListener ("eventTriggered", eventHandler);
    }

    function eventHandler(event:Event):void {}
    trace ("event sent in loaded swf");
    }

    So in your A.swf, you should have the other event and functions of event handler that would take care of control buttons.   Event listeners could be assigned to the B.swf after that that it has loaded.  In your B.swf you just have it dispatches an event and the A.swf manage self adjustments you need taken care of.  This allows the two files to be independent of each other on a functional level.

    Regarding the buttons that you want to disable, you can either use the removeEventListener() method to remove the listeners you have assigned, or you can set the mouseEnabled property to false, or you can set the visible property to false.

  • Removal of the external loaded swf does not decrease memory

    I'm developing a desktop application using flash builder 4.7, where I am loading swf external swf main, but after his withdrawal, it remains in the process (check in the Task Manager. os: windows 7), process decreases a little, but not as much as it should be. so, whenever I insert again and remove, process increases and after multiple loading, application crash down. I'm removing it like this

    if (_loader.numChildren>0)

         _loader.removeChildren(0,_loader.numChildren-1);

    _loader.unload();

    _loader.stopAllMovieClips();

    _loader.unloadAndStop(true);

    _loader.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

    this.removeChild(_loader);

    _loader = null;

    I have added custom destroy the external inside swf method and started calling him. I was almost everything, remove (almost say because it might be something I missed, because it's huge project) but still the long process.

    That I created empty swf (new project without code and nothing in it) and tried to integrate and to see what is happening. It was just the same...

    Then I thought again Air SDK may have solved this problem, so I've updated SDK for 19.0.0.207 currently more recent, but still nothing, even if the process now increases above.

    I think that it comes to Flash gc. One of the solutions is to have one and only instance of swf external and removeChild and addChild it whenever you need. It is a bad way to do it. Process will not increase all the time, but in my case I have many SWFs to load and it will slow down my request for computers of RAM low resources it could cause the crash and it is bad to have unnecessary things running in the background process

    so any suggestions are welcome

    No need to stop the video clips and remove... use unloadAndStop() and it will all stop and unload the file... as it is not possible to call the content of charger (clips) stop after the unload method, it is already removed... So, try to use only 3 lines only to unload the file.

  • Loading of a flashwebsite within the AIR on IOS

    I had a curious ability thought to load a window inside your air application that loads a site in flash based on an ios device.  I know that you can not view websites in flash on safari with ios.

    The only thing I've tried so far is to use stagewebview to load a flash site, but it does not display flash content.

    So my question would be: are there any other options to load a site within your air application that will display the flash content?

    The WebView that uses StageWebView is the same thing that Safari uses, so restrictions that are true in Safari are also true in StageWebView. Also, you cannot load and run code is it an external swf on iOS. So, overall, it's not a way to do what you want, other than just doing it on Android.

Maybe you are looking for

  • about connection iPod video car

    I have an old video of ipod. I connect it to my car with a usb adapter that is due to the fact battery will not hold a charge. He however repeat myself "ok to disconnect" on the screen even if it will play the music. I have to unplug the unit to see

  • Battery monitoring software shows 0% of costs - Satellite 1900

    My Satellite 1900 ceased to charge the battery. It works very well on sector and says he is in charge, but when you check the Xantrex battery it says 0% fees. Up to this point, the battery appeared well with use of 1-2 hours to charge. Is this a prob

  • iTunes 12.3.2.35 can't reorganize non-smartlist playlist songs

    So I just realized that I can't re - order songs in my Playlist. I tried to quit Itunes and restart to see if it was a software problem. I went to Edit playlist and I can't rearrange songs here either. I created a Playlist, added new songs and who do

  • Internet connection bravia kdl - 42w

    The TV to connect to wi - fi but cannot find internet. I have a connection with password. What to do.

  • Cannot open hidden flles dxb & wab

    I received a response to my question, but I can not always open hidden files. Robert Clarkxt