Loading the same image multiple times

I'm trying to dynamically load a single image multiple times
into flash. Basically I want to end up with two movieclips mc1 and
mc2 that contain the image. I'm currently using the Loader
component (connected to the ProgressBar) to dynamically load the
image. It works fine for loading the image once but I'm really not
sure how to go about creating a second movie clip with the image.
Here's my code for loading the first image:
var mc1:MovieClip = new MovieClip();
var listener:Object = new Object();
listener.complete = function(eventObj:Object){
nextFrame();
imageLoader.addEventListener("complete", listener);
mc1 = imageLoader.content;
imageLoader.load(imgURL);
But everything I've tried to load mc2 with that same image
has failed. I've tried 'mc2 = imageLoader.content', 'mc2 = mc1',
'attachMovie', 'duplicateMovieClip', calling imageLoader.load()
twice on the imgURL, and creating a second Loader component and
loading the image again. All of these methods have invariably
failed. Most of them can load mc1 alright and sometimes mc2 even
shows up on the stage but in the AS mc2 is always undefined.
Can anybody point me in the right direction for loading
multiple copies of the same image? It really shouldn't be that
hard, should it?

Well I figured out a solution. Turns out Flash doesn't allow
you to duplicate dynamically loaded content like an image in a
movieclip. But there is a little class called BitmapData that will
do precisely what I was looking for. Here's the link I got this
info from:
http://www.senocular.com/flash/source.php?id=0.174

Similar Messages

  • How to automate saving the same image multiple times?

    Hello. I wish to save the same image multiple times in a folder... is there a way to automate this function? I also need the flexibility of determining the starting number in this image sequence. Thanks.

    Good day!
    I would recommend asking for help over at
    Photoshop Scripting
    And going into more detail about what you want to achieve (maybe post a screenshot, diagram, mock-up to illustrate it).
    Regards,
    Pfaffenbichler

  • [JS][CS3] Place the same image multiple times?

    I have a javascript that processes a set of multiple-choice test items in XML.  The XML structure identifies parts of the item such as intro, question, answer choice A, answer choice B, etc.
    I have a small AI file for each answer choice that has a fill-in-the-bubble circle with the letter A, B, C, or D inside.  The part of the script that processes each answer choice has a line that does myElement.insertionPoints.item(0).place(answerBubbleFile), in other words it places the answer bubble graphic at the beginning of the answer choice.
    The problem I am having is that this ends up creating a huge INDD file and likewise huge PDFs.  The same 4 graphics are evidently being stored separately for each item, upwards of 50 items per test.
    Is there a more efficient way to do this where I could have only one copy of each graphic and have each of the places where it appears simply be a reference to that one file?

    InDesign doesn't support SVG without a third party plugin.
    The problem with the file size is not because of the image, but because of the preview, so I don't think file type makes any difference...
    If the graphic is a simple vector, you can try pasting from Illustrator as native InDesign paths. Those don't have preview images.
    Harbs

  • Problem loading pages on safari.  Each time I load a page it seems to be trying to load the same page multiple times.

    I can see the address loading repeatedly on the address line and the page itself loads repeatedly.  The internet is working fine and the other programs on my macbook pro are working fine. 

    Go step by by step and test.
    Reset Safari.
    Click Safari in the menu bar.
    From the drop down select "Reset Safari".
    Click "Reset".
    Delete Cookies
    Safari > Preferences > Privacy > Cookies and other website data:
    Click “Remove All Website Data”.
    Empty Caches
    Safari > Preference > Advanced
    Checkmark the box for "Show Develop menu in menu bar".
    Develop menu will appear in the Safari menu bar.
    Click Develop and select "Empty Caches" from the dropdown.
    Turn off Extensions if any, and launch Safari.
    Safari > Preferences > Extensions

  • Why is Apple TV showing the same computer multiple times for Home Sharing?

    Why is my Apple TV showing the same computer multiple times for Home Sharing? Also have connectivity issues. Sometimes will lose signal.
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    JonRod's music
    I recently updated to Yosemite and never had this issue before.

    I'm not 100% sure of the ins and outs, but it's some sort of known issue between Yosemite, Airport and wifi. All you can do is wait for a fix and keep restarting your equipment as and when needed, unless you have the ability to connect your Mac via ethernet.

  • Can I gift the same app multiple times to multiple users?

    Can I gift the same app multiple times to multiple users?
    Like, if I wanted to buy iMovie for 3 friends, could I buy the app as a gift 3 times?

    You should be able to gift it multiple times
    Gifting content : http://support.apple.com/kb/HT2736

  • Is it possible to copy the same database multiple times simultaneously?

    This is the setup of my environment.
    I have a 'master' database that contains the full schema plus some pre-populated data such as default settings. When database schema changes are made, they get made to the master database. When a new customer signs up for the service, I make a copy of this
    master database (using SMO) that will now be the database containing all of the customer's information. The database is rather large, and the copy operation can take a couple minutes.
    Everything works fine as expected, unless I try to provision two new customers at the same time. It appears that Azure only allows for one DB copy operation at a time. Is there a way to allow for copying the same database multiple times simultaneously?
    Thanks for you input. I understand that this is likely not the optimal setup, and that there is many better ways of doing this, but I am somewhat heavily invested in the current process and I would like to find out how to make it work if I can.

    BTW, you can do this programatically by using PowerShell (https://msdn.microsoft.com/en-us/library/ee210569.aspx), SqlPackage (http://www.benday.com/2012/12/18/deploy-a-sql-server-database-projects-dacpac-with-sqlpackage-exe/)
    or the SQL Server binaries for .NET (http://www.vijayt.com/Post/Deploying-a-data-tier-application-in-SQL-Azure-programatically)
    Hope this helps.
    Alex

  • TS3276 how do I get Mail to stop downloading the same email multiple times?

    My mail keeps downloading the same email multiple times.  I've had as many as 10 of the same emial.  How do I stop this?

    Me too - did you ever figure it out?
    You can't even delete from the server in mountain lion.... I did it from my old mac, but it didn't work. I keep having 11,000 new emails that can not even be deleted in blocks!!!
    Was it a gmail account? Mine is, and my other 2 are fine...

  • Running the same code multiple times with different paramters automatica​lly

    Hi guys,
    I want to run the same code multiple times with different paramters automatically. Actually, I am doing some sample scans which takes around 2 hours n then I have to be there to change the paramters and run it again. Mostly I do use folowing paramters only
    X_Intial, X_Final, X-StepSize
    Y_Intial, Y_Final, Y-StepSize
       Thanks,
    Dushyant

    All you have to di is put all of the parameters for each run into a cluster array. Surround your main program with a for loop and wire the cluster array through the for loop. A for loop will autoindex an input array so inside the for loop you just have to unbundle the cluster to get the parameters for each run.
    Message Edited by Dennis Knutson on 07-13-2006 07:50 AM
    Attachments:
    Cluster Array.JPG ‏9 KB

  • If you make a picture in pages.... how do i duplicate the image on the same page multiple times????????!!!!

    If I make a little picute in pages ... HOW DO I DUPLICATE THE IMAGE MULTIPLE TIMES ON THE SAME PAGE!11?????!!!!

    Or you can hold down the Option key while you click on the image and drag to create a copy. Then Select All and repeat. Repeat again, each time doubling your image count. You may, at an early stage, want to align your photos so that they will be in position when you Option-Drag the next set.
    Walt

  • Same image multiple times in one document

    Hi there,
    I'm a software developer, and currently the system I'm working on produces postscript documents for invoices/orders etc. and I'm looking for a way to reduce the size of the postscript file.  One simply way would be to re-use the same image (company logo, for example), rather than specifying it again for every page.
    The images are produced using the linux tool ps2pdf - the output is then chopped up so it literally only has the image producing code, and then dumped as-is into the document where the image is required.  What I'd like to do is put this postscript image into a procedure, then call it with the height, width, x and y position whenever I need it.  Doing this will drastically reduce down the PS file from MB sizes to KB sizes.
    This is an example of how the documents are currently produced: Postscript multiple images - Pastebin.com
    This is an example of what I thought would work, with the image inside a procedure: Postscript multiple images - with procedure - Pastebin.com
    (These aren't actually real documents, just an example of how it works!)
    Can anyone help me to get the second example working?  Essentially, I copied the image producing code into a procedure, and then I'm trying to call it.  No matter what I try, it doesn't want to play - the error I'm getting in Ghostscript is "/syntaxerror in --%ztokenexec_continue--".  What I can find on the web about this error doesn't help - I'm not particularly experienced with postscript, so please be nice!
    Thanks in advance!
    John

    And for why it doesn't work... typical image definitions look like this
    parameters including "currentfile" image
    lines of image data
    What happens when this is executed is that the interpreter puts the parameters on the stack, then calls image. Image reads from its source, currentfile, which is exactly the same source used to execute operands and operators. When image has finished, it stops reading currentfile and the interpreter will resume.
    Now, when a procedure is defined the input is tokenised, put in an array, and this is saved for later use.
    When a procedure is executed, the operands and operators in the array are repeated almost as if they were found in the input. But this is false security, because it breaks down with inline data. If you put the lines above in a procedure, then EACH TIME the procedure is executed it will read from currentfile - and the current position is probably the call to the procedure. In fact, you can define a procedure like the above but leave out the lines of inline data. Include the lines of inline data after each call and it will read the image each time, but this does not help with your aim.
    This was very tricky to solve before ReusableStreamDecode, which allows you to turn any section of your input into a file to be used over and over - it becomes currentfile. This was invented for level 3 PostScript.

  • I have the same image 200 times on a webpage... how can I relink them all at once?

    Hi, first I'm french and I might not be using the right terms in the 'search engine' as I'm unable to find the answer and I have been looking for more than an hour...
    I unfortunately saved my htm document on my desktop. After putting the file in its initial folder, I realize that all the link for my pictures were broken. I can update them one by one... But I happen to have the same image featured over 200 times on that same webpage... I'm sure there must be a quicker way to relink that image than doing it one by one.
    Thank you for your time.

    IrieItes wrote:
    I'm sure there must be a quicker way to relink that image than doing it one by one.
    You should be able to correct that from the Errors tab on the right-hand side of the site window. It should show up as a Missing File. Select it, then point and shoot at the correct image file in the FIles tab on the left-hand side of the site window.
    John

  • Can I use the "same" button multiple times for multiple galleries?

    OK so I am extremely untrained in CS4 and Actionscript. However I have managed to get along fairly well until I started to dynamically upload images as a gallery. This works great if I have one gallery, but for my site I have 9 galleries!!! I have a back and next button, but I want to be able to use those same buttons for all of the galleries so they look the same. I have split them up and renamed them, but I am clueless on how to script the buttons to work. Please help...and don't laugh at my poor scripting. This is what I have now because I do not know where to put the other button names without getting errors.
    stop();
    next_btn .addEventListener(MouseEvent.CLICK, nextImage);
    var imageNumber: Number=1;
    function checkNumber(): void{
        next_btn.visible=true;
        back_btn.visible=true;
        if(imageNumber==15){
            trace(imageNumber);
        next_btn.visible=false;
        if(imageNumber==1){
            trace(imageNumber);
        back_btn.visible=false;
    function nextImage(evtObj:MouseEvent):void {
        imageNumber++;
        mc_engagement.source= "photo/engagement/en0"+imageNumber+".jpg";
        mc_amish.source= "photo/amish/Amish"+imageNumber+".jpg";
        mc_chicago.source= "photo/chicago/ch"+imageNumber+".jpg";
        mc_landscapes.source= "photo/landscapes/land"+imageNumber+".jpg";
        mc_goodvsevil.source= "photo/goodvsevil/ge"+imageNumber+".png";
        mc_animals.source= "design/animals/an"+imageNumber+".png";
        mc_icons.source= "design/icons/icon0"+imageNumber+".png";
        mc_objects.source= "design/objects/pc"+imageNumber+".png";
        mc_typography.source= "design/typography/type"+imageNumber+".png";
        checkNumber();
    back_btn .addEventListener(MouseEvent.CLICK, backImage);
    function backImage(evtObj:MouseEvent):void {
        imageNumber--;
        mc_engagement.source= "photo/engagement/en0"+imageNumber+".jpg";
        mc_amish.source= "photo/amish/Amish"+imageNumber+".jpg";
        mc_chicago.source= "photo/chicago/ch"+imageNumber+".jpg";
        mc_landscapes.source= "photo/landscapes/land"+imageNumber+".jpg";
        mc_goodvsevil.source= "photo/goodvsevil/ge"+imageNumber+".png";
        mc_animals.source= "design/animals/an"+imageNumber+".png";
        mc_icons.source= "design/icons/icon0"+imageNumber+".png";
        mc_objects.source= "design/objects/pc"+imageNumber+".png";
        mc_typography.source= "design/typography/type"+imageNumber+".png";
        checkNumber();

    I'm still a novice with Flash myself, but I have two comments.
    First, at this point, won't your buttons control all galleries at the same time? Which means, if I go to image 5 in one gallery, then move to another gallery, I'll start at image 5, because the actions are all connected.
    Second, you can definitely use the same buttons for multiple galleries. It seems to me that as long as you've assigned the buttons an instance name, these actions should already work to control all the galleries (see the note above). I guess I would need to understand a bit more about how your project is built.

  • Placing the same object multiple times

    Does anyone know how to place an object multiple times in either Illustrator or InDesign?  I have a small graphic that I would like to have repeated (probably hundreds of times) to create a background.  I could place it over and over (and over and over and over), but that would be way too labor intensive.
    Is there a way to put it in like it is a self-replicating background?
    Thanks,
    John

    A Symbol, by definition, is stored only once in the file. A Symbol Instance is just a reference. When an Instance is duplicated, only a reference is duplicated.
    Evidently Transform Effect--albeit "live"--does not do the same. It actually does create multiple duplicates of the original. The duplicates are "linked" to the original so that if the original changes, the effect is reapplied on-the-fly in response--but it is applied (and the copies made) all the same. Copies of a Symbol Instance, however, are in and of themselves nothing but position/scale references to the original. So Transform Effect is replicating just those references.
    I don't really find this surprising. Consider other so-called "live" effects. When you add multiple strokes and fills to a path, you are not just adding position/size references to the path; the added strokes and fills are, in fact, being created--regardless of the fact that they are recreated on-the-fly if you modify the path.
    Same way with Pattern fills. The pattern is actually stepped-and-repeated enough times to fill the clipping path to which it is applied. If you reshape or resize the clipping path, the Pattern Fill gets re-built on-the-fly. But it still gets built all the same.
    Apply a live Drop Shadow Effect. That raster image acutally gets created. Change the object to which it is applied, or change the parameters (like resolution) of the shadow, and the raster gets deleted and a new one gets created on-the-fly. But it still gets created, and exists in the file until and unless it is changed.
    I think of "Expanding" a live effect as nothing more than breaking the "link" between all the extra created stuff (which is there) and the object to which it was applied. I don't think of all that extra stuff as "not existing yet." It exists. It's been drawn. You're just not allowed to manipulate it directly, because it is "linked" to the original so that it will be deleted and re-created if you edit the original. Breaking the link (Expanding) doesn't take long, becaues all that stuff is already created; it's not just a string of concise commands waiting to be created. It's already there. But make an edit to the original and it does take a long time to re-draw, because all the extra stuff now has to be re-created.
    Do a Transform Effect on a Symbol Instance. Expand the result. You'll see that what you have is a group of Symbol Instances. And Symbol Instances are just references--commands to "put a copy of that here."
    Use a Symbol Instance in some other construct, like for example, a Pattern Fill. Expand the Pattern Fill and you'll not end up with a group of Symbol Instances; you'll end up with a bunch of actual copies of the artwork which the Symbol contains.
    Same with a Scatter Brush. Now, I can understand a Symbol not working with a Pattern Brush or Art Brush because of the enveloping that has to go on. But all a Scatter Brush does is position/scale/rotate copies. So I would expect a Symbol Instance used in a Scatter Brush to create Symbol Instances. But it doesn't. Try it. Draw a red circle. Make it a Symbol. Use the Symbol Instance to define a Scatter Brush. Draw a path and apply the Brush.  Now doubleClick the original Instance still on the page to put it in Isolation Mode. Change its fill to green. Exit Isolation Mode. The circles on the Brush Path do not update.  They are actual copies of artwork, not Symbol Instances. Who knows why? Perhaps it would break other features/behaviors of Scatter Brushes I never use (Wacom tilt?). Or maybe they could have made it work with Symbols, but just didn't. Didn't AI Brushes exist before Symbols? Illustrator's history is full of later features not being well integrated into the pre-existing feature set (ex: LivePaint and Brushes).
    JET

  • Printing the same page multiple times on one sheet

    So last year I wanted to print out minature versions of my card design and I was able to do that by printing out multiple copies of the same thing on one sheet of paper. Of course that was a while ago and now today I can't do the same thing. I remember printing the same page(copy) multiple times either in acrobat or indesign. I see that I have a front and back version for last years card and I'm assuming I must have done it in acrobat. Last year when I looked at the preview there was multiple copies of my page. This year I only see 1 even as I choose the other things. At first I thought it might have been the version I was using on my windows as opposed to the version on my mac. But now I'm on my mac and I still don't see how I did it last year. Please help! I keep reading that this can't be done but I remember doing the same thing last year. It was the 16 copies of the same thing option. I tried it again this time but it doesn't work. I tried printing the 4 copies only 1 copy was printed.(the preview didn't even show all copies like last year) The verson of acrobat is X. version 10.1.4

    What exact version of iPhoto 9 are you using? Version 9.5's solution will be different from the solution for earlier versions of iPhoto 9.
    OT

Maybe you are looking for