Re-use of content of charger

Hello

I ran into something that I find very, very weird. Adjacent to the level of the weird, same bug.

I load a GIF with a charger. No fuss there.

I then try to instantiate two different bitmaps with the loaded content:

Image = Bitmap (loader.content);

Image2 = Bitmap (loader.content);

I then place them outside on the stage so I can see both:

image.x = 50;

Image2.x = 200;

Finally, I add the bitmaps to the scene:

addChild (image);

addChild (image2);

But only one of them turns - according to the order in which I attribute the x values. The bitmap that I attribute to the first, is that which renders the scene.

Very strange to me, since I'm must have two separate images after the first two lines.

When I look at the values, it is as if there is a single object on the scene, yet debugging information suggest that there are actually two objects, both referencing the same bit of memory for the image.

trace (image.x);
trace (image2.x);
trace (stage.numChildren);

The performance of these tracks:

200
200
1

Can someone explain this behavior to me? How can I force him to make a real copy of the content, not only the reference memory I think is going on here?

I really prefer is not to load the gif for each new instance.

It's quite interesting.  all the languages I know use pointers.

Oh, well, live and learn.  So much for the info.

in any case, the draw() method creates a copy of bitmapdata from where you can create a bitmap image.  You can use the function copyF() below to make copies of displayobjects.  for example to make 50 copies of loaded content, use:

var ldr:Loader = new Loader();

ldr.contentLoaderInfo.addEventListener (Event.COMPLETE, f);
LDR. Load (new URLRequest ("whatever"));

function f (e: Event) {}

Create a function to do something with the copies stored in the returned array.
dowhateverF (copyF(e.currentTarget.loader.content,50));
}

function copyF(dObj:DisplayObject,n:uint):Array {}
var a: Array = [];
for (var i: uint = 0; i<>
var bmpd:BitmapData = new BitmapData(dObj.width,dObj.height,true,0x000000ff);
bmpd. Draw (dObj);
var bmp:Bitmap = new Bitmap (bmpd);
addChild (bmp);
a.push (BMP);
}
return a;
}

Tags: Adobe Animate

