Embed images in one MovieClip, use in another?

I apologize if you've already read this message. My question
isn't only AS, not only Flash, not only Flex. It's in the
mysterious area where the three come together. I posted this in the
AS discussion, but think it might be better off here.
Is it possible to embed images (jpgs) in one MovieClip, then
load that SWF into another MovieClip and use those images in the
loader? We are trying to avoid reloading an image each time we need
it, but still load them dynamically. We'd like to do this:
Container.swf:
<mx:Application>
<mx:Script>
[Embed(source="images/myimage.jpg")]
public var img: String;
</mx:Script>
</mx:Application>
Then, load that SWF and use its embedded image:
Loader.swf:
<mx:Application>
<mx:Loader id="container" source="Container.swf" />
<mx:HBox>
<mx:Image id="the_image" source="container.content.img"
/>
</mx:HBox>
</mx:Application>
It looks like this should work, and the "resource" string is
properly being passed to the_image (something like
__Resource.43234564.myimage_jpg) but it cannot actually load; we
get a broken image instead.
I'm guessing I somehow need to register the object library of
the Container.swf with my Loader.swf? How?
Or, is this whole enterprise impossible?
Thank you!
Greg

In Flash you may use 'export for runtime sharing' future. In
Flex there
must be a way also (look at adobe devnet topics)
In Flash common problem is you can't control loading progress
of this
add-on. Preload first add-on to one movie without "export for
runtime
sharing" future with loader progress if you need it, then
reload common
movie to 'real' loader - add-on wil be taken from cache
> I apologize if you've already read this message. My
question isn't only AS,
> not only Flash, not only Flex. It's in the mysterious
area where the three
> come together. I posted this in the AS discussion, but
think it might be
> better off here.
>
> Is it possible to embed images (jpgs) in one MovieClip,
then load that SWF
> into another MovieClip and use those images in the
loader? We are trying to
> avoid reloading an image each time we need it, but still
load them dynamically.
> We'd like to do this:
>
> Container.swf:
> <mx:Application>
> <mx:Script>
> [Embed(source="images/myimage.jpg")]
> public var img: String;
> </mx:Script>
> </mx:Application>
>
> Then, load that SWF and use its embedded image:
>
> Loader.swf:
> <mx:Application>
> <mx:Loader id="container" source="Container.swf"
/>
> <mx:HBox>
> <mx:Image id="the_image"
source="container.content.img" />
> </mx:HBox>
> </mx:Application>
>
> It looks like this should work, and the "resource"
string is properly being
> passed to the_image (something like
__Resource.43234564.myimage_jpg) but it
> cannot actually load; we get a broken image instead.
>
> I'm guessing I somehow need to register the object
library of the
> Container.swf with my Loader.swf? How?
>
> Or, is this whole enterprise impossible?
>
> Thank you!
>
> Greg
>
>
>
>

