How to clear the content of a bitmap

I created a bitmap that contains the contents of a charger.

I want to clear the contents of the bitmap image whenever the loader loads an image.

Here is the code:

var theContent:Bitmap;

function display(xml:XML):void
          {
               var provider:DataProvider=new DataProvider();
               for(var i:int=0;i < xml.shape.length();i++) 
               {
                    provider.addItem({label:'image '+(i+1).toString(),source:xml.shape[i],data:i}); 
            }
               collection_shapes.direction = ScrollBarDirection.VERTICAL;
               collection_shapes.dataProvider = provider;
               collection_shapes.columnWidth = 100;
               collection_shapes.rowHeight = 100;
               collection_shapes.columnCount = 2;
               collection_shapes.rowCount = 2;
               collection_shapes.addEventListener(Event.CHANGE, select_img);
          }
          function select_img(e:Event):void
          {
               viewImage(e.target.selectedItem.data);
               e.target.selectedItem=null;
          }
          function viewImage(n:int):void
          {
               shapeLoaderArr[selectedRestricted].unload();
               shapeLoaderArr[selectedRestricted].load(new URLRequest(xmlData.shape[n]));
               shapeLoaderArr[selectedRestricted].mouseEnabled = false;
               shapeLoaderArr[selectedRestricted].contentLoaderInfo.addEventListener(Event.COMPLETE, on_shape_complete);
               
          }

function on_shape_complete(e:Event):void
          {
               theContent = null;     //it dosen't work.
               theContent = e.target.content;
               theContent.x-=theContent.width/2;
               theContent.y-=theContent.height/2;
               
               view_mcArr[selectedRestricted].addChild(theContent);
               view_mcArr[selectedRestricted].width = 70;
               view_mcArr[selectedRestricted].height = 70;
               view_mcArr[selectedRestricted].x = this.restrictedArr[selectedRestricted].x;
               view_mcArr[selectedRestricted].y = this.restrictedArr[selectedRestricted].y;
               this.restrictedArr[selectedRestricted].addChild(view_mcArr[selectedRestricted]);
          }

Please help me solve the problem.

If the content is the content property of your loader that loads a bitmap, use:

