Importing flash symbols from an external SWF using URLrequest

Hello.
I'm trying for several days now to properly import flash symbols into a flex application.
i can't only @Embed because the swf file that contains the skins will not be available locally so i need to use URLRequest.
This is what I've got so far.
1. I created a flash file, lets call it foo.swf that contains several elements in the library and each element has both `Export for ActionScript` and `Export for runtime sharing` on. one of the elements is called 'test' which is a movieclip of an image.
2. i created a flex project that creates the swf flashSkins.swf that contains the following Wrapper class:
        package
            import flash.display.Sprite;
                public class Wrapper extends Sprite
                 [Embed(source="foo.swf",symbol="test")]
                    [Bindable]public static var test: Class;
I tested to make sure that this class properly fetchs symbols from the flash file properly
using the following code:
    <fx:Script>
        <![CDATA[
            public var wrapper:Wrapper;
        ]]>
    </fx:Script>
        <mx:Image source="{Wrapper.test}"/>
it loads the image and shows it properly.
3. I created another swf file that will fetch the flashSkins swf and import the Wrapper class from it. this is where i fail.
        public function loadSkins():void
                bgLoader = new Loader();
                var bgURL:URLRequest = new URLRequest('http://files.xpogames.com/flashSkins/flashSkins.swf');
                bgLoader.contentLoaderInfo.addEventListener(Event.INIT,onLoaded);
                bgLoader.load(bgURL);
            public function onLoaded(e:Event):void {
                var clazz:Class = bgLoader.contentLoaderInfo.applicationDomain.getDefinition('Wrapper') as Class;
                var a:Object = new clazz();
                theimage.source=a.test;
        ]]>
      </fx:Script>
        <mx:Image id="theimage" />
I tried using getDefinition with 'wrapper' or 'Wrapper' but on both cases i get an error that the variable is not defined.
any ideas?

Did you try using the Event.COMPLETE instead of Event.INIT?

