How to reduce memory usage when loading bitmaps from the library?

When I use BitmapData.loadBitmap() to load an image from the library and then attachBitmap() to add it to a MovieClip it takes a lot more memory as opposed to just having the same image inside a MovieClip statically in a frame on it's timeline.
The function dispose() not only clears the BitmapData object but also destroys the previously attached bitmap inside the MovieClip, so it can not be used to free any memory.
Is it how it is supposed to be or is there any other way to dynamically attach bitmaps with memory usage comparable to just having them on stage?

no, you use attachMovie() to create instance from library movieclips that have a linkage id.
you can then create a bitmapdata instance and use the draw() method to overlay as many as needed.

Similar Messages

  • How to load images from the library (png)?

    This is my first time using the forum so sorry if it's not professionally set up. I am trying to make an inventory system and I'm trying to find a way to have a Slot (MovieClip) holding a child of probably another MovieClip witch will display the icon according to whatever is in that Slot... As soon as I figure out how to have a MovieClip display an image and then change that image by loading it from the library, I can finish the rest! So let me try to demonstrate:
    (Note: This is not actual code, it's just a demonstration of what I'm trying to accomplish)
    Item1 = Name: "HP Potion", Icon: "HP_Potion.png"
    Item2 = Name: "MP Potion", Icon: "MP_Potion.png"
    Item3 = Name: "Sword", Icon: "Sword.png"
    Item4 = Name: "Shield", Icon: "Shield.png"
    Slot1.nameField.text = Item1.Name //HP Potion
    Slot1.mc_img = Item1.Icon//HP_Potion.png
    ~Ok so what I am trying to do is see if there is a way to change what image the MovieClip displays, just by code. I don't want to put each individual picture in a frame on the MovieClip's timeline
    Sorry about not having any code, I've been working on it for a few hours, and I can't find anything online that doesn't say put it in a timeline.
    If you know how to do what I'm asking with a spritesheet instead of individual images, that's fine too! I'll just have to join all the images together

    Alright so let's get down to buisness... what I'm asking, is it impossible to make it simple? I can't just change the bitmap of the MovieClip. If you open up the MovieClip and view it's timeline, the image is a bitmap file withing that MovieClip so if you're able to manipulate other things of a MovieClip, you should be able to manipulate that too right? Such as "MovieClip.Bitmap" (I know that's not the actual property but could it be done?).

  • Attach a Bitmap from the library in AS3.0

    Hi
    please help me, I need code to attach a bitmap from the
    library.
    I have this code but it dose not work:
    var bmp:Bitmap = new Bitmap(Photo1);
    addChild(bmp);
    bmp.x = 100;
    bmp.y = 100;
    //where Photo1 is the linkage class
    Thanks a lot

    var bmp:Bitmap = new Bitmap(new Photo1(0,0));
    If you look at the linkage identifier for Photo1 you will see
    that the base class is BitmapData. The Bitmap() constructor accepts
    a BitmapData object as its first parameter.

  • How to reduce memory usage?

    OK - I've read through a ton of posts that discuss the "Out of memory" problem in Encore, but what can I do to reduce memory usage?
    I'm trying to produce a very simple Blu-Ray (h.264) project in Encore CS3 on Windows Vista. There are 8 or 9 timelines, a main menu, and 6 sub-menus. Each sub-menu has six static buttons. There are no transitons or motion menus. When I load the project, Task Manager says Encore is using about 1.3 GB RAM. I constantly get "out of memory" errors.
    I've loaded the same project on Vista 32-bit w/ 4GB RAM and Vista 64-bit w/ 8 GB RAM. Same behavior on both.
    Two questions:
    1. Why does Encore need 1.3 GB RAM for such a simple project?
    2. How do I reduce the memory usage?
    TIA for help on the PITA,
    rgames

    Please check with below link, if this can help.
    http://forums.creativecow.net/thread/145/863785#863796

  • How can you retieve a list of classes from the Library

    Is it possible to retrieve a list of the Linkage or Export
    Classes from a swf library dynamically?
    I am building an application where I allow the user to load
    an asset swf at runtime, then they can choose to load any Exported
    class from the library of the swf. Currently it works if you know
    the name of the asset, that you want to load, but I would like to
    be able to bring up a chooser list of the assets, rather than
    having to type the Class names.
    So far I have only seen examples where "if you know the class
    name you can load it", but nothing concerning pulling the list.
    There must be a list somewhere in flash, I just want to tap into
    that.

    I saw this before and did not have a chance to go through it
    completely.
    As I was reading it, though it did not seem to be giving me
    the answer, as they seem to extend the Export clips in the library
    by extending the class.
    I'll run through that and see.
    It does give me another idea though.
    (crazy) Idea:
    What if I extend the loader class and add a method, kind of
    like what they are doing on the document class of the loaded swf,
    to pull the class names. They hard code in the class names into the
    array though.... so that is the crux of the issue.
    Somehow I think this concept is doomed to fail but, I will
    also see if that is possible.
    I suppose for the application, I could require that any user
    would use a swf with a document class that has the getAssets()
    method.... also has some problems .... namely dealing with the
    issue of "what if they do not extend" and having it fail
    gracefully.
    oh well, food for thought... I will leave this open for now
    and perhaps I will post some answer.

  • ?How do I remove  audio books I got from the library using overdrive media console

    How do I remove audio books from my ipod touch  I received from the library using overdrive media console?

    To remove a book from a mobile device plug the device into the USB port and open iTunes. Click the disclosure triangle to the left of your iPod, iPhone, or iPad in the Device section of the left hand menu of iTunes so that you can see the device’s subcontents. For an MP3 book select the Music subsection, right click on the book and choose Delete.  For a WMA book (Windows), select the Book subsection, right click on the book and choose Delete.

  • How do I uninstall Mozilla. when I try from the control panel, it doesn't do anything.

    I deleted the maintenance section from the control panel section first, and now when I try to delete Mozilla, it sits there and does nothing.

    Are you trying to uninstall Firefox because you are stopping using it, or to try to fix a problem?
    Also, don't remove the maintenance service first, when you uninstall Firefox the maintenance service is also removed.

  • Large image sequences in Flash - How to reduce memory usage?

    So I'm trying to publish a looping animation in Flash with a large amount of image sequences in it. (around 3000 frames all told). And I'm having problems with the swf using too much memory when it's played.
    The swf is about 80mb, but the file uses an excess of 2gb of ram when played. I don't know why that would be. A memory leak?
    My understanding is: that Flash will just load all images in a swf into memory unless you dump the memory somehow.Can anyone explain how to do this? Is it possible? I can't seem to find a solution online.
    Thanks

    Thanks for your reply. I think I was being just overly ambitious trying to get this to play in swf form on sub 4gb ram machines. I've resorted to external video.

  • How to reduce CPU usage when working in Logic Pro and Kontakt5

    Hello All,
    I have a MacBook Pro 15" early 2011 2.0 GHZ. My main acitivity is making music with my macbook pro. I am using Logic Pro 9 in combination with Kontakt 5.
    I want to get some suggestions in the setup so I can reduce the usage of the CPU. By the way I have upgraded my system with a SSD 256GB , 16GB RAM and have removed the optical drive and installed the the previous factory set HD in the optical bay. I have placed the samples of the Kontakt 5 in the HD so I have enough space on my SSD to run the progrmas fast and smooth !
    If possible give your advise on an optimum setup such as reachanaling the sounds through BUS to AUX channels and other methods in order to reduce the CPU usage. You may even post some good links where I can find more info.
    Thanks in advance
    Wkrgds, Levon

    welshwiggle wrote:
    So Center of Pan,
    If you were to run something like Omnipshere on an active SI track do you get anywhere near the "1 core CPU" spike I'm getting on my Late 2011 TOTR MBP?
    I still dont really get why L9 on a new MBP peforms worse than eg your PC.
    Older versions of Logic (ie: 5.5) don't see individual cores, there is one disk meter and one CPU meter. In some ways it's a more efficient system. This is running on WinXP which happens to be a very good system for audio. Consider this, XP can be installed and take up only half a gig of disk space and do 90% of what most operating systems can do today. 
    I do see single core spikes on my single processor quad core Mac Pro.  There's no way to get around a processor intensive plugin on a single track. A channel strip is tied to a single process (core). I stopped upgrading at 10.6.8 and Logic 9.1.3, because it works. I still get the occasional single core use even with multiple plugs and tracks but I can usually break the logjam by quickly starting and stopping Logic 2 or 3 times.
    I will not upgrade Mac hardware or software unless the next version of Logic is outstanding, I'm fine where I'm at for the next year or two. I enjoy recording performers more than anything else so al I really need is a good sounding, solid system.

  • How to skip footer details when loading data from a .txt file

    Hello experts,
    i have to import data from a txt file into my database. I have skipped my header info by using SKIP but how can i ignore my footer details.
    Thanks

    Reply on your other thread:
    Processing txt file for a required format

  • Reduce CPU Usage when Runnig Telnet on Win2000

    Does any one knows how to reduce CPU usage when iam running my telnet developed using java classes.Every time when i start Telnet CPU usage is shooting to 100%.Can any one help to me solve my problem.

    You are probably doing some kind of loop that is eating all the CPU idle time. You could reduce your use of the CPU by calling Thread.yield() when you do not need to do anything for a bit, or even better, Thread.sleep(...) to pause your program for a specified number of milliseconds.
    Hope this helps some.

  • Newbie: loading a symbol from the library

    Hey
    Environment:
    Flash Lite 2.0
    ActionScript 2.0
    Would like some tips about how to use ActionScript to load
    symbol from the Library and place the symbol on a specific frame in
    the main timeline... I also want to specify (using ActionScript)
    where on the stage the symbol get put on the stage....
    I've read about LoadMovie, but it seems like it's for loading
    exernal movie clips, but I have the movie clip (a symbol of type
    movie clip) in the project Library!
    Any suggestions?
    Audun

    Thanks for your reply, I works great now.....
    BTW I've got another question now:
    The movie which is being attached using attachMovie get
    displayed at upper left corner of the screen. But don't wan it to
    be displayed at that position. There must be a way I can specify
    it's coordinates!
    I've tryed with this actionscript, but it isn't working:
    _root.attachMovie("test1", "testerA", 1);
    _root.onEnterFrame = function() {
    _root.test1._x = 30;
    Any suggestions on how to solve this will be greatly
    appreaciated!

  • High Virtual memory usage when using Pages 2.0.2

    Hey there,
    I was just wondering whether there had been any other reports of unusually high memory usage when using Pages 2.0.2, specifically Virtual memory. I am running iWork 06 on the Mac listed below and Pages has been running really slowly recently. I checked the Activity Monitor and Pages is using hardly any Physical memory but loads of Virtual memory (so much so that the Page outs are almost as high as the Page ins (roughly 51500 page ins / 51000 page outs).
    Any known problems, solutions or comments for this problem? Thanks in advance

    I don't know if this is specifically what you're seeing, but all Cocoa applications, such as Pages, have an effectively infinite Undo. If you have any document that you've been working on for a long time without closing, that could be responsible for a large amount of memory usage.
    While it's good practice to save on a regular basis, if you're making large amounts of changes it's also a good idea to close and reopen your document every once in awhile, simply to clear the undo. I've heard of some people seeing sluggish behavior after working on a document for several days, which cleared up when the document was closed and reopened.
    Titanium PowerBook   Mac OS X (10.4.8)  

  • How to reduce memory use on my iMac

    How to reduce memory use on my iMac, OS X Yosemite, 2.7 GHz Intel Core i5
    8 GB memory
    Running very slowly, and the little spinning ball showing up.
    How do I clean up my IMac please?
    Should I use MacKeep or any clean up apps?

    When you see a beachball cursor or the slowness is especially bad, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Excessive memory consumption when loading Customers through Component Inter

    Hi All,
    I'm facing a big problem with the high memory consumption when loading Customers, Companies and Sites using the Component Interfaces delivered by the product (RD_CONSUMER_CI_API, RD_COMPANY_CI_API, RD_SITE_CI_API) within Application Engine programs. I'm loading about 7 million customers, an amount that is not so big in my opinion, but the memory consume is too high.
    We have 3 Batch Servers, each one running under Red Hat OS with 32 GB RAM memory plus 32 GB Swap memory in each server. We are running 2 Process by Server and with a day and half the servers crash with 100% of memory consumed (RAM and SWAP).
    There's a good pratice to use Component Interface in a heavy load process?
    There are parameters in the process scheduler configuration file that could help to reduce the memory consumption?
    There's a way to free the memory through PeopleCode or by running another process?
    Thanking you in advance.

    You may want to try and cut down on the input data to ascertain that the load might be a problem.
    You may try and use the GarbageCollector, but might not help in your case.
    To get an idea of the size allocated in buffer for the Rowset being used, you may want to check out the memory overhead ...
    Also, could check, which is the process that is consuming a lot of memory

Maybe you are looking for

  • How to find an apple store

    i have to send my new ipod nano in for service, and was wondering how i can find out where the nearest store to me is???

  • Playback of imported videos

    I am having problem with playback of my videos that have been imported into iMovie. They keep freezing a frame while the music keeps playing and the play button is highlighted. If iclick somewhere else on the time line it starts again but then keeps

  • Hyperlink with a website

    kindly guide me how to create hyperlinks with a website

  • Displaying the System Time In a Frame.

    import javax.swing.*; public class Window1 { public static void main(String[] args) { JFrame win = new JFrame("Window1"); JTextArea Timedata = new JTextArea(10, 30); win.getContentPane().add(tA); win.pack(); win.setVisible(true); tA.setText ("This is

  • Removing entries in the table

    Hi, I need to delete entries in the table ,those may be anywhere between 1 to several thousand. If  I want to delete for every hundred records how could it be coded. Thanks, Kranthi.