function on_shape_complete(e:Event):void
{
Bitmap (content). BitmapData.Dispose ();
content = e.target.content;
theContent.x = theContent.width/2;
theContent.y = theContent.height/2;

Tags: Adobe Animate

Similar Questions

  • How to clear the contents of the download icon?

    Even after I deleted all files previously uploaded using my PC via the USB connection, and the download folder indicates empty, but when I click on the download on the phone icon, it displays all the files still there. Although the file does not open in any case. So my question is can I clear the contents of the download icon?

    James

  • How to clear the contents of my old iPad without also erase it from my other?

    I backed up my new iPad Air2 use iCloud and now want to delete all the contents of my old iPad. How can I do this without also deleting the content of my new iPad?

    Manipulation of content on the old iPad will not affect the content on the new iPad

    Following the instructions here should take care of it

    What to do before you sell or give away your iPhone, iPad or iPod touch - Apple Support

    Explanation: I am usually concerned about things such as notes and images - but if they are on the new iPad - and that is synchronized in the cloud, then signing of iCloud on the old device will not affect anything

    (I'm personally spent on 4 phones like that)

    Nice name it by the way Jonny Ives has a special link to Apple - google if you want that

  • How to clear the contents of a file

    Hello

    I have a file that includes some characters written in it, I want to delete the file, how can I do this?

    Say that I called "LabVIEW" Word, I need to erase this word and end result should be the empty file.

    I need to replace the content by writing "OR" in the file, but when I do this I still find other characters of the word of LabVIEW.

    Thanks in advance

    There is a difference between your method and mine. My method will move the EOF marker so that it gets placed after all what I have written in the file, which in this case is the empty string. With your method the EOF marker is not moved. To perform the equivalent operation with your code, you will need to use the right to set file size after the write function to set the file size to the length of the string that you wrote in the file. Or, you can use the unique feature that I did.

  • How to clear the contents in plain text file?

    Can someone tell me how to remove all of the content in the plain text file!

    Send samples if you have for reference

    Use the FileConnection.delete method and the FileConnection.create method to remove and create a file.

  • How to clear the contents of a cube

    Hello. How can I completely erase the data in a cube, preserving the sketch?
    Note that I do not mean substituting values with zeros, because I need VALUES LIST and no zeros.
    Thanks in advance.

    Do you mean completely erase a database?

    You can do this via EAS by right-clicking on the database and selecting 'Clear data'-> 'all data '. This will erase all the data and keep the outline, calc scripts, etc..

    You can use MaxL alter reset database for ASO bases and BSO.

    Or do you mean deleting selective bits of a data base, using something like CLEARBLOCK (BSO) or CLEARDATA calc script commands? In the land of the ASO, you can use MaxL clear aggregates of database change or delete order data from the region.

    Kind regards

    Cameron Lackpour

  • How to clear the search results in an af:table?

    Hi all
    I use Jdeveloper 11 g with ADFBC.

    I have a query with a table of readonly page to display the result of the query, and there is a "Reset" button on the page (NOT reset in motion control) to clear the search results in the table.
    I try the following code to clear the contents of the search results, BUT it does not work. The data in the table is always run after the code below here.
    DCIteratorBinding binding = ADFUtils.findIterator("UserVO1Iterator");
    if (binding!=null) {
        binding.clear();
    }
    Can someone help me? How to clear the contents in an af:table supporting the Java bean code?

    Kind regards
    Samson Fu

    You can also try to call the method executeEmptyRowSet() on the view of the iterator object instance

    Sample:

    binding.getViewObject().executeEmptyRowSet()
    

    Jean Lou

  • How to clear the cache in 9.0.3

    Techno-bouffon here, in conflict on how to clear the cache in 9.0.3 (OS X 10.11.3 El Capitan). Some recommend to delete entire cache folder. Others say just clear com.apple.Safari, which I did. So... what happens if I delete the contents of the entire folder Caches? (I have nothing special set up on this computer.)

    Open Safari Preferences--> advanced.  Downstairs, make sure that ' see her develop menu in the menu bar "is checked.  Then go up to develop-> empty Caches.

  • How to see the content of what's currently on my iCloud of this site

    How to see the content of what's currently on my iCloud.  I would like to see these files presented in a display of file manager type in order to sort and remove if necessary.

    Go to iCloud.com, then click on your iCloud drive icon.  I hope this is what you mean or what you are looking for.

    iCloud Drive FAQ - Apple Support

  • How to clear the hard drive on my old iMac of 2008?

    I have a 2008 iMac I want to recycle. How to clear the hard drive?

    (What is PPC?)

    PPC stands for Power PC. Is the name used to refer to the old Macs that uses a Motorola processor instead of Intel chips used today. To clear your old Mac follow the advice in this document from Apple... What to do before you sell or give away your Mac - Apple Support

  • How to clear the cache of firefox

    How to clear the cache of firefox

    Settings-Advanced below 'Network' and clear here

    https://support.Mozilla.org/ru/KB/Kak-ochistit-KESH-Firefox?redirectlocale=ru & redirectslug = Kak-ochistit-Kesh

  • How to clear the history?

    How to clear the history?

    https://support.Mozilla.org/en-us/KB/how-do-i-clear-private-data-Firefox-Android

  • How to replace the contents of the settings/passwords backup server / current browser bookmarks?

    Classic scenario: after the bookmark long manual organization Firefox Sync adds trash of its server to my laptop or tablet.

    Where can I find how to replace the content of the backup of the server by settings/passwords / current browser bookmarks? Stupid me, I put a new synchronization and lost this ability.

    It is not recommended to go back to the old version of Sync

    The old version is removed he'll stop being available soon, it takes getting used to using the new version.

    IIRC, it is actually possible to force synchronization of the old working with Fx29 & Fx30 using an old profile or preferences of piracy, but I don't think I should encourage users to try this, but it would be better than using an older version of Firefox which is really bad. In fact using an old outdated version of Firefox is so bad, that it is customary to recommend using a browser on alternative day of someone else instead.

    Firefox ESR is aimed at corporate users, definitely, at the moment, it will use the synchronization of the former. Who will update soon to use synchronization well again, and this time, I guess the synchronization of the former will probably totally frowned upon for example are not available at all.

    It is possible to use the feedback system to leave a short comment on Sync. I would recommend this making, but at least to make very many people of spirit comments that I doubt will have no effect.

  • Portege Z930 - how to clear the memory of the fingerprint sensor?

    Hello

    Tell me how to clear the memory of the fingerprint sensor?
    Reinstall the operating system and now I can not add your impressions.

    They have their No....

    > Reinstall the operating system and now I can not add your impressions.
    Stand by. You have reinstalled OS using original recovery image?

  • Re: How to clear the model of Toshiba satellite PS271L - 6K 906 CMOS PASSWORD?

    In: Toshiba

    How to clear the model Toshiba Satellite PS271L - 6K 906 CMOS PASSWORD?
    Please respond to my E-mail [email protected]
    Thank you

    To: King

    http://forums.computers.Toshiba-Europe.com/forums/thread.jspa?MessageID=127837
    Read this thread very carefully!

Maybe you are looking for

  • iTunes library didn't give all of my music library

    Small question. I recently moved my iTunes library from PC to Mac and unfortunately has no transfer via. That would be partly because I didn't have enough available storage cloud? If so, is that I could buy more storage and transfer? Thank you Nate

  • MBP-restarts wobbly and never stops...

    Happy 2016! My year starts well with my MBP mid 2014... He runs the last El Capitan, 1 G SSD. I had a couple of files that were on my desk that I couldn't remove. They were not visible to any application of trash I have. I couldn't delete them. I cou

  • Critical updates current Win7 X 64 crash computer

    I installed the updates of 08/02/11 and the result was that my computer will not re-start. Several Windows of difficulty of startup attempts indicating that Windows could not repair. After you send the info live the last choice has been to open the s

  • Meaning of inverse cursor buttons

    In LabVIEW 8.5 I inserted a slider control on my face, when I click on the Up button up to my selection of four positions, then the pressure on the Up button get her down.  Similarly, subsequent presses pressing takes the blade back down (if it is no

  • CDrom opens randomly

    My CDrom opens at random and is not close, I used to close by a PIN in the hole of the cdrom but this time it will not close how