Similar Messages

  • Importing a large (7500) photos from an external HD used with a PC into an

    How can I Import a large (7500) library of photos from an external HD used with a PC into iPhoto? I know how to import, but can't figure out how to keep my folders (by year) and the sub folders in order. When I import they all end up in the library unorganized.

    Hi AzBill,
    I hope the following info might help you a little bit...
    Importing Images from the hard drive, CD, or DVD
    To import a folder with subfolders of images maintaining the same organizational structure (or close to it):
    Drag the folder with the subfolders into iPhotos viewing area.
    A film roll will be created with each sub folders name (the subfolder has to have images in it. To view the rolls in the Library you need to first go to the menu bar and choose View>by film rolls.
    To make each roll into an Album, highlight the title of the roll
    Go to File>new album from selection.
    You will now have an Album in the source column with the images from that roll. Do this for each roll if you want them to be an Album. This is your choice.
    Next, go to the menu bar and hit File>new folder
    Name this new folder with the year or whatever the name was of the Parent folder containing the subfolders that you had dragged into iPhotos viewing area.
    Next drag all the Albums into the respective new Parent folder you just made.
    Albums- collection of images from one roll or many rolls. The Albums will be listed in your source column when you make them. The albums only contain placeholders for the images that are still in the library. They are not duplicates.
    Rolls- rolls are created when you import folder of images. It will be given the name of the folder you are importing.
    Rolls are also created from each import from your camera. You are given the option to name the roll at import.
    Folder-a folder you create manually using the File>new folder command
    Folders can hold Albums, slideshows, books, another folder, etc.
    One other way you can import a folder of images and have an Album created for it as the same time it is imported as a roll in the Library view:
    Drag each folder of images into the source column of iPhoto. When you see the plus sign, drop it in the source column.
    An album will be created in the source column, and the roll that the album was created from will be in the library view window.
    Hope this helps!

  • Loading class from an external .swf file

    Hi,
    My flash application has lots of resources which will change all the time. In order to keep the the user from having to download my main .swf file over and over again, and in order to keep the main file's size low, I would like to put the resources into separate .swf files and load them dynamically from a url using a Loader.
    Once downloaded I would like to extract the classes that are in the resource swf and use them in the main swf. Can anyone share some code for doing this? Note that I am not just interested in using a symbol from the resource swf. I would like to use a class, with all of its methods and everything, and my main swf does not contain the class definition. Only the resource swf does.
    Thanks!!

    This is a great question for flash programming.
    And when you know the answer to this, you are likely to use it on daily basis like the top level programmers  of an agency.
    ApplicationDomain is your answer and the adobe docs has a chapter on this.
    ApplicationDomain is where all of your classes will be loaded into and when you use a loader you have the ability to target this with the laoderContext.
    AplicationDomain.currentDomain loads all classes into the main app and if your main app already has these classes, then the app uses the parents classes
    new Application.Domain() specifies a seperate repo of classes that are loaded in so that classes in the main app will not be confused by the classes in a loaded swf. that refer to the same names.
    this locks down the communication between the swfs but will use the newer updated classes on the child when a child is loaded in with the same class names as the parents.
    new ApplicationDomain(currentDomain)  will enclose a new repo with the parent repo of the class definitions.

  • How to Load an external swf using loadmovie in AS3

    I need to create a button with script, on rollover load an external swf into movieclip in AS3.  This was able to create this in AS2, but I need to create this in AS3

    Thanks again Ned.
    Kenneth Russell
    graphic artist, Sr.
    Lockheed Martin - MS2
    2323 Eastern Blvd., Baltimore, MD 21220
    Phone 410.682.0554    Fax 410.682.0543
    From: Ned Murphy <[email protected]>
    Reply-To: [email protected]
    Date: Thu, 23 Jul 2009 19:08:25 -0600
    To: kenneth russell <[email protected]>
    Subject: How to Load an external swf using loadmovie in AS3
    In AS3 you use the Loader class to load external swf's and image files.  You
    should be able to find examples both in the Flash help files and these forums
    if you search.  If you aren't aware of how to code buttons in AS3, that can be
    found as well.  In AS3, just about any kind of interction involves the use of
    event listeners in combination event handler functions... in the case of a
    button rollover an example would be...
    btnName.addEventListener(MouseEvent.ROLL_OVER, overHandler);
    function overHandler(evt:MouseEvent):void {
         // your loading code or whatever
    >

  • Importing .mxf Files from an external hard drive...

    Any advice or tips would be greatly appreciated. My problem comes close to others discussed, but I haven't been able to find a duplicate post. And I apologize for the length; I just want to give you as much info. as possible (I also put details in my signature) to help you help me.
    I shot a short film using Panasonic's HVX200 camera, filming in HD 720p/24p, and downloaded each P2 card through a PC laptop into a LaCie Brick external hard drive. I was originally planning on editing the footage with Adobe Premiere Pro 2.0, but became frustrated with how much trouble it was having handling the .mxf files. Assured by Apple salespeople that FCP 5 would have no problem importing the footage from an external hard drive, I purchased the computer described in my signature.
    Now I know that FCP/Apple only supports importing footage from the P2 card directly, and not from an external hard drive. A representative from ProMax.com was able to help me out, however. First, he had me copy the footage files onto my Mac internal drive from the external hard drive. Then, he had me select IMPORT -> PANASONIC P2. Then, I was to highlight the CONTENTS folder and import away. And it worked... sort of.
    There are two major problems: 1) During this transfer, not all of the footage is making it across. I import it, and then get the much-talked about "one or more P2 clips failed to import; probable incomplete or corrupt clips" warning. After checking the original video folder on the internal hard drive and comparing it to the number of clips FCP imported, I learned that I had lost around 20 clips/video files at one point. Other shooting day transfers worked completely smoothly with all of the files imported (we split up the footage by shooting day, without touching or changing the CONTENTS folders). So, some transfers work and some don't. And 2) When I try to import the files from our 4th day of shooting, I get a "Selected path does not contain a P2 volume." Nothing is imported.
    So, that's my situation, and I'm getting very desperate. I know that I'm not doing things in the Apple-supported way, but I'm really hoping there's still someway to successfully get the files from the external hard drive into FCP completely. It seems to work some of the time.
    Final notes: When importing, I make sure to import the entire CONTENTS folder. There is never a LASTCLIP.TXT file listed under it in the window, but some of the days of footage have transferred perfectly, so I'm hoping that's not a dealbreaker. If it is, isn't there some way to rebuild a lastclip.txt file? I don't even know if that's the issue. And one last note: In most of my folders, the "CLIP" folder has a number of files in it. In the 4th day's footage that I can't import at all, I noticed that the CLIP folder is empty. And on the days where FCP isn't importing all the files (like I mentioned above), there isn't a CLIP file for every single VIDEO file. Could this be the main problem? Along this line, is there a way to somehow put the footage on the external hard drive back through a p2 card and then into the Mac?
    Okay, I'll stop typing. Thank you so, so much for any help.
    Tom
    PowerMac G5 (Dual 2.3 GHz)   Mac OS X (10.4.6)   Quicktime 7.1.1 - Final Cut Pro 5.1 - Aforementioned External Hard Drive: LaCie Brick (FAT 32 based)
    PowerMac G5   Mac OS X (10.4.6)  

    The problem didn't turn out to be as complicated as I had thought. The process I described above ended up working fine, and I'll explain how. And this is a cool workaround, because the AppleCare helpers told me that they didn't think it would work (FCP P2 import is only supported straight from the P2 card/viewer or the camera).
    I hooked up my external hard drive to the Power Mac G5, and copied the files and folders onto my internal scratch disk. Then, I opened FCP and chose IMPORT -> Panasonic P2. I chose the "CONTENTS" folder for each day's filming, and imported them in, no problems. There was no visible "lastclip.txt" file shown (under the "CONTENTS" folder or anywhere else), but this didn't seem to cause any problems.
    The reason that not all of the footage was bring imported (the aforementioned "one or more P2 clips failed..." warning) was because we were missing clip files (in the CLIP folder) corresponding to certain video files (in the VIDEO folder). Luckily, we had just forgotten to transfer all of them from the original external hard drive, and once we transfered them completely, FCP could read all the video files. FCP needs a clip file for every video file in order to make it work (that's why our aforementioned "Day 4" could not be read; we hadn't copied all of the clip files over with the video files).
    Even after we did this, we STILL were getting the "one or more P2 clips..." warning for our Day 5. After taking a look at all the folders, we figured out that there were still more files in the VIDEO folder than in the CLIP folder, even after we transferred them all over. Finally, we figured out what had happened. For some reason, some of the audio files for some of the clips had been included in the VIDEO folder for our Day 5. There is no way we did this accidentally; somehow, the HVX200 placed some of the audio files into both the VIDEO and AUDIO folders. And FCP was trying to read those as video files, and therefore couldn't find the corresponding clips in the CLIP folder. After making sure that those audio files were also in the AUDIO folder, we simply deleted them from the VIDEO folder and stopped getting the "failed to import" warning.
    Final thing to share: If we had actually been unable to find the corresponding clip files in our original external hard drive, we had also found a potential solution (that we didn't end up needing to try). You can record from FCP back onto the P2 card, in the hopes that the clip files would be regenerated when you re-import it into FCP. I received a PDF file about this process, and I'm not sure how to put it up on the page here. If interested in this described process (which, again, I can't fully vouch for), feel free to email me at [email protected] and I can forward it to you.
    Hope this helps.
    PowerMac G5   Mac OS X (10.4.6)  
    PowerMac G5   Mac OS X (10.4.6)  

  • When I try to import .olm files from my external hard drive back up, where do they go? It says on different forums they go to the "on my computer" folder but they are not there

    When I try to import .olm files from my external hard drive back up, where do they go? It says on different forums they go to the "on my computer" folder but they are not there.
    I go through all the instructions but then my emails do not appear. I'm starting to panic a bit!

    You might want to try asking on the MS Office Outlook forum - http://answers.microsoft.com/en-us/mac/forum/macoutlook - since those are Outlook files.
    Also note which method you're using to create a backup.
    Clinton

  • Can I import .MTS files from an external hard drive into Final Cut Pro X?

    Can I import .MTS files from an external hard drive into Final Cut Pro X?

    Luis Sequeira1 wrote:
    b) Use an utility like Clipwrap or MPEG Streamclip to convert the mts file to a quicktime (mov) file
    Luis,
    Just to clarify one point…in order for Streamclip to convert the MTS I believe a plug-in like the AVCCAM QuickTime importer from Panasonic needs to be installed. (Credit David McClain over at the FCS boards for that info.)
    Russ

  • I imported my photos from an external hard drive into Lightroom, edited my photos but what next...?!

    Adobe,
    I imported my photos from an external hard drive into Lightroom, edited my photos and when i decided to export them the originals had not been updated and the deleted photos had not been deleted. How do i set it up so that once i import the photos, edit them and export they are then placed back in their original folder edited and updated?
    I have managed to export the photos to another file but these were exported with an Adobe.xmp file. What is this and is this necessary?
    Thanks for your help!

    It's important to realise that LR is a DAM (Digital Asset Management) application - no images are actually imported into LR only links to where they are. Secondly, the details of any edits that you make to your images are kept only in the database and/or xmp files depending how you set this up in Preferences. In the general workflow e.g. edit in Lightroom, further edit in Photoshop and returning to LR then creating xmp files aren't really necessary. So just to emphasise - edits are stored in the LR's database, the original RAW images themselves don't change (non destructive editing). You can prove this yourself by desaturating an image (turning it into a B+W) and then look at the original images in Explorer - you'll see it's still being shown in colour.
    Exporting an image is something different. By implication, you've finished with the image and perhaps want to save an image for posting on the web somewhere. Now assuming your not using any additonal and freely available LR export plug-ins, one way would be to Export a jpeg image to a folder on the desktop and this is allowed for in the Export dialogue. At this time LR reads any edits from it's database and applies those to the exported jpeg (or tiff) file it's going to send to the folder on the desktop.
    As mentioned earlier, any edits and keywords etc are stored in LR's database - original RAW files remain untouched. XMP files also store the edits if LR is set up to create xmp files (in Preferences) but these are not really necessary unless you are going to be editing an already edited RAW file in another application. As an example - you import into LR's library a scanned negative. Now because strictly speaking LR isn't designed to work with negative images, you now open this file via Bridge into ACR and from here reverse the negative into a positive image. All fine and good except when you go back into LR what's shown is still a negative so what is needed is to update the metadata (LR > Metadata > Read Metadata from file) which will force LR to read the newly created metadata from the xmp file that Bridge generated. As already suggested, if you're happy editing your RAW files in LR and only LR then xmp files aren't really necessary - all the data being saved in LR's database.
    Hope this has been of some help but if I might also suggest, purchasing a good book on LR from the outset thus getting to really know LR will pay dividends further on down the line.

  • HT1473 How do I import my library from an external drive to Itunes quickly

    How do I import my library from an external drive to my Itunes on my computer quickly?  When I pull up ITunes, I only show Add File to Library and so I would have to manually add each file one by one, isn't there a faster way?  In the old Itunes there used to be Import Library?

    Press ALT or CTRL+B to display the menu bar. This gives access to File > Add Folder to Library.
    If the external drive contains a complete self-contained iTunes library that you want to open, press and hold down shift as you launch iTunes and keep holding until prompted to choose or create a library. Click choose and browse to the iTunes Library.itl file on the external drive.
    If you have devices that sync with your previous iTunes library either open the copy on the external as above, or copy the entire iTunes folder into your internal drive and keep the external as a backup.
    tt2

  • How do i import my library from an external hard drive. Exported it as had to wipe pc and reinstal windows but when i try to import nothing happens

    How do i import my library from an external hard drive. Had to export it as had to reinstal windows due to a conflict between windows and i-tunes. Wen i try to import nothing happens despite selecting the file. Can you import from an i-phone to i-tunes?

    What do you mean bye exported the library? 
    There is nothing to export or import.
    The correct process to backup the iTunes library would be to copy the ENTIRE iTunes folder from the computer to the external drive.

  • I need to select and upload a image and corresponding url from an external website using file upload control in MVC4. Please help

    I need to select and upload a image and corresponding  url from an external website using file upload control in MVC4.
    Please help
    Latheesh K Contact No:+91-9747369936

    This forum supports .NET Framework setup.
    As your issue appears to have nothing to do with .NET Framework setup, please ask in the MVC forums for best support.
    http://forums.asp.net/1146.aspx/1?MVC

  • Loading External SWF using Absolute Path

    Hi,
    I am having trouble loading an external swf on a server using the absolute path. This external swf uses webcam streams and is loaded in the original swf file using the URL request code. I can load other swfs but just not that one. I have set the permission of the external swf to allow write/read/execute. Any help is apprieciated.
    P.S. I have also tried changing the location and name but still doesn't help.
    //Loads the augmented SWF into the main timeline.
    var request:URLRequest = new URLRequest("http://www.reminisce.me/files/jz_AR.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    arHolder.addChild(loader);
    arHolder.x=300;
    arHolder.y=125;
    Thank you for your help in advance.
    -John

    I can´t get the linked swf to run in any browser, are you sure that it compiled right?

  • Could we write and read from a external drive using a IPad?

    √could we write and read from a external drive using a IPad?

    No, the iPad doesn't work that way. The only thing you can access is camera cards (with the adaptor).
    Matt

  • When I import photos taken from my Windows PC using a flash drive, the photos in iPhoto are dated as the date last modified on PC instead of date picture taken.

    When I import photos to my iMac, taken from my Windows PC using a flash drive, the photos in iPhoto are dated as the date last modified on PC instead of date picture taken.

    Then you need to ask a PC forum how to export the photos there to include the Metadata (specifically the EXIF data)
    If there is valid EXIF data iPhoto uses it (the EXIF data is originally added to the photo by the digital camera) and if there is no EXIF data then the only inofrmaiton IPhoto have available is the file metadata and that is what is used
    You can correct the dates in iPhoto using the batch change data/time command
    LN

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

Maybe you are looking for

  • File locked message when saving a file with Photoshop

    We've been seeing a problem with several users that is hard to reproduce. Every once in a while when they try to save a file in Photoshop on the server they get a dialogue saying 'the file is locked, use Finder info to unlock the file'. This file is

  • PSC 1210 Mac OS 10.6 Scan multiple pages into one pdf., and ink levels

    Now that I upgraded my Mac OS to Snow Leopard (10.6.8), I have needed to scan on my HP all-in-one psc 1210 either from Preview or from Scan & Fax in System Preferences. Once I scan a page and that page opens up, I AM able to scan additional pages, bu

  • Changing ipod over from Windows to Mac

    I've been using my ipod with my PC for the last 2 years and I now want to change it over to my powerbook. I have all the music on an external drive and will only be selecting some of the music to go on the ipod as the collection is larger than the po

  • How to show start up Disk on Desk top??

    I am use to my iMac having the Hard Disk / Start up disk on my Desk top. Recently bought a Mac Book Pro. Is there a way to have the Hard Disk appear on the Desk Top?

  • Error when Broadcasting PDF format to email

    Hi, The template is getting executed properly through WAD. Even, in portal the report is being generated correctly. The problem is when I try to broadcast PDF format to Email. I am receiving the following error when attempting to broadcast a query as