Similar Messages

  • How do I copy an image from one Keynote presentation to another one?

    I have a previously saved presentation on Keynote in iCloud. I created it from my desktop at work. Some of the images I used for the presentation I want to use again in another presentation, onlh this time I am working off my laptop and don't have the same access to those images. Is it possible to copy/paste images from one Keynote presentation into another? I can't even seem to click on the image and save it.
    Any suggestions?

    Clicking and dragging does not work.
    Click on the image and Copy and Paste
    or
    Inspector > Metrics > File Info > click on the icon of the file and drag it to your desktop
    You can then drag that file back in wherever you want.
    Peter

  • I dragged a cut out image from one photoshop document into another and now it is blurry. What to do?

    I dragged a cut out image from one photoshop document into another and now it is blurry. What can I do to prevent this?

    What is the resolution of the image that you "dragged"? The resolution is the number in pixels per inch (ppi). If you dragged a significantly lower resolution file into a higher resolution file, it could result in a blurry image.
    see below:
    For further reading of Key Concepts:
    http://www.adobe.com/designcenter-archive/keyconcepts/articles/concept_resolution.html
    You can determine the image size by choosing Image > Image Size
    below you can see the pixel dimensions of my example image.
    Resolution Basics:
    Adobe TV- http://tv.adobe.com/watch/creative-sweet-tv/photoshop-resolution-basics/
    http://tv.adobe.com/watch/visual-design/getting-started-09-resizing-an-image/
    Adobe Help:
    http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-7945a.h tml
    -janelle

  • How to embed image in html when using JTextPane, HTMLEditorKit, JavaMail

    I am developing a specialized e-mail client that has to be able to send e-mail messages (in html format with images and attachments) that can be read by standard e-mail clients, and receive similar messages from standard e-mail clients.
    I have everything working except for embedding images.
    Images are to appear in the document mixed in with the text, but that's not what I mean by "embed". By "embed" I mean that the image itself is encoded within the html.
    Here's a bit of code to set the context.
    JTextPane bodyPane = new JTextPane();
    bodyPane.setEditorKit(htmlEditorKit);
    bodyPane.setTransferHandler(new DropHandler());
    bodyPane.setDocument(new HTMLDocument());
    In the DropHandler I have the following:
    HTMLDocument htmlDoc = (HTMLDocument) bodyPane.getDocument();
    HTMLEditorKit htmlKit = (HTMLEditorKit) bodyPane.getEditorKit();
    int caretPos = bodyPane.getCaretPosition();
    At this point get "filename", the full path to an image file that has been dropped onto bodyPane.
    String htmlString = "<img src=\"file:///" + filename.replace("\\","/") + "\">";
    htmlKit.insertHTML(htmlDoc, caretPos, htmlString, 0, 0, HTML.Tag.IMG);
    This works just fine. The image is displayed in the document at the point of insertion.
    However, the image itself is an external file. I need to send an e-mail with this image and could send the image file as an attachment, but I obviously can't assume that the recipient of the email is going to save the attachment into the proper location.
    What is the best way to do this?
    There is a technique for embedding the actual image in the html, using this syntax:
    String htmlString = "<a href=\"data:image/png;base64,---mimed png image here--\" alt=\"Red dot\"></a>";
    I can't get this to work in JTextPane, so perhaps it's not supported. Also, there may be limitations on the size of an image. And apparently Internet Explorer doesn't support this.
    From what I read, using a "content identifier", that is, "cid:" and adding the image as another part of the e-mail message is probably the thing to do. I haven't taken the time to explore this yet.
    Does JTextPane support cid? Is that a nonsense question? I suspect what I need to do when the message is being composed is use absolute paths to local files with the images, and then when assembling the e-mail, attach the files and rewrite the html to build in the cid linkage. Similarly, when reading a message with cid's, the thing to do is save the body parts as files and rewrite the cid to point to the actual file.
    I have seen others ask similar questions, one as recently as last December, and the reply was to refer to a Sun tutorial. But that tutorial doesn't address the full problem of 1) inserting an image into a document (instead of attaching an image to a component) and 2) sending it as an e-mail message.
    I have yet to see an example that shows the complete package.
    Am I right that the data option I mentioned is not going to work?
    Am I right that cid is the best approach, and do I understand how to use it?
    Is there something else?
    Thanks
    John

    Hi Rocky,
    Are you using the DC?
    if yes then you need to put the image inside the component folder. after that close the application
    & reopen. You will get the image.
    In case this does not work then try refreshing the portal through server side. Once the cache is cleared, it will be up to view.
    Also check the Activity list you have created. It should be added to the dtr properly or else it wont be reflected once reimported the configurations.
    Regards
    Chander Kararia

  • How to embed image in email msg using MAC version of PSE

    I can embed an image as Photo Mail in email msg using WIN version of PSE8 but can only send the image as an attachment in MAC version. Is there a way to embed images in MAC version email msgs?

    Well, it's not complicated at all really. Just put the cursor in a message where you want the image and drop it in, or else click the stationery button in mail, choose a template, drag over the placeholder "greeking" text and replace it with your own, then drag your own photos into the placeholders. Here's a look at one of the templates. You can see that as my mouse is over the right hand image it tells you to put your own photo there in place of the sample. Moving over the other ones does the same thing.

  • Writing multiple images to one file using ImageIO

    I am having trouble saving and reading multiple images from to/from one file. Here is the best i can come up with:
    //this is utilizing an ObjectOutputStream because i need to also save some objects to the file
    ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("C:\\images.dat"));
    oos.writeInt(ImageTable.size());
    for(int k = 0; k  < ImageTable.size(); k++)
        ImageIO.write((BufferedImage)ImageTable.get(k), "png", oos);
        oos.flush();
    //////////////////////////read function/////////////////////////
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream("C:\\images.dat"));
    int size = ois.readInt();
    for(int k = 0; k < size; k++)
        ImageTable.add(ImageIO.read(ois));
    }What it seems to do is read the first image and then place the marker at the end of the file so each consecutive calls to reading the file end up in either null, -1, or an EOF exception (bleh). Does anyone know how i can do this properly?
    The code does run and saves something, although it is hard to tell exactly what it is saving since it is all in png format, it also loads the first image properly.

    Is it possible to pack the different images in one big image?Conversely, some image formats let you store multiple images in a single image file.
    Here's a demo. My results are that I don't have a gif writer, tiff can write sequences (this
    is a well-known tiff property), I can trick (?) jpeg into stroring multiple images and I
    can't get png to work: three images go in, one comes out.
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.imageio.*;
    import javax.swing.*;
    import java.util.List;
    public class MultiImageTest {
        public static void main(String[] args) throws IOException {
            URL url1 = new URL("http://today.java.net/jag/bio/JagHeadshot-small.jpg");
            URL url2 = new URL("http://today.java.net/jag/bio/JAG2001small.jpg");
            URL url3 = new URL("http://today.java.net/jag/Image24-small.jpeg");
            BufferedImage[] images = {ImageIO.read(url1), ImageIO.read(url2), ImageIO.read(url3)};
            display(images, "original", 0, 0);
            String[] suffixes = {"gif", "jpeg", "png", "tiff"};
            int x = 30, y = 20;
            for(int j=0; j<suffixes.length; ++j) {
                String suffix = suffixes[j];
                try {
                    writeFile(images, suffix);
                    display(readFile(suffix), suffix, x, y);
                    x += 30;
                    y += 20;
                } catch (Exception e) {
                    System.err.println(suffix + ": " + e.getMessage());
        static void writeFile(BufferedImage[] images, String suffix) throws IOException {
            Iterator ws = ImageIO.getImageWritersBySuffix(suffix);
            if (!ws.hasNext())
                throw new IOException("no writer for: " + suffix);
            ImageWriter w = (ImageWriter) ws.next();
            File file = new File("temp." + suffix);
            file.delete();
            w.setOutput(ImageIO.createImageOutputStream(file));
            if (w.canWriteSequence()) {
                System.out.println("Using writeToSequence for format " + suffix);
                w.prepareWriteSequence(null);
                for(int j=0; j<images.length; ++j)
                    w.writeToSequence(new IIOImage(images[j], null, null), null);
                w.endWriteSequence();
            } else {
                System.out.println("cross fingers for format " + suffix);
                for(int j=0; j<images.length; ++j)
                    w.write(images[j]);
        static BufferedImage[] readFile(String suffix) throws IOException {
            Iterator rs = ImageIO.getImageReadersBySuffix(suffix);
            if (!rs.hasNext())
                throw new IOException("no reader for: " + suffix);
            ImageReader r = (ImageReader) rs.next();
            File file = new File("temp." + suffix);
            if (!file.exists())
                throw new IOException("no file: " + file.getName());
            r.setInput(ImageIO.createImageInputStream(file));
            List images = new ArrayList();
            for(int j=0; true; ++j) {
                try {
                    images.add(r.read(j));
                } catch (IndexOutOfBoundsException e) {
                    break;
            return (BufferedImage[]) images.toArray(new BufferedImage[images.size()]);
        static void display(BufferedImage[] images, String title, int x, int y) {
            JPanel cp = new JPanel(new GridLayout(1,0));
            for(int j=0; j<images.length; ++j)
                cp.add(new JLabel(new ImageIcon(images[j])));
            JFrame f = new JFrame(title);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(cp));
            f.pack();
            f.setLocation(x, y);
            f.setVisible(true);

  • How to print multiple custom size images on one sheet using PSE 10.

    I am running Photoshop Elements 10 on Windows 7/64 bit.
    I want to print six 2.5 inch by 1.75 inch images of one photo on a single 8.5 inch by 11.0 inch sheet.
    How do I do that?

    greenecar,
    Use the crop tool to crop the image to 2.5x1.75", with resolution 240px/in. Enter these values on the tool's option bar, then drag out the crop shield, and comit.
    Go to File>New>blank file, enter 8.5x11", background white (or anything else to suit), resolution 240 px/in. This will be your canvas
    Go back to the cropped image, go to Select>all, then Edit>copy to put it on the clipboard
    Open the canvas from Step #2
    Go to Edit>paste. Do this 5 more times. You should see 7 layers in the layers palette: The background layer (canvas), and 6 layers with the cropped picture
    Use the move tool to position the 6 ;pictures, one layer at a time
    You can go to View>Grid to open the grid to help with orientation. It will not print

  • Embed a font in one SWF use in another?

    Long version:
    I've got a "player" app that I've built that shows content
    from various XML files. I have certain common fonts embedded in it
    (Verdana, Arial, Times, etc.) that it uses to display text. Now,
    I've got a client with a special symbol font that I'll need to pull
    characters from to show specific text in my app. I can't embed this
    font in my app (due to many considerations), but I'd like to use it
    without having to use each character as a graphic (by converting
    every character in the font into a JPG). So, can I embed his font
    in a SWF and load that SWF to use the font in my app?
    Short version:
    SWF1 loads SWF2 which contains an embedded font. SWF1 uses
    that font via a TextFormant instance to show text on the stage.
    Is this possible? My target is Flash 7 player using AS2.
    Thanks!
    Matt

    that approach won't work i don't think. i've looked at shared
    libs before and don't remember it being that useful. but i'll take
    another look.
    is there now way in pure code to do it?

  • How to move image from one hard drive to another - T41

    Hi All
    I have a T41 which has a 30GB hard drive, over the time I have installed quite a few programs which I don't have the cd's for to reinstall. Now that I am almost out of space I need to swap my present Hard Drive with another one. I already bought a 60GB HD for the laptop but I don't want to just swap it, what I want to do is make an image of the existing HD and past it in the new HD and then swap the HD so that I have everything from my previous HD.
    Can I do this with Ghost 2003 or maybe with anyother ghost app. Also what if I just make a backup of the registry and system state through windows backup tools then install windows XP in the new HD and then restore the restore the system state and registry from the backup. In this wall I will loose the hidden partition.
    Please advice whether I can image of the current HD and then move it to the new HD.
    Thanks in advance 

    Thanks for the responses for far, I really appriciate it.
    Ok, I have two question for two response I received:
    To infocatchjp:
    1. I didn't find any connector for "ThinkPad 2nd HDD Adapter for Ultrabay Slim".
    2. Rescue and recovey is a windows tool or built in IBM tool.
    3. Would it tranfer the program as well and also the hidden partition for the laptop.
    To stbigham:
    I went to the website for the given software and checked out its feature. My only question is would the software transfer the existing and hidden partition when it is moved to the new HD.
    thank you both for your support. Hope to hear from you soon.
    Haydes 

  • Transferring images from one iPhoto library to another.....

    I recently went on holiday and took lots of photos and loaded them daily onto my MBP, however now I am back home and I would like to transfer the holiday photos to my iMac which holds my master iPhoto library.
    What is the best way to go around this to ensure that I do not lose any images and/or image quality.
    Thanks in advance.

    Ideally just plug your camera into the other computer and import the pictures.
    If the pictures are no longer on the camera then put both your Macs on the same network and turn on Photo Sharing: http://docs.info.apple.com/article.html?path=iPhoto/8.0/en/6371.html
    __You can then drag the photos from the one computer's iPhoto Library to the other.
    Alternatively you can highlight the pictures you want on the other computer and go to File > Export > File Export > Kind > Original and export to a folder on the desktop. You can then move that folder using File Sharing or an external drive to the other computer and import them there.
    And Finally, you could burn them to a disk and then bring the disk over.
    All these methods give you the exact same image you imported to iPhoto originally. No loss of image quality.
    Hope that helps.

  • Multiplying one MovieClip using code

    Hi,
    I have been tring different strategies to add an animated Movie Clip of a fly to the stage.
    I have a TimerEvent and an Enter_Stage event in the code. Both seem to be doing their part with no conflicts.
    Part of the increase the size over time.
    I would like to use one of them to increase the number of totalFly movieClips over a duration of maybe twenty seconds or less.
    Should I write a Class that contains all the variables using Math as a multiplier or can I do this directly in my curent code?
    I left comments out of the code but can place them in if that would makes thing clear.
    Thanks for helping.
    stop();
    var insert:Timer=new Timer(5000);
    insert.addEventListener(TimerEvent.TIMER, newFly);
    insert.start();
    var inc:int=0;
    var container:Sprite = new Sprite();
    addChild(container);
    var totalFly:Fly = new Fly();
    totalFly.x=totalFly.y=250;
    totalFly.scaleX=0.5;
    totalFly.scaleY=0.5;
    var newOne:Timer=new Timer(3000);
    newOne.addEventListener(TimerEvent.TIMER, anotherFly);
    newOne.start();
    function anotherFly(event:TimerEvent):void {
        container.addChild(totalFly);
        totalFly.x+=20;
        totalFly.y+=20;
    container.addEventListener(Event.ENTER_FRAME, oneMore);
    function oneMore(event:Event):void {
        addChild(totalFly);
        totalFly.rotation+=20;
    function newFly(event:TimerEvent):void {
        totalFly.x+=50;
        totalFly.scaleX=2;
        totalFly.scaleY=2;

    Here's some dealings with randomizing the properties of each...
    totalFly.rotation = Math.random()*360;
    totalFly.x = Math.random()*stage.stageWidth;
    totalFly.y = Math.random()*stage.stageHeight;
    totalFly.scaleX = totalFly.scaleY= Math.random();
    If you want more control of the randomness, for instance you want to scale no less than 50%, then you make that a constant and add the random part to it...
    // for just under 1.0 max
    totalFly.scaleX = totalFly.scaleY= 0.5 + Math.random()*0.5;

  • How to transfer images from one iPhoto library to another.

    Hi.  I run my main iPhoto library on an EHD but I also have an iPhoto library on my MBP.  I want to consolidate the two librarys and get rid of all the iamges on the MBP and just have them all on my EHD.  My question is, what is the easiest way to transfer all the contents form my library on my MBP to my library on my EHD and will it copy across all my edited versions? 
    Many thanks in anticipation.....
    Nathan

    To merge two iPhoto libraries and to perserve all your edits, use the paid version of
    iPhoto Library Manager
    Or, if you have access to an Aperture installation, and your iPhoto version is iPhoto 9.3 or later, you can merge iPhoto Libraries in Aperture. Aperture 3.3: How to use Aperture to merge iPhoto libraries
    All other methods (exporting from one library and reimporting into the other) will not copy over your books, albums, etc.

  • Projecting image from one laptop screen to another

    So, I've got 2 MacBook Pro computers, and the LCD screen went dead on one of them (thanks to me dropping the computer. bummer.). Is there a way for me to connect the two laptops together (i.e. FireWire), and project the "screen" of the broken computer onto the LCD of the working computer?

    The MBP does not have a video IN. Possibly by using software like ScreenRecycler (but you may need an external display to configure it on the MBP with the broken display.
    http://www.screenrecycler.com/
    The only other possibility would to get something like an eyeTV and cables to adapt the DVI out from the screenless machine to the eyeTV input.
    http://www.elgato.com/elgato/na/mainmenu/products/hybrid09/product1.en.html

  • Images I move from one folder into another are disappearing, at first it was occurring immediately if I did not copy and paste the images. Today however I found out that images I had been using for days just up and vanished from their new location.

    Images I move from one folder into another are disappearing, at first it was occurring immediately and only if I did not copy and paste the images. Today however I found out that images I had been using for days just up and vanished from their new location. A few of these images had copies in another folder that remained and the ones I couldn't find may or may not have ever had copies. I had backed up my system with time machine recently as well, so I went into the backup to retreive the lost images. When I searched and found the backup copies I got the error "the file alias cannot be opened because the original cannot be located". The crazy thing is that the images that remained on my computer did not give me the same error and opened like they should.
    In short images that I am creating, saving, and using are disapearing so epically that even time machine versions are affected when retrieval is attempted. Any suggestions as to what I could be doing wrong without realizing it? Or perhaps other people have had similar bugs that are software related and have a solution?

    Hi Kevin,
    I understand what you tried to do but it doesn't work that way. Swapping drive names will just mess things up.
    You should be able to reconnect the files though: in the Locate Referenced Files dialog make sure you click the Show Reconnect Options button — this will give you access to all the connected drives. Locate one of the files and hit Reconnect All. Should do the trick.
    Best

  • Upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

    upgarded to PE 13 - How do I drag an image from one screen to another (using 2 monitors)

Maybe you are looking for

  • Can send but not reply or forward on all mobile devices

    Hi all, I have a 2013 environment with MDM also in place. Just recently all mobile devices (iOS, Android, Windows OS) have stopped being able to reply or forward to emails on their mobile device. Nothing has changed in the environment that I'm aware

  • SCOM receiving SNMP traps from HP IMC

    Hi all, I've been tasked with creating SCOM alerts from SNMP traps which are forwarded from HP IMC. Each SNMP trap will arrive at SCOM from a single source (IMC server) but each will contain different information. Can someone suggest the best way for

  • About calling a program while inserting the fields

    hi friends,                 Can you help to know how we can achieve to automatically calculate the field value and assign when all other fields were inserted... Consider num1,num2,num3 are three fields I am calculating the num1 and num2 values and pu

  • Howto stop the application module from using a DB

    Hello, Maybe and unusual question, but is there a way to stop the application module from connect to a DB? I know its purpose is to do so. But currently we are using 'stub' views and entities. In the executequery and dodml we wrote our own code to ac

  • How to downlaod a version of JRE using JNLP

    I have an issue which is currently blocking my development. The issue is as follows There are 5-6 applications launched via Java Web Start. Each application requires different version of JRE for lauching. The JRE version and the download url can be p