Load AIR swf in browser

Hi,
Is it possible to load a AIR swf in browser
without creating a new flex application that load that AIR swf?
Best Regards,
Mihai

The only thing that really matters is whether important APIs are available in the runtime.  I can write a swf that draws a bunch of circles and it will run in both AIR and the browser.  But then it isn’t that useful for AIR, so I start using AIR APIs and then it won’t run in the browser because those APIs aren’t available in the browser players.
You could design your AIR app as two pieces: an AIR shell that does AIR things, and a sub-SWF that doesn’t make any assumptions about AIR APIs.  That sub-SWF then has a better chance of running in the browser.

Similar Messages

  • AIR.SWF in-browser API is broken with FP 11.2

    The AIR.SWF in-browser API, as documented here:
    http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-1c6efe05128cca667e7-8000.html#WS5 b3ccc516d4fbf351e63e3d118666ade46-7cd2
    is no longer working. It reports that AIR isn't installed when it really is.
    I've filed a bug for this here:
    https://bugbase.adobe.com/index.cfm?event=bug&id=3062591

    LocalConnection will only work between two applications running on the same machine.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/LocalConnecti on.html
    "LocalConnection objects can communicate only among files that are running on the same client computer, but they can be running in different applications — for example, a file running in a browser and a SWF file running in Adobe AIR."
    If you need to communicate between an app running on an iOS device and a swf in a browser on a computer look into the ServerSocket Class:
    http://help.adobe.com/en_US/air/reference/html/flash/net/ServerSocket.html
    Works a little differently than LocalConnection but will allow connections between two different physical devices (ie: 2 computers, a computer and a mobile device, 2 mobile devices, etc).  Since the iOS device uses the air runtime stuff it should have access to the ServerSocket Class while the browser swf can use a standard Socket to connect to the iOS device.

  • Working with badge.swf and air.swf (browser api)

    I basically want to install and run my app through the
    browser so ive been testing but can't manage to figure out how the
    air.swf api works. i am stuck at loading air.swf. the page below
    has a tutorial but a downloadable sample code would be perfect, not
    sure where the little snippets of code from the "Loading the
    air.swf file", "Checking from a web page if an AIR application is
    installed", "installing an AIR application from the browser", and
    "Launching an installed AIR application from the browser" go in my
    own codebase. Also im a bit unclear on where i get appid or
    developer id. if someone has an example app or more in-depth
    explantion of incorporating the given code , i would much
    appreciate it.
    http://livedocs.adobe.com/flex/3/html/help.html?content=distributing_apps_3.html

    quote:
    Originally posted by:
    cjm771
    can't manage to figure out how the air.swf api works
    The main thing you must understand about air.swf
    is that its most important functionality can only be called from
    within a UI event handler, such as for a button click. It's very
    picky about this. You can't, for example, use the button click
    event handler to begin the loading of air.swf, then in the "loaded"
    callback do the air.swf API call. air.swf has to be loaded and
    ready at the time the event handler is called. So, load it on app
    startup. I even go to the extent of disabling the buttons that call
    into air.swf until it's loaded.
    quote:
    im a bit unclear on where i get appid or developer id
    The appid is your application's unique ID, which
    you gave in setting up your project. Adobe recommends using
    something based on your web site's domain name, in reverse order as
    is done in Java and Objective C. If you're at foo.com, and call
    your program Qux, then com.foo.qux is a good appid. The use of
    domain-like names helps ensure that programs from different
    companies don't collide with each others' namespaces.
    By default, the pubid is a random number assigned by the IDE.
    I forgot how you find out what number it used, just that there's a
    way. Or, you can assign it yourself, in the project settings for
    the AIR app. Right-click the project, go to the Run/Debug Settings
    section, edit the launch configuration for your AIR app. You'll
    find a Publisher ID field there. The documentation for ADL may be
    helpful for picking your own pubid.
    quote:
    if someone has an example app or more in-depth explantion of
    incorporating the given code , i would much appreciate it.
    See my code in this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=75&catid=697&threadid =1352505&highlight_key=y&keyword1=air%2Eswf

  • Communication problem between air application from swf at browser

    Hi,
    I am trying to communicate adobe air native application from brwser using swf, I check for native application installed or not. If installed then launch and if not then install and launch.
    I am facing problem when browser crashes and communication get lost with adobe air native application. And when user restart web browser and try to make local connection for communication with native application, some times it get failed. so, how to handle this state please help.
    Thanks
    Nitesh Kumar

    Hi sinious,
    How could I clean up connection when browser is aborted or lost?
    below you can find the code snippet to check for air application and connection
    airSWFLoader = new Loader();
                                  loaderContext = new LoaderContext();
                                  loaderContext.applicationDomain = ApplicationDomain.currentDomain;
                                  airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
                                  airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),loaderContext);
    function onInit(e:Event):void 
                                  airSWF = e.target.content; 
                                  switch(airSWF.getStatus().toString())
                                            case "available" : AirLoaderStatus = 1;
                                            break;
                                            case "unavailable" : AirLoaderStatus = 2;
                                            break;
                                            case "installed" : AirLoaderStatus = 3;
                                            break;
    private function getAppStatus():void
                                  clearInterval(intervalIdentifier);
                                  if(AirLoaderStatus == 0){intervalIdentifier = setInterval(getAppStatus,1000);return;}
                                  m_launchInstallBtn.visible = true;
                                  var statusInfo:String = airSWF.getStatus();
                                  airSWF.getApplicationVersion(m_installerFileName, m_pubID, versionDetectCallback);
    function versionDetectCallback(version:String):void
                                  if (version == null)
                                            trace("Not Installed");
                                            // Take appropriate actions. For instance, present the user with
                                            // an option to install the application.
                                  else
                                            m_isPluginsInstalled = true;
                                            // Take appropriate actions. For instance, enable the
                                            // user interface to launch the application.
    private function onlickMouse(event:MouseEvent):void
                                  m_text.text += "\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:"+AirLoaderStatus;
                                  trace("\nm_isPluginsInstalled:"+m_isPluginsInstalled+":::AirLoaderStatus:" +AirLoaderStatus);
                                  switch(event.currentTarget)
                                            case m_launchInstallBtn:
                                                         if(AirLoaderStatus == 1)
           installAirsetup();
                                                      else
                                                                if(!m_isPluginsInstalled)
                                                                          airSWF.installApplication(m_url, m_runtimeVersion, m_argsToPass);
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                                                else
                                                                          airSWF.launchApplication(m_installerFileName, m_pubID, m_argsToPass);
                                            break;
    in the above code snippet I pass localConnection for send and recieve as an argument in m_argsToPass.
    the connection names strarts with "_".
    In the air application I I split the event arguments like given below
    argsArray = event.arguments.toString().split(",");
    and then try to establish connection.
    Please suggest, how could I clean the connection on lost/ abort of browser, since then swf object embeded in browser also get lost.

  • Adobe air swf file error in browser

    my fla file setting
    version: adobe air 1.0 actionscript 3.0
    i able to compile without problem and when i load the swf file in browser, if my actionscript included this line "import flash.filesystem.File". My flash just show up "blank" . no error in flashlog. if i removed this line, my swf file able to run. what is wrong?
    p/s: i embeded the air app as swf and open with browser

    You can't load SWFs published for AIR in a browser. The Flash plug-in does not recognize the extra AIR APIs like File.
    AIR SWFs can only be used as part of an AIR application.

  • AIR 3.6 & 3.7 Loading Remote SWF Crashes iOS on Property Read

    I have been trying out the feature in AIR SDK 3.6 that allows you to load local swf files with ABC.  This is working fine.  However, I am getting a crash on an iOS AOT build when I load a remote swf that does NOT have ABC and I try to read any property on that remote asset.  I have never had this problem with AIR 3.4.  The problem persists on AIR 3.7
    Below is a simple example to reproduce the problem.  The crash will occur immediately when it attempts to trace the "currentLabels" property of the loaded content.  I believe the property itself to be arbitrary --- the same crash will occur when reading any property.  In fact, you can even set a breakpoint before that line and in the Flash Builder debugger, if you try to expand the content's properties the app will crash.
    package
              import flash.display.Loader;
              import flash.display.MovieClip;
              import flash.display.Sprite;
              import flash.display.StageAlign;
              import flash.display.StageScaleMode;
              import flash.events.Event;
              import flash.events.ProgressEvent;
              import flash.net.URLRequest;
              import flash.system.ApplicationDomain;
              import flash.system.LoaderContext;
              public class MobileAppTest extends Sprite
      private const path:String = "https://s3.amazonaws.com/wowzers-dev/mobile/client/";
                        private var files:Array = ["art/common/LoadingScreen.swf"];
                        public function MobileAppTest()
                                  super();
                                  stage.align = StageAlign.TOP_LEFT;
                                  stage.scaleMode = StageScaleMode.NO_SCALE;
                                  loadNext();
                        private function loadNext():void {
                                  var loader:Loader = new Loader();
                                  var req:URLRequest = new URLRequest(path + files[0]);
      trace("\n>>> loading: " + req.url);
                                  loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
                                  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
                                  var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                                  loader.load(req, context);
                        private function onLoadProgress(evt:ProgressEvent):void {
                                  trace(evt.bytesLoaded + " out of " + evt.bytesTotal);
                        private function onLoadComplete(evt:Event):void {
                                  trace("<<< onLoadComplete " + evt.currentTarget.contentType);
                                  trace("=== currentLabels: " + evt.currentTarget.content.currentLabels);
    Am I doing something wrong?  Is this a known issue that will be fixed?
    So far I have tested this on an iPad 3 with iOS 6.1.3.
    Thank you.

    I was having the same problem using CS5.5 and AIR 3.7.  For me, the solution was to put a label in my main timeline and then call this.currentLabels in the main .as class.
    My app was crashing every time I called the "currentLabels" property from a custom class controlling a remote SWF.  I thought that it might have been a problem with the FrameLabel class not being imported at compile-time, so I tried placing a flash.display.FrameLabel reference in the main class.  This did not fix the problem.  Then I tried making an arbitrary call to the currentLabels property of my main timeline (all you need to do is reference it) and everything else worked fine.
    *edit*
    After a little further testing, it seems that you can place the reference anywhere (I put it in my custom class by calling theRemoteSWF.parent.currentLabels), but that you must have a label somewhere in the main timeline and call the "currentLabels" property of your main SWF before referencing the currentLabels of a child SWF

  • Fiexed! AIR 3.7 on ios load packaged swf problem

    I have fixed this, thanks. It's because this:
    <mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">
    Hi, nice guys
    Thanks for your time to watch my proble!
    I'm develop IOS App by AIR 3.7. I have seen this about load swf http://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air- apps-on-ios/  . Everything works fine in debug mode, but when I release it , everything is gone.
    I'm using AIR 3.7 in GPU renderer mode, and load SWF with some code. I have add LoaderContext.
    var l:LoaderContext=new LoaderContext(false, ApplicationDomain.currentDomain);
    l.allowCodeImport=true;
    When I debug in Fast mode, everything is ok, in Standard mode package get the Errors:
    Error occurred while packaging the application:
    java.lang.NegativeArraySizeException
              at com.adobe.air.ipa.SWFUtils.read(SWFUtils.java:205)
              at com.adobe.air.ipa.SWFUtils.inspect(SWFUtils.java:250)
              at com.adobe.air.ipa.SWFUtils.<init>(SWFUtils.java:181)
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:68)
    Exception in thread "main" com.adobe.air.InvalidInputException: Invalid input. Not a valid swf file
              at com.adobe.air.ipa.SWFSplitter.main(SWFSplitter.java:105)
    Compilation failed while executing : ADT
    When I use a empty project to load a test swf, get the Error:
    Main Thread (Suspended: Error: Error #3747: Multiple application domains are not supported on this operating system.)
    Anybody know how to fix this ?
    Thanks!

    i have same problem. but i did not understand where is this code? where should i look?
    """<mxmlc file="${SOURCE_DIR}/${APP_NAME}.${APP_EXTENSION}"
    output="${OUTPUT_DIR}/${APP_NAME}.swf"
    static-rsls="true" It's the problem
    accessible="true"
    configname="air"
    debug="${DEBUG_FLAG}"
    failonerror="true"
    fork="true"
    maxmemory="512m">""""

  • [advance question] loading a swf in adobe Air, which loads an image with "componentloader"

    Good evening all,
    I think this is a complex issue.
    I have adobe air application which loads a SWF I made.
    Inside this SWF I have used the "component LOADER" to load
    something with "ContentPath=image.jpg" for example.
    But the swf loaded in the Adobe air works, but does not load
    the "ContentPath image"...
    (it does load and display it when it this swf is run outside
    adobe Air)
    I need it to be dynamic like this, so if eventually I Include
    it in the package it won't help much...
    I just intend to replace an image background from this loaded
    swf file!
    Thanks!
    Edit:
    At this time of the editing, I fear and realize
    something....I have been using Actionscript2 for the .SWF file,
    could it be why it does not works???
    If its problematic, is there a simple way like telling it to
    read actionscript2, rather than transforming everything??
    edit2:
    I found this on the official AIR FAQ:
    Will Flash version 8 and below SWF files run in Adobe AIR?
    Yes. However, the Adobe AIR APIs are only exposed to Flash
    content via ActionScript 3 / AVM2, and thus Flash 8 / AVM1 SWFs
    will be able to run, but they will not have direct access to the
    Adobe AIR APIs.
    source:
    source
    faq Adobe
    it seems it should works!!??
    Edit3:
    nope I confirm at least some code made in Actionscript2
    works.
    I am sure this code needed to be changed for working in
    actionscript3, so "actionscript2" code works in Adobe Air.
    The problem of not loading my image must come from something
    else!!??

    Good Morning all!
    Hilarious....
    I tried so much to think maybe Adobe Air does not like a SWF
    using actionscript2, or it does not load any "external image from a
    swf", etc...
    None of that!
    I just in FLASH in the ComponentLoader....I did put simply
    the ContentPath at "myimage.jpg"....
    Of course I had to use the absolute path like
    "c:\\myfolder\\myimage.jpg"
    Of course aswell it works now!!!

  • Flash AIR app cannot load child swfs on publish to device

    I have been struggling with this problem for WEEKS now and can't solve it. I have an flash AIR app (creative cloud, AIR 3.8) which is very simple: all it does is load external SWF movies on the click of a start button. It works FINE in test/PC but when I publish to device, the external swfs do not load.
    Here is the code on the main timeline that calls the external swfs:
    //start button
    start_button_TRI_desmatosuchus.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_02_3,false,0,true);
    import fl.display.ProLoader;
    import flash.events.Event;
    var fl_ProLoader_02:ProLoader;
    var fl_ToLoad_02:Boolean = true;
    function fl_ClickToLoadUnloadSWF_02_3(event:MouseEvent):void
              if(fl_ToLoad_02)
                        fl_ProLoader_02 = new ProLoader();
                        fl_ProLoader_02.load(new URLRequest("dinofilms/triassic_desmatosuchus.swf"));
                        fl_ProLoader_02.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete_02 )
                        addChild(fl_ProLoader_02);
                        fl_ProLoader_02.x = 0;
                        fl_ProLoader_02.y = 144;
              else
                        if (fl_ProLoader_02!=null) {
                                  removeChild(fl_ProLoader_02);
                                  fl_ProLoader_02.unloadAndStop();
                                  fl_ProLoader_02 = null;
              fl_ToLoad_02 = !fl_ToLoad_02;
    function onComplete_02(e:Event):void {
              e.currentTarget.content.addEventListener(Event.ENTER_FRAME,OEF_02);
    function OEF_02(e:Event):void {
              if (e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
                        e.currentTarget.stop();
                        e.currentTarget.removeEventListener(Event.ENTER_FRAME,OEF_02);
                        removeChild(fl_ProLoader_02);
                        fl_ProLoader_02.unloadAndStop();
                        fl_ProLoader_02 = null;
    I am calling about 30 different movies on 30 different frames, so that's why I am using tags like "proLoader_01" so I don't duplicate them. All the external swfs are of course listed in the included files too.
    I would really appreciate the assistance, I am a reluctant coder!
    Message was edited by: Fiona Passantino

    OK, I replaced all the "ProLoader" instances with "Loader" and I am getting an error, below (see***)
        //start button
        start_button_TRI_coelophysis.addEventListener(MouseEvent.CLICK,
        fl_ClickToLoadUnloadSWF_01_3,false,0,true);
        import fl.display.Loader; **HERE, ERROR IS: 1172 fl.display:Loader could not be found**
        import flash.events.Event;
        var fl_Loader_01:Loader;
        //This variable keeps track of whether you want to load or unload the SWF
        var fl_ToLoad_01:Boolean = true;
        function fl_ClickToLoadUnloadSWF_01_3(event:MouseEvent):void
         if(fl_ToLoad_01)
              fl_Loader_01 = new Loader();
              fl_Loader_01.load(new URLRequest("dinofilms/triassic_coelophysis.swf"));
              fl_Loader_01.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete_01)
              addChild(fl_Loader_01);
              fl_Loader_01.x = 0;
              fl_Loader_01.y = 144;
         else
              if(fl_Loader_01!=null) {
                   removeChild(fl_Loader_01);
                   fl_Loader_01.unloadAndStop();
                   fl_Loader_01 = null;
         fl_ToLoad_01 = !fl_ToLoad_01;
        function onComplete_01(e:Event):void {
         e.currentTarget.content.addEventListener(Event.ENTER_FRAME,OEF_01);
        function OEF_01(e:Event):void {
         if(e.currentTarget.currentFrame==e.currentTarget.totalFrames) {
              e.currentTarget.stop();
              e.currentTarget.removeEventListener(Event.ENTER_FRAME,OEF_01);
              removeChild(fl_Loader_01);
              fl_Loader_01.unloadAndStop();
              fl_Loader_01 = null;

  • Loading external swf in AIR

    In AS3 this would load loadme.swf into my holding mc
    (contentmc) provided both the holding swf and loadme.swf are in the
    same directory
    var loaderMC:Loader=new Loader();
    loaderMC.load(new URLRequest("loadme.swf"));
    contentmc.addChild(loaderMC);
    But it does not work in AIR. Any reason why? what am i
    missing out or is there a new way to do it?
    thanks
    Murtaza Topiwalla

    What if you don't want the external swf to be packaged in the
    air file? I want the air file to pull the swf from the http, as it
    does with jpegs:
    Yay, this displays the jpeg
    loaderMC.load(new URLRequest("
    http://mywebsite.com/loadme.jpg"));
    Same code but it doesn't display the swf:
    loaderMC.load(new URLRequest("
    http://mywebsite.com/loadme.swf"));

  • 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);

  • Loading multiple swfs using air 3.6 for ios

    Adobe, can you please provide us with the code to load multiple swf files for ios. Please provide examples. The code below loads multiple swfs, but the swfs stall, so this does not seem to be a solution.
    Code description: A flash file made up of 4 frames with forward and back buttons that navigate from frame to frame. The code loads three different swf files in frames 2, 3 and 4.
    Frame 1:
    var myLoader:Loader;
    var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader == null){myLoader = new Loader(); addChild(myLoader); }
    else {myLoader.unload();}
    Frame 2:
    myLoader.unload();
    myLoader.load(new URLRequest("file1.swf"),loaderContext);
    Frame 3:
    myLoader.unload();
    myLoader.load(new URLRequest("file2.swf"),loaderContext);
    Frame 4:
    myLoader.unload();
    myLoader.load(new URLRequest("file3.swf"),loaderContext);

    I've just tried loading, unloading and then loading again same SWF with 2 library objects linked for AS3 export. It worked both on simulator and on device in debug mode. When I look inside swf it does contain AS3 code.
    So is my swf a pure asset SWF? Or Intellij Idea 12 that I'm using does stripping automatically?
    And then I've read your comment at http://forums.adobe.com/message/5217325#5217325 and run 'swfdump' utility on my .swf file. Looks like there's no ABC2 code, that's why app was able to load, unload and load again the same swf.
    public dynamic class net.games.bg extends flash.display.MovieClip
      native public function bg():*;
      native public var one:flash.display.MovieClip;
      native public var three:flash.display.MovieClip;
      native public var two:flash.display.MovieClip;
    public dynamic class net.games.z1 extends flash.display.MovieClip
      native public function z1():*;
    I can access objects as instances through root  or as objects through getDefinition.
    private var aLoader : Loader;
    private function init():void
                load1();
            private function load1():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete1, false, 0, true);
            private function handleSWFLoadComplete1(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace(' load 1 ' + myLibraryObject);
                aLoader.unload();
                load2();
                //addChild(levelObjectsMC);
            private function load2():void
                aLoader   = new Loader();
                var url:URLRequest = new URLRequest("levels/expirementlevel1.swf");
                var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
                aLoader.load(url, loaderContext); // load the SWF file
                aLoader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, handleSWFLoadComplete2, false, 0, true);
            private function handleSWFLoadComplete2(e:flash.events.Event):void {
                var levelObjectsMC:flash.display.MovieClip = e.target.loader.content;
                for (var i:uint = 0; i < levelObjectsMC.numChildren; i++){
                    trace ('\t|\t ' +i+'.\t name:' + levelObjectsMC.getChildAt(i).name + '\t type:' + typeof (levelObjectsMC.getChildAt(i))+ '\t' + levelObjectsMC.getChildAt(i).x);
                var LibraryClass:Class = e.target.applicationDomain.getDefinition("net.games.z1") as Class;
                var myLibraryObject:flash.display.MovieClip = new LibraryClass as flash.display.MovieClip;
                trace('load 2 x ' + myLibraryObject.x);
                aLoader.unload();

  • Flex 2 SWF not loading on the web browser when Flash Player 8 is running

    I got a Flex 2 application that is not loading on the web
    browser when the users workstations got Macromedia Flash Player 8
    installed. Please advice on what could be the issue, i got security
    calls included i.e. securty.allowInsucureDomain, crossdomain.xml,
    etc.
    The application shows no issues on web browsers with Flash
    Player 9 installed.

    if you have read developersGuide it says that there somewhere
    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part2_DevAp ps_048_1.html
    here is workaround
    http://kb.adobe.com/selfservice/viewContent.do?externalId=749eaa47&sliceId=1
    flex 9 is complete rewrite (almost) and its lot mor fast and
    effecient) you should't want to use flash 8 if you can anyways, but
    somethimes I guess there is not other way out..

  • Link to API for air.swf

    Hi, I've been searching the interwebs all morning and can't seem to find a link to documentation describing the properties, methods and events I can use from the air.swf file in conjunction with using AIR via a web browser.  I'm able to load the air.swf and see the framework status, but I don't know what other options I can use to perform actions via the API.  If anyone knows of a link to documentation I'd appreciate hearing about it.  Thanks!

    Hi, thanks for the information but I already have the developer guide that contains this.  What I'm looking for is documentation on the class specifications for the browser API.  Two methods that are mentioned in the documentation I already have are getStatus() and getApplicationVersion(), but I haven't seen any other methods, properties or events documented elsewhere.
    Ideally if there's something akin to the Flash help file documentation of the internal classes that would be great.  Thanks for your help! 

  • Unable to load external swf which has runtime sharing with another swf.

    Hi,
    I am getting issues on loading external swf say "importer.swf" file into another swf file say "loader.swf" for second time like
    ReferenceError: Error #1065: Variable testSymbol is not defined. VerifyError: Error #1014: Class testClass could not be found.
    at global$init()
    In the external swf "importer.swf", i am trying to import the symbol "testSymbol" from another swf file say "exporter.swf", which exports through runtime sharing option for the symbols.
    I am having some buttons in loader.swf file and on each button click i am loading different swf files into the loader.swf after unloading the previous one.
    I am able to load and unload different swf files but unable to load the importer.swf file which is sharing symbols from external swf and that too for the second time i.e., when i click the button twice.
    When trying to debug with flash debugger, all the other swf files are being unloaded before loading of another swf but the swf which is sharing symbols/classes with another swf is not getting unloaded.
    Output when i am trying to load two files example and importer files into loader.swf file on two different button clicks. On first button click example.swf is loaded. On second button click , example.swf is unloaded and importer.swf is loaded which is successful. On first button click again importer.swf is unloaded and example.swf is loaded. On second button click again, example.swf is unloaded and importer.swf is loaded, here i am getting issues shown above.
    Attemping to launch and connect to Player using URL D:\runtime issue\loader.swf
    [SWF] D:\runtime issue\ loader.swf - 8181 bytes after decompression
    [SWF] D:\runtime issue\example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    [SWF] D:\runtime issue\importer.swf - 441708 bytes after decompression
    [SWF] D:\runtime issue\ example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\ example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    ReferenceError: Error #1065: Variable xxxxxx is not defined.
    Debug session terminated.
    Code i am using
    b1.addEventListener(MouseEvent.CLICK, b1Clicked);
    b2.addEventListener(MouseEvent.CLICK, b2Clicked);
    var ldr:Loader;
    function b2Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("importer.swf"));
        addChild(ldr);
    function b1Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("example.swf"));
        addChild(ldr);
    If i try to open the swf using IE, i am not getting any issues at all. But i need to open this loader.swf in a air application. Also when i use loaderContext for the loader instance i am able to get rid of this issue but i cant use it in my application.
    So, please help me in resolving this issue.
    Thanks

    I got my answer. I had to append the photo url to the 'movie' value of the javascript embed method. Like this:
    <script language="JavaScript" type="text/javascript">
       AC_FL_RunContent(
          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
          'width', '550',
          'height', '400',
          'src', 'lesson2',
          'quality', 'high',
          'pluginspage', 'http://www.adobe.com/go/getflashplayer',
          'align', 'middle',
          'play', 'true',
          'loop', 'true',
          'scale', 'showall',
          'wmode', 'window',
          'devicefont', 'false',
          'id', 'lesson2',
          'bgcolor', '#ffffff',
          'name', 'lesson2',
          'menu', 'true',
          'allowFullScreen', 'false',
          'allowScriptAccess','always',
          'movie', 'lesson2?photo=http://www.flash-mx.com/images/image1.jpg',
          'salign', ''
          ); //end AC code
    </script>
    Thanks,
    srb.

Maybe you are looking for

  • Laptop won't start up! please Help

    Hello, Can someone help me with my laptop. I have mac os x 10.2x. It completely froze and and i shut it down. When i press on the power button to start it i just got a white screen with grey apple sign with little wheel spins around, and nothing is h

  • How to attach files from other desk tops to my emails

    Can you please help me work out why I am not allowed to access files and folders on other users desktops on my imac? Thanks. Andrew

  • ITunes won't read/burn CD's

    As of today, my iMac, with the most recent version of iTunes, stopped recognizing commercially bought CD's that play fine elsewhere.  I insert a CD, it spins for a few seconds, then spits back out.  I've tried restarting the computer, tried multiple

  • Can't install Flash Player version 11

    Tried to perform a clean install of flash player ver 11.  Ran uninstaller, rebooted system, deleted C:\windows\system32\macromed\flash folder.  Did not find any appdata. Downloaded version 11 from adobe site and I still get message that I need latest

  • Using inspector to modify movie clips

    When I double click a movie clip to open inspector to use slow motion, Inspector doesn't launch. I was unsuccessful in troubleshooting this on my own. Thanks.