Loading library.swf (unpacked from swc) using loader() and using it's assets

I try to load libary.swf from an swc file in order to use it's library items.
i load the library.swf using urlrequest and loader() and then use getDefinition() to fetch the class definition
of the UIMovieclip element.
i simply created the swc file by adding library assets to an swf file, converting them to a flex component and extending each compoent with the UIMovieClip class.
when i load the swf file from a url (http) i get the following error:
VerifyError: Error #1053: Illegal override of UIMovieClip in mx.flash.UIMovieClip.
when i load the file locally, i get no error. any ideas why?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="init()">
    <fx:Script>
        <![CDATA[
            import mx.core.UIComponent;
            import mx.flash.UIMovieClip;
            private var _context: LoaderContext;
            private var _request: URLRequest;
            private var _loader:Loader;
            private var _library:Object;
            private var _executeFunction:Function = null;
            public function _setExecuteFunction(f:Function):void {
                this._executeFunction=f;
            public function handleLibInitialized(e:Event):void {
                this._library=e.target.applicationDomain;
                var a:Class = this._library.getDefinition("lobby_page_component");
                var b:MovieClip = new a() as MovieClip;
                var c:UIComponent = new UIComponent();
                c.addChild(b);
                this.addElement(c);
            public function init():void {
                Security.allowDomain("*");
                var url2:String="http://url/for/library.swf"; <- http provides an error
                 var url2:String="/path/to/library.swf"; <- local path works
                             this._context = new LoaderContext(false,ApplicationDomain.currentDomain);
                this._request = new URLRequest(url2);
                this._loader = new Loader();
                this._loader.contentLoaderInfo.addEventListener(Event.INIT,this.handleLibInitialized);
                this._loader.load(this._request,this._context);
        ]]>
    </fx:Script>
</s:Application>

hello,
thanks for trying to help.
if this is the case, why it happens only when i load the library.swf file from an http location instead of a local location ?
how can i make sure that my adobe flash has the same UIMovieClip version?
kfir

Similar Messages

  • Loading local swf files from Application Dir (ios)

    Hi Guys,
    I would like to load additional local swf files to my ios release build but I am confused a little bit because of the new API changes.
    As far as I know at the moment (from Air 3.7 or newer) it is allowed to load local swf files that contains compiled actionscript both from local folder and from a predefined remote host as well. 
    My assumption based on this article:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/
    I created the text file to include all of my local swf file names and created the following node in the application.xml:
    <iPhone>
           <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs>
    </iPhone>
    When I compile the release build (ipa) using command line adt, it converts all of my local swfs into the stripped swfs which is perfect, but even though I include all the swfs in the compiler command, it puts only the SampleSWFInfoFile.txt file into the assets folder in the ipa but not the swf files.
    I assume, it thinks I will load these files from an external host, but I would like to include them in the app itself.
    I tried to copy the stripped swf files from the externalStrippedSwfs folder and comment the <externalSwfs>assets/SampleSWFInfoFile.txt</externalSwfs> node in the application.xml and compile it and this way it puts the swf files into the ipa, but when I try to install and launch the app it crashes and when I test it using Flash Builder it shows an error message
    "VerifyError: Error #1042: Not an ABC file."
    Do any of you guys know the  solution for this problem?
    Thank you for your help in advance!

    You're publishing in AOT mode as long as you use one of these:
    The AIR Developer Tool or ADT has targets that lets you package apps either for the AOT mode or Interpreter mode. The targets for packaging in AOT mode are ipa-app-store, ipa-ad-hoc, ipa-test and ipa-debug.
    Flash Pro CS6 and Flash Builder automate this process pretty well so it's invisible but the SWF loads and executes code just fine for me when directly published.
    If I take it to command line I can use this to compile successfully (iPad test app):
    adt -package -target ipa-ad-hoc -storetype pkcs12 -keystore my.p12 -provisioning-profile my.mobileprovision NameOfApp.ipa NameOfApp-app.xml NameOfApp.swf iTunesArtwork iTunesArtwork@2x AppIconsForPublish swfs/swfs.txt swfs/GenerateText.swf
    I at least include generic icons in there but I made a 'swfs' folder and placed 'swfs.txt' and 'GenerateText.swf' in there. The SWF uses code to randomly generate text and changes every second using a Timer. I load it in using the same code you do with the ApplicationDomain.currentDomain context. I see the SWF appear and text start randomly changing.
    As I compile there's a folder generated called 'externalStrippedSwfs' with the stripped SWF in there.
    One thing to note is I do not supply <externalSwfs>swfs/swfs.txt</externalSwfs> in my iPhone settings. If I do that it doesn't work. I supply the path to the text file containing the SWF I want to be stripped to adt itself along with the SWFs I want stripped and it takes care of the rest.

  • Call and display Xcelsius SWF file from an SAP Transaction

    Hello Experts ,
                          Could you please suggest if it is possible to Call and display Xcelsius SWF file
    from an SAP Transaction and if Yes how can this be achieved.
    Regards ,
    Jerin.

    Jerin,
    It is possible to embed a Xcelsius model into an SAP WebTemplate (Anil promised to write a blog about this very soon). After that you can include the WebTemplate in the GUI menu, Role menu or Portal.
    Henk.

  • Can I load xml file from SWC without using @embed

    I'm developing a mobile application in which I need to load xml files from File.applicationDirectory. This works great if the xml files are part of the main application swf. But I would like to move these xml files into a SWC so they could be shared across multiple applications.
    Using FlashBuilder 4.5, when a SWC is built, I can specify files to embed in the library that are not assets (Assets Tab of Flex Library Build Path). For various design reasons, I do NOT want to embed the xml files via @embed.
    When the swc is built and I open it up using a zip utility, I see the xml files in there just fine. So they are being bundled with the SWC. But how can I load these files in my main application that does not involve using @embed? When the main application is built, the swc setting for link type is "merged into code".
    I wouldn't expect the application to automatically pull out the xml files from the swc and place them in the File.applicationDirectory on the mobile device. I've tried loading from there just in case but file.exists is false (as expected).
    I've searched the web (and continue to do so) and all the answers seem to be to use @embed. Is there another way?
    Randy

    It's actually a lot easier than you think.
    Just reference the file like any'ol URL using a path relative to the SWC's src directory.
    So if you include the file "assets/xml/some.xml", just use that same string like you would any remote resource.
    For example:
    var loader:URLLoader = new URLLoader( new URLRequest("assets/xml/some.xml"));
    I believe it would also work like this "/assets/xml/some.xml", but I prefer relative paths so the link doesnt break if moved out of the SWC...

  • Loading library movie symbol from external swf

    Hi, I have a Flex/Air Application and I want this application
    to load in an external SWF and display a particular asset from the
    SWF library (just like attachMovie in AS2). I dont want to embed
    the SWF into the Air application. For the life of me I can't find
    any tangible info on how to do this. My second problem is that the
    assets sit in an SWF published for AS2 (is that an issue?). All
    content resides locally.
    Can anyone help or point me in the right direction?

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Loading swf files from an iPhone Air App

    Although the faq says its possible ( http://bit.ly/gyxmCo  )  I can't seem to load .swf files from my app.
    There's no .AS code in the .swf file I'm trying to load.
    PNG files load with no problems, swf's fail.
    A working example would be appreciated instead of suggestions, I've spent the entire day trying out suggestions
    regards,
    Martijn

    Because I can't see any library assets in an as2.0 file.
    I've discovered that the swf fails to load as soon as you make a symbol 'export for actionscript'
    probably because it will then create a class. So you can only load SWF's as simple pictures or animations, you cant use it as an asset library with multiple animations/images/sounds in it..
    As for you other questions:
    it doesnt matter if the file is local or on the web. same results
    I created the swf file from a fla in CS4,  and I'm compiling my air project that loads the swf  with FlashDevelop.

  • SwfPanel Not Loading from SWC

    I'm working in Flash CS5, with FlashDevelop as my external text editor. Everything is AS3.
    I have a custom component I've created that has HTML text content.
    I  created a small Flex 3.5 application as a SWFPanel Custom UI for this.  Nothing fancy - really just a RichTextEditor wired up to the component's  HtmlText property.
    I set the Custom UI in the ComponentDefinition, choosing external.
    Everything  works great - I can edit my text from the components panel, all as  expected. Some tracing code that I put in the Custom UI shows up in my  Flash logs, and the output panel, as expected.
    I compile my component as an SWC, then export it, then  import the SWC into a new movie. The component works as expected but my  Custom UI doesn't load (this is all on the same machine, so the path  should not have changed). In the component inspector I just get an empty  white panel and the tracing code no longer appears.
    I  go back, and change from having the Custom UI as an external SWF to  embedding it. Now the UI doesn't load, even in my original test movie,  and it still doesn't work when exported as an SWC.
    If I unpack the SWC, incidentally, I can see that all the Custom UI code is embedded there, as it should be.
    In  the Flash Log for the main movie, I get no errors at all at any time.  In the movie where I've imported the SWF, I occasionally get the  following, but not necessarily when selecting the component in question:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
         at StageCore::StageObject/UpdateSelection()
         at StagePlayer$/InvalidateStage()
         at Function/http://adobe.com/AS3/2006/builtin::apply()
         at flash.external::ExternalInterface$/_callIn()
         at Function/<anonymous>()
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at StageCore::StageObject/GetRealObject()
        at StageCore::StageObject/ClearStage()
        at StageCore::MainStage/ClearTree()
        at StagePlayer$/RemoveView()
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at flash.external::ExternalInterface$/_callIn()
        at Function/<anonymous>()
    Has  anyone experienced this problem? Any idea what it might be? Is the fact  that the SwfPanel is a flex app problematic? If so, why does it work in  the test movie but not when exported?
    Any help would  be appreciated. I'm really in a hurry on this so I'm cross-posting to  the extensions and AS3 fora in the hope that someone might have an  answer. I think I've read all the CS3 component tutorials out there but  nothing seems to cover this problem except some old stuff about AS3  being problematic in SwfPanels. Not sure if this is still current  though.
    Thanks in advance, as always, for any assistance.
    Jude

    Thanks a lot Jens Petersen
    It's is loading ..........
    MI means miniute.
    am i correct.
    but i didn't get the logic behind that.
    can u please explain that.
    Thanks & Regards
    Salih KM

  • Flash Builder 4.5 Plugin Error: Failed to load library.swf

    Hi,
    I am getting an error from Flash Builder that is stopping me building my app. I am running the plugin version under Springsource ToolSuite 2.6.1. It worked fine with the Prerelease version of Flash Builder 4.5.
    I have flexunit-uilistener-4.1.0-8-4.1.0.16076.swc in the directory along with the other FlexUnit swc files (which do not throw errors).
    Any suggestions ?
    Thanks!
    eclipse.buildId=2.6.1.201105041000-RELEASE
    java.version=1.6.0_24
    java.vendor=Apple Inc.
    BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
    Framework arguments:  -product com.springsource.sts.ide -product com.springsource.sts.ide -keyring /Users/Dre/.eclipse_keyring -showlocation
    Command-line arguments:  -os macosx -ws cocoa -arch x86 -product com.springsource.sts.ide -data /Users/Dre/workspace-PGS -product com.springsource.sts.ide -keyring /Users/Dre/.eclipse_keyring -showlocation
    Error
    Fri May 27 21:31:07 PDT 2011
    Design view: Failed to load library.swf from /Users/Dre/flexunit-3/flexunit-uilistener-4.1.0-8-4.1.0.16076.swc, reason=DesignAssetLoader.CompleteTimeout

    I did a workaround by adding this compiler argument:
    ${flexlib}/libs/automation/automation_agent.swc
    ...which points to that file in Flex 4.5. I can now build the app.
    Why do I need to do this now when I didn't need to do so before ?

  • Loading external swfs extending from classes in the same shared codebase

    Hey there!
    I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.
    If I could briefly explain how I've approached this so far, I would be extremely if people could shout in my general direction and tell me I am stupid, or even better still, give me helpful advice as to where I am going wrong and how I can correct it!
    My project is setup like this:
    HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.
    game.fla ->document class game.as
    game.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.
    Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla...  If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as?
    Can you spot the problem in the way I am doing this, or is there a better approach I should try?
    Any advice greatly appreciated!
    Stevie.

    No it doesn't seem to, however though they both have a reference to the HighScoreManager so there is some overlap there between menu and game code, but the menu classes don't reference any symbols on the game.fla...
    Just to clarify, I have an fla HighScoreMenu.fla, which has a child symbol HighScoreMenu which uses the following class.
    public dynamic class HighScoreMenu extends GameMenu
         //convenient storage for competition Manager object
         private var _highScoreManager:HighScoreManager;
    The game then loads this class as follows:
    I load the swf "HighScoreMenu.swf" and once its loaded I obtain the menu class like so:
    var cls:Class = Class( applicationDomain.getDefinition("Menus.HighScoreMenu") );
    var object:* = new cls();
    ...and create a new instance of the menu.
    Is there anything fundamentally wrong with approaching it in this way?

  • Is it possible to load SWF files from an SQL database?

    Hi all, I am very new to flash (I am primarily a C'# developer!) and I have been asked to investigate the possibility of doing the following;
    Create an application that allows swf files to be uploaded and stored inside of a SQL database as binary data (Why a database is a long story!)
    Allow this binary data to be extracted via a http request to be dynamically loaded inside of a web page.
    Now the first part was easy. I have all of my swf's uploaded and stored inside of the database. I have code that can make a request for the binary and write it to the response, so far so good. Now this is where I am stuck.
    I thought I could dynamically load the swf binary data by creating a very basic swf that simply contains a movie clip holder and for now a simple loadMovie statement. My idea being that I can could provide a url for the loadMovie statement that returns the swf binary data. This is where I have ground to a halt.
    I can see the call being made from the swf, I can see the data being returned but I cannot get it to render. I remember seeing an article some time agao where someone stated that they had used this method with success but I cannot find now. Has anyone ever done anything like? Is it even possible? Am I missing something simple?
    I have tried to return both the raw binary data and also used response.write but to no avail. Can anyone help?

    You are possibly trying to load AS3 swf into an AS2 Container at least the use of loadMovie() points in that direction. Be sure to use AS3 and target at least Flash 9 in your Loader/Main.swf. Also the AS3 concept of how to load swfs  differs a lot from the old concept.
    Look into the docu:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.ht ml
    But the biggest Problem seems to me -what you mentioned- that Loader needs a (defined) URLRepuest and since your swf files have no "real" URL and you surely don`t want to let the user directly write to your server, a workaround would be to write the BinaryStream with AIR-functionality to a local installlation directory and load it then from there.

  • Loading and download SWFs for AIR apps on iOS from server

    Dear
    I develop app for ios using adobe air i need to loading and download swf in my server to my local device
    i make it loading from server and play but i need to download it locally in device to play offline
    Please Help
    Thank You

    If I undestand correct, the unload() is unsuported yet, so it just hangs in the memory
    In the tests I did, when I put two loads for the same swf, the app freezes, so I don´t know what you can do there.
    For the "code", you just need to put the LoaderContext on the loads, something like this:
    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);
    Regards,
    Rogério Gonzalez

  • Can not load an external swf file from my site

    Hi ...
    I have a fla file which is loading external swf files from my local folders.
    I inserted some of the swf files to a web site and tried to load them from the site, not from my local folder...
    So it gave me a security error like below:
    *** Güvenlik Sanal Alanı İhlali ***security domain-area violation
    http://www.celiktek.com.tr/KIRIL.swf' SecurityDomain öğesi -- security domain element, 'file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf' uyumsuz bağlamına erişmeye çalıştı - tried to reach this incompatible url
    SecurityError: Error #2070: Güvenlik sanal alan ihlali -- security area violation: http://www.celiktek.com.tr/KIRIL.swf arayanı - searcher of this can not reach stage in file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf içindeki Stage'e erişemiyor. -
    at flash.display::Stage/requireOwnerPermissions()
    at flash.display::Stage/get numChildren()
    at KIRIL_fla::MainTimeline/frame1()
    so in my computer, I can load this swf , but how from a website ?
    thnx ...

    Thnaks ...
    I tried to use the securiyt panel that is openede and I added there my site
    www.celiktek.com.tr/KIRIL.swf
    but I still take the error
    *** Güvenlik Sanal Alanı İhlali ***
    http://www.celiktek.com.tr/KIRIL.swf' SecurityDomain öğesi, 'file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf' uyumsuz bağlamına erişmeye çalıştı
    SecurityError: Error #2070: Güvenlik sanal alan ihlali: http://www.celiktek.com.tr/KIRIL.swf arayanı file:///C|/Users/Acer/AppData/Local/Temp/Untitled%2D1.swf içindeki Stage'e erişemiyor.
    at flash.display::Stage/requireOwnerPermissions()
    at flash.display::Stage/get numChildren()
    at KIRIL_fla::MainTimeline/frame1()
    from my code
    var req:URLRequest=new URLRequest("http://www.celiktek.com.tr/KIRIL.swf");
    var lod:Loader=new Loader();
    lod.load(req);
    addChild(lod);
    lod.x=0;
    does this code works on your computer ... I know it is a weird question ... you dont have to try ...

  • When we go to view albums from our iphoto library on apple tv it takes forever to load and then it only plays between 24 and 35 photos then goes back to the start.  Then it goes through again and displays 1 more photo each time. Please help!

    When we go to view albums from our iphoto library on apple tv it takes forever to load and then it only plays between 24 and 35 photos then goes back to the start.  Then it goes through again and displays 1 more photo each time. Please help!

    It's likely that your Library database has been damaged in all the crashing.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    Regards
    TD

  • Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    Hey guys i was wondering if i could downgrade my iphone 5 from ios 7.1.1 to 7.0.6 or .0.4 i have 7.0.6 and .0.4 shsh blobs but when i try to build a custom ipsw using ifaith it loads and never stop loading is there any way to downgrade to older ios 7 ?

    No, you cannot downgrade your iOS device. That's not supported by Apple.

  • GotoAndStop error 1120:Access of undefined property on MC's loaded from .swc

    I am trying to tell a MovieClip added from a .swc library to do simple things like "gotoAndStop()" and all I get is a red X error message 1120: Access of undefined property whenever I do.
    I can add the MovieClip to the application and position it without any problem. I cannot make it do anything. In my Flash IDE library the CustomCheckBox()'s base class is
    import flash.display.MovieClip;
    import mx.flash.UIMovieClip;
         //  **** TRIED EACH IMPORT STATEMENT AND BOTH**** (NEITHER of which work at all).
    private var _checkPlaylist:MovieClip = new CustomCheckBox();
    private var _checkClassroom:MovieClip = new CustomCheckBox();
    _checkPlaylist.gotoAndStop(1);
    _checkClassroom.gotoAndStop(2);
    I can declare my CustomCheckBox as a MovieClip and in my Symbol Properties panel it's base class is — mx.flash.UIMovieClip — and it shows up just fine. I just can't make the thing stop or do anything else a MovieClip is supposed to be able to do.
    One of the other developers here who is way more advanced than I am also cannot get a ******* movie clip to stop either.
    I am new to Flash Builder — yet have been using Flash and AS3 for years and I have never had a more difficult time getting up to speed with a new technology than Flex / Flash Builder has become for me. I feel stupid that I keep spending days on end just trying to figure out basic things like this.

    I keep answering my own questions. When I added a gotoAndStop command to the referenced MC inside of the init function it stopped throwing that error at me. I was trying to initialize the button states after declaring them as MC variables, but the compiler did not like that.

Maybe you are looking for

  • Adobe Creative Cloud unable to find any installed applications

    I was updating my Indesign CS6 DPS Tool via Creative Cloud Desktop last month. However due to some internet connection error it failed. Tried to update it again later but there is no updates anymore. Logout from CC Desktop Application and log back in

  • Setting Look n' Feel for non subcomponents

    Hi, I have a GUI selection on my main application frame that will let the user choose a look n' feel. When that is chosen, the event is fired and the following method is called. Selection is one of course, "javax.swing.plaf.metal.MetalLookAndFeel" "c

  • BAPI_REQUISITION_RESET_RELEASE

    Hi, I am using the BAPI 'BAPI_REQUISITION_RESET_RELEASE' for cancel Release and passing all the release codes(T_16FS-FRGC1 to T_16FS-FRGC8) using a do loop for every PR  line item. In this case the first release code gets cancel released but for the

  • Global Attribute/Element in OSM

    Hi All, I want to make few elements as Global attribute in OSM, not task based. --> Let say I have 4 Task, In task one I have allocated/reserved the resource 'X' for my task, but later at Task 3 I changed 'X" to "ABC". Now Revision order has come and

  • How do I delete or clear my browsing history?

    I can't clear my history is there a simple way to do this?