Similar Questions

  • Is there any way I can remove to concede Mozilla non exclusive, free of charge, worldwide license to use the content that I can download using Sync?

    I started to download Mozilla Sync to my computer, but stopped after reading an article in the terms of use. He States, "5. Your content in our Services: you can download content as part of the functionality of the Services. By downloading the content, you grant us hereby an exclusive, royalty-free license throughout the world to use your content in the context of the provision of Services. "Take you represent and warrant that your content will not infringe the rights of any third party and that it will comply with any content directive introduced by Mozilla ', so I stopped the download until I could learn more.
    I also think that your privacy under the heading synchronization policy says that Mozilla will strive to keep my content only as needed. If this is the case then by two distinct statements in your terms and conditions Privacy policy, you may deem it "necessary" to keep all my content that you want to use.
    My question is this, is it possible to deny the exclusive, royalty-free license throughout the world to use my content that I can download using your service of the Mozilla? "I will not be forced to allow anyone this type of license to use my art or writing ' ad arbitrium".

    IIRC, section 5 is basically guaranteeing that you are the real owner of the content that is uploaded to Sync, and that Mozilla is not going to get justice for copyright infringement, the content that you download is safe, and the terms are for a "license to use your content in the framework of the provision of Services' not even Mozilla can access.

  • use the contents of the cell to a cell reference of formula calculate

    In Apple "Numbers", in order to update a spreadsheet each time that the values are added, I first need to calculate the number of days between the date of first entry and last date, using the COUNTA() method. Gives me the line number of the last entry.  For this I "CONCATENATE" a column letter known to a cell reference.

    Using this cell reference, I would like to know how can I use the contents of the cell to update the information contained in the rest of the worksheet. Is this possible?

    Any help would be appreciated.

    Thanks in advance.

    I have a problem following exactly what you want to do, but think that INDIRECT can help.  More here.

    SG

  • My lil brother has used a fake iphone charger to charge his Iphone on my mac pro and my laptop down, someone had something similar happen? Help

    My lil brother has used a fake iphone charger to charge his Iphone on my mac pro and my cell phone shot someone had something similar happen? Help

    Try http://www.makeuseof.com/tag/reset-macs-smc-pram/

  • Do I need to use a converter to charge my 5 in England?

    When I travel to England this month will be I need to use a converter to charge my phone or I can use a plug adapter?

    If you use the Apple charger supplied, you will simply need a plug adapter.

  • What I have to pay extra to use the content I do using CC in trade?

    Hello

    I think to buy a full subscription of CC, but as he is quite a lot of money, I want to be sure that I get the right thing.

    What I have to pay extra or to declare a business account or something like that to use the content I do in trade?

    I intend above all just using photoshop and first pro for youtube and other things.

    Make just a normal thing of type use staff welder or I have to buy some sort of Professional license?

    Thank you

    Hi William,.

    You can take a look at the plans of what adobe offers for CC and choose the one that works best for your hobby.

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Kind regards

    Sheena

  • Failed to load the metadata server using GET_DOC_METADATA_INFO content model?

    Hi all

    I create connection in Jdeveloper to the repository of content both are 11.1.1.6.0 version. I'm creating RIDC Socket type Socket.
    everything by testing the connection I get under Error.UCM runs in other ways machine come IP. trying to connect from my local Jdeveloper.

    Test failed:
    Failed to load the metadata server using GET_DOC_METADATA_INFO content model.
    Permission denied. Address ' XX. XX. XX. XX'(IP) is not an authorized remote socket address. (IP replaced by XX...)

    Why his error.do showing that I need to put any changes of the UCM let me know problem question

    Please give me an idea about this error and the solution for the same.


    Concerning
    Siva sery

    To eliminate the first manifesto, see this post: fail to connect to the content if server use 'web' for the RIDC socket type and check that the other IP is allowed, amongst, IPs (you can use a mask, or type it directly) - do not forget to restart the server after the change.

    If this does not help, test, if other services such as DOC_INFO_BY_NAME can be called via RIDC, or if they have the same problem.

  • How to publish an application to a group of selected people without using the content viewer Adobe?

    How to publish an application to a certain group of people (not via the App Store) without using the content viewer Adobe?

    The application was developed with InDesign 6.0

    You will need to register for Apple Developer account and then gather all the UDID (Apple this limit to only 100 devices) you want to your application must be installed on. Create your mobile configuration profiles to include these ID's and you can then use TestFlight to get your app and the monitor that installed it. Of course Testflight is intended to monitor the performance of your apps, but I'm sure you can get away with it if you use it to push you app. One thing to keep in mind is that the mobile profiles provisoning are valid for 1 year. I hope this helps.

  • Pavilion x 360: using laptop computer while charging

    As the subject says, is it safe to use while charging? (mine has built-in battery)

    Hello

    Yes, it's fine, you can use it while the machine recharges without any problem.

    Kind regards

    DP - K

  • Why won't the Web sites I use, myfrenchlab, facebook, no charge?

    This happened for two days. On facebook, my chat bar never loads. He said only "loading". When I try to click on the button of my message, nothing ever happens. When I try to access a page that I "liked" and enter a contest in a tab, it never loads. It charge very well three days ago. And now, with myfrenchlab.com, I try to open my e-book, and it never opens. What opens is that a blank web page is open. This only happens on firefox, I use the most up-to-date firefox and Mac 10.6.8

    It sounds like you have a problem with one of your add-on/installed extensions. To check just start Firefox in safe mode and disable all add-ons/extensions, then try to load the sites that you have problems with to check if get or do not now load correctly. If sites are loading properly, enable your add-ons/extensions again one by one each individual up to that you have a problem to verify the problem add-on/extension.

    See:

    The problems of Firefox in Mode safe

    If this solved your problem, please select resolved and chose the solution that suits to close this announcement of the ticket/issue.

  • Can I use the mini iPad charger brick 4 10W to recharge my iPhone 6 s?

    I just upgraded my mini iPad to 4 and it comes with a larger loading brick - it looks like a mini MacBook charger block and is labeled as 10W. Is this compatible / safe to use to recharge my iPhone 6 s?  I wouldn't mess up one or the other. In addition, can I charge my iPad mini 4 with standard chargers for iPhone 6s, 6, etc.?

    Yes and Yes.

  • laptop computer becomes slow after a while of use and when the charger is connected, becomes normal.

    Hello

    I use HP Compaq Presario CQ62, Windows 7 Ultimate 32 bit OS, 4 GB ram, Intel core i5 processor. It is a portable 4 year old. The battery was changed 8 months ago.

    Now, coming to the problem, my laptop will work very well for a few minutes at the start when I turn it on. After some time, the laptop everything becomes so slow it takes forever to work. This occurs when the power is not connected. If I connect power, less than a minute it starts to work faster. But the laptop would become very hot.

    This problem started when I updated my iPod. After update iPod, I had this problem even while the charger is plugged. Later, I changed the OS Win7 Home premium genuine to Win 7 Ultimate. (Pirates). I have run the genuine Antivirus, cleaned the registry and everything. The problem persists. Please help me with this topic.

    Thanks in advance

    -Kere

    kaaranjikere,

    So I checked the error you are getting, and it is not the battery do not, it is the power which is a failure and that includes everything for the power.

    So it is likely that something wrong with your motherboard.

    You will need to take the system to someone looking over everything.

    I would like to know how everything goes

    Nice day.

  • can I use hp7 compressed during charging?

    Can I use my 7 HP Tablet it charging with the wall charger? What happened when immersed in us port to laptop?

    Dave001userhp wrote:
    Can I use my 7 HP Tablet it charging with the wall charger? What happened when immersed in us port to laptop?

    Hello

    Yes, just please get some attention: keep the right cord, otherwise it will damage the connector.

    Kind regards.

  • Is it safe to use 3rd-party magnetic charger?

    I think about to buy the magnetic charger for my Xperia Z2 cable, but I am worried about their quality and their possible damage to the battery from the phone, I am quite satisfied with the performance of the battery, but how will this affect
    It? Also, linking to my normal wall charger adapter that I use for magnetic cable usb charging?

    Would be great if Sony had cable official magnetic charger except the docks. Thank you, best regards!

    Hello

    I used a 3rd party magnetic cable for a few months of battery to recharge my ultra Z and few of my friends use these cables for almost a year now and he has no problem with it.

    Yes, as long as the cable is of high quality, then avoid any injury.

    However, remember that you would use these cables at your own risk. I just shared my experience.

    You changed your answer, and here's the answer to your other hand > Yes, you can plug it into the charger, you got with your Z2 and that everything works perfectly fine.

  • The power supply Dell place Pro 11 (7130) may be used without danger to charge other devices USB microphone?

    I am trying to determine if it is safe to use my Dell place Pro 11 (7130) - power to charge other devices via micro USB 5v of power.

    That is, phones, tablets, Bluetooth devices (keyboards/mice/headsets).

    I am trying to determine if it is safe to use and avoid carrying more then once Charger Micro USB.

    Said the label on the place of meetings 11 Pro Dell 24W AC adapter charger

    Reference output Dell: 19.5V OR 5V 2A 1.2.
    HA24NM130 / DPN: KTCCJ
    CN-0KTCCJ-75661
    3CP - 0C 11 - A00
    DP/N 0KTCCJ

    I understand that some devices may not charge, I want to make sure that the voltage is 5V for devices usb and not 19.5V, since there 'or' on the label.

    I tried it on a tablet of 5V and it seemed to load correctly: nothing caught fire. Which is in any case an authoritative answer.

Maybe you are looking for

  • Satellite A300 - driver Open Webcam fail

    Hello I'm Dr. Ahmed Maher, and I have a problem with my Toshiba laptop. This is the Satellite A300 The problem is in my webcam. When I try to use the webcam, a message of "driver webcam open fail.please restart the computer or the cam.I downloaded th

  • HP pavilion 14-n019se used completely shut down.

    Pavilion HP 14 with touchscreen Windows 8 whenever I press the button to turn off the screen go but keep turning on the power button and the fan too, I waited about 5 hour nothing happen I reformatted and I got the same result, updated to 8.1 and I t

  • Boolean breakpoint

    Hello Is it possible to automatically set a breakpoint or simply put all the VI in the State to break if a Boolean control evaluates to true. I run several steps in a while loop and I want to put right in the moment that the Boolean control evaluates

  • Error with 2 Daq assistant

    Hello Another noob to join the community. Here's my question. What I am doing wrong? I use 2 assistants for the acquisition of data on the module of NI9401 for output and input digital. I use it to generate signals of 2. If I test with 1 it works but

  • I have a dell inspiron 1545 multiple questions

    TAKS to always start in any mode, mode normal doesent work properly and lost sound and cam in all modes. Once started in safe mode it seems to work perfectly except no noise or cam. and I cannot restore the pc