question about the scope of variables and memory

I searched the Adobe documentation for an overview, but apparently, I'm not in the right place.

Here is an example of simplified code:

< AS >

loadedImages:Array = new Array();

function createImageData(imageNumber:Number):void
{
var imageData:BitmapData = new BitmapData (width, height);

Switch (imageNumber)
{
case 1:
imageData.draw (loader1.content);
loadedImages [imageNumber] = imageData;
break;

case 2:
imageData.draw (loader2.content);
loadedImages [imageNumber] = imageData;
break;
}
}

< virtue >

ImageData defined inside the function createImageData(), I know that I can not access any outside level of the function block.  But what about memory?  ImageData still exist once the code has "left" the createImageData() function?

For example, if the function above is called twice (once with imageNumber = 1, once with imageNumber = 2), what I remember?

-BitmapData objects stored in loadedImages [1] and loadedImages [2] and 1 BitmapData object named imageData

-BitmapData objects stored in loadedImages [1] and loadedImages [2] and 2 BitmapData named imageData objects

-BitmapData objects stored in loadedImages [1] and loadedImages [2] and nothing else

Is there a way to see the 'elements' in memory, not just the quantity?

If you call twice createImageData, for imageNumber = 1 and imageNumber = 2, there will be only 2 persistent objects to the Bitmap in memory, and they will be made by the loadedImages table. The imageData variable is just the first to receive the pointer to the allocated memory and past him on the elements of the array until it's life is over. Only when you delete the table, you will release the objects for the GC.

Tags: Adobe Animate

Similar Questions

  • A few questions about the use of data and Cliq

    I have the cliq, however I chose to not get 3G (so I bought full fare). So I have a few questions about the phone and the use of 3G / 2 G/Edge:

    1 - is possible to disable completely the 2G / 3 G/Edge? I know you can switch between them, but are anyway just tell the phone to stop using them altogether since I'm not subbed to the service?

    2. when the update takes place, I guess we'll have to reconnect motoblur and etc, but if I don't have 3 G will I have motoblur connection problems after the update? Or he keeps the latest wifi settings so that it would connect to wifi to connect. When I first got my phone it was not a problem b/c I had 3G for the first month.

    I hope that makes sense, thanks!

    To stop all the data, I would like to download an application called APNDroid. He cut them all down. When you log on to blur you have 3G or WIFI doe this without getting a timeout error. During the process of setting up your Blur account, you can press the menu button and set up your wifi to work, this will connect you to Blur and your phone will be connected to the blur. If I were you I would be rethinking to do a data plan since you are really losing out on most of your main features of phones. It's your choice, however.

  • Question about the guest of dashboard and column

    My question about the dashboard and column prompt:


    (1) prompt dashboard usually work with only for columns that are in the topic area. In my report, I have created some of the columns that are based on other columns. As I have the daysNumber column that is based on two other columns, because it calculates the difference between two dates. I can't find this column invites when I create dashboard. I need to make a guest on this column.

    (2) to one of the column, I have only two values 1 and 0. When I create a prompt for this column, is possible that falling of drop down it displays 'Yes' of 1 0 and 'No' and always filter the request?

    Hello...

    I forgot to tell you one thing... but performance wise... If you create the column in RPD itself, it is good and easy to maintain.
    If you want this feature also... once again you choose directly the column in the area of topic... ;)

    Thank you & best regards
    Kishore Guggilla

  • Simple questions on the earphones of events and memory management

    I am brand new to AS 3.0 (have not coded in 10 years!) and I have a two part question on the management of event listeners.

    1. is it possible to use variables or loops to simplify the process of creating event listener? For example, I have a scene that animates the leaves when they are hit. There are 25 or more leaves, so I need to handlers of 25 and 25 functions, even if the animation is the same. Right now my code looks like this:

    leaf1.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf1);
    leaf2.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf2);
    leaf3.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf3);

    etc. And then the functions all alike as well.

    function animateLeaf1(e:TouchEvent): void {}
    leaf1.gotoAndPlay ("animationStart");
    }

    function animateLeaf2(e:TouchEvent): void {}
    leaf2.gotoAndPlay ("animationStart");
    }

    etc. My instinct tells me there is an easier way to do this, but I don't know if it's just because I see a model and want to put it in a loop or if there is really a better way to do it. I have event listeners are doing right?

    2. How can I clean my waste? Each of my frames will have 100-300 earphones of events inside, for animations, etc., mainly because a single button can have 3-5 event listeners (touch Start, end touch, touch roll on, roll off touch, etc.). Is this too much for a mobile device to manage? When can I disable event listeners to make sure that they are the garbage collector to release the memory? I don't want memory leaks, but the event listeners must be active when the frame is active and destroyed when the setting is inactive; I don't know how to program which, or if such a garbage collection is already inherent in Flash.


    Thank you very much!
    Amber

    leaf1.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf2.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf3.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    leaf4.addEventListener (TouchEvent.TOUCH_BEGIN, animateLeaf);

    function animateLeaf(e:TouchEvent): void {}
    e.currentTarget.gotoAndPlay ("animationStart");
    }

  • Questions about the synchronization between output and analog input

    Hi all

    I now have a simple task which head a signal voltage (from PXI ao0) on a circuit and then your comments a voltage at the terminals of a component, for example, that one of the resistors in the circuit, through ai0 on PXI. So in this case, the synchronization between analog input and analog output must be made to avoid error of phase shift.

    I tried to build my VI by learning this example: https://decibel.ni.com/content/docs/DOC-3882

    However I have a few questions.

    1. I noticed that there is a merged error fed the "start task" sub VI for the analog output.  What is the point of fusion to mistake?

    2. I enclose my VI (also shown below) for the output voltage. I put my writing of DAQmx Subvi in the while loop so that I can change the voltage while the VI is running.

    However, in the example, the author has been reading outside of the loop and before even the start task. What difference will it make?

    3. I have also attached my synchronized VI. I always put the wavegeneration and the DAQmxwrite in the loop. A bulging guard error saying about samples is not available and needs to a higher sampling rate or a longer wait time. What causes this?

    I appreciate that these problems can be solved. Thanks to you all.

    (1) first you need start the task of acquiring, he'll wait for trigger here. And then you start the build task that provides this trigger. If acquisition could trigger and never start.

    (3) you must first write something in the buffer (writing DAQmx), then only you can generate it (Daqmx Start).

    Check Cont Gen tension Wfm - Int Clk - no Regeneration.vi in the help-> examples for example.

  • Question about the formula of Member and BegBalance

    I have a requirement where I need to calculate the value of '' suffering '' and need to save it somewhere so that I can use it to display on the dataforms.

    The logic of the last value Due must be--

    Suffering = year previous year Total + current (Jan: Prior month)

    I was planning to write a formula for this member. Can I use substitution variables, as title, etc. PriorMonth in the form of Member to achieve this?

    In addition, since we do not use BegBalance Member for purposes like the display on the dataform etc. can I use for this requirement where I can write the formula of the BegBalance member and give it an alias name 'Suffering' I can use to show on the dataforms. Is this possible?

    Please let me know. All entries are appreciated.
    ~ Hervé

    Hello
    Perhaps it should look like this:
    & priorYr-> YearTotal+@sum(jan:&currMonth);
    / * No need to specify the current year as it would be fixed in pov, column or page. If necessary, replace the sum with @sumrange(&currYr,jan:&currMonth) * /.

    See you soon,.
    Alp

  • Questions about the standard wireless keyboard and mouse on a h8 - 1360 t.

    Hi again,

    I have a h8 - 1360t with the standard wireless keyboard and mouse.

    1. where is information on the blue buttons 'connect' keyboard and mouse?

    2. the mouse has a power switch - do I really have to close each time, or is there a function of inactivity when the system is off?

    3 lets say that I have two exact systems within 5 feet of each other. Will the two keyboards and mouse conflict?

    Looking forward to your answers.

    Thank you

    BJ

    This document will show you how to sync mouse wireless and keyboard if they connect buttons.

    You don't need to turn off the wireless mouse. If you have problems with the batteries run out frequently, it might be useful, but I've never needed to do.

    Two different sets of wireless mice/keyboards are not usually a problem. If there is a conflict, go through the process of connection of each game.

  • Question about the browser inside "sandboxie" and download to save an attachment?

    Hello

    I am very new to sandboxie. So please excuse my ignorance.

    I have the browser open inside sandboxie where I'm going to my gmail. I have an email from my son with a photo attachment. I have no trouble to consider this picture.

    However, I just found out that I couldn't save this picture on my computer HD. In sanboxie E-mail when I chose to save it in a folder in my computer HD shows like saved but when I close the browser and open my folder where I saved the photo allegedly - I can't find anything...

    So I guess that's the protection offered by sandiboxie?.  So if I need to save items of all reliable e-mails, I open my browser off sandiboxie to run my download?

    Concerning

    Snow,

    Yes, one of the goals of Sandboxie is to keep isolated... things so that, if you have accidentally downloaded a virus, he would be stuck in the sandbox [rather than infect your real system].

    Right-click on Sandboxie icon in your system tray, select Show THE WINDOW, the sandbox SAND SANBOX SETTINGS tab, DEFAULT ZONE.   On the left, click on the + sign of RECOVERY, to develop to reveal a QUICK RECOVERY.   You should see several locations of files listed there... perhaps including DOWNLOADS, DOCUMENTS, FAVORITES, or DESKTOP (even though I think some of your own peut be different).    You can add other folders of your choice.   These 'Fast food' files indicate the main areas where you want THAT Sandboxie really save files on your drive.

    It is spirit, back to your email address and see if you can direct download of your photo accessory in one of these files in particular.   When you do, you should see a popup of Sandboxie, indicating that the file is eligible for recovery, which means that it can be moved out of (side) of the sandbox.   I said in general to recover in the same folder (on my real system, as it was tyring to save in the sandbox).   And click on the RECOVER button.   If get you there, it should do the trick.

    There may be other ways to do it... but this method works for me.

    Also (now that you know where are the settings), there should be a setting to ask you to empty the sandbox when you exit the program... and it should also let you know that you have lingering there files which will be lost if saved.

    EDIT: actually, I just closed my browser sanboxed, not through QUICK-picked UP a file... and I get a screen to DELETE the CONTENTS of Sandboxie, again reminding me that I can still get the file [or well, delete the content of the Sandbox].   Certainly, it's been a while since I have set up the program, so I don't remember if it was a default option, or something I've tweaked.

    Edit2: There is a short tutorial for using Sandboxie http://www.sandboxie.com/index.php?GettingStarted , which if you have the time, elaborates on this (in parts 4 and 5 of the tutorial).

  • Question about the scope of the object and memory.

    I created a class that extends Sprite.

    In this class, I have a private type BitmapData var

    I then add the Sprite as a child to another Sprite on the stage.

    Later, I delete the second Sprite (parent) of the scene and I put the variable referring to it to null.

    After the garbage collection (assuming that it happen correctly) there is no trace of the BitmapData?

    No, unless you did something extra.  If you cannot reference your bitmapdata object (and has no listener), he is eligible for gc.

  • Questions about the discs of recovery and partitioning Satellite A200-QH0

    I bought a model of Satellite A200-QH0 in Australia and due to the lack of forums in our country, I would like to ask a few questions here if that's ok.

    The book contains 3 partitions - partition "EISA Configuration" of 1.6 GB, the great partition of the BONE and the recovery partition. So I did the recovery DVD? s using the Recovery Disc Creator tool, as we are not provided with a real disk. But I would like to know what will make these records? My questions:

    1. they really will return that disc hard back to the _exactly_ how he was including the partition layout and software pre-installed?
    2 will be the recovery DVD works even if the disk has been repartioned? I would like to divide the system partition to give space for the files of data etc. But this extra partition will stop the recovery procedure works correctly?

    Please understand that I'm not interested in reformatting the entire disk. I want to just split the partition from the OS. But in case I need to replace the disk in the future or something, I would like to know how to close to 'original', these disks will make me, no matter what I do on the disc?

    Thank you
    Dave

    Hello

    I m not 100% sure how recovery works on the Australian laptops computers Toshiba, but I presume that the restore CD contains the image of Toshiba with the operating system Windows, drivers, tools and utilities.
    I think that if you want to use the recovery CD then the whole HARD drive will be formatted and all partitions will be erased.

    I think that the recovery partition is not created using the recovery CD because the CD of restoration has already been created for the recovery partition is no longer necessary

    Concerning

  • A few questions about the p6674y of hp and how best to update its graphics capabilities

    Hello

    I'm interested in upgrading my HP p6674y with a nicer graphics card. I've had this computer for about 2 years now. If I have to, I'm ready to upgrade the power to do this (even if I have no idea how to do this). I just want to be able to play YOUR v: Skyrim on my computer.

    If there is a way to upgrade just the graphics card, I want to do. The truth is that I am inexperienced with these sorts of things, then I want to be making sure not to break my beautiful machine, try to add or update!

    Do you have suggestions for what models graphics card or power supply purchase that will work with my computer?

    Thanks for any help you can give me.

    The recommended map is circa 2011 GTX550Ti (400W). See here

    Would require a new power supply, because your system has a skinny 250W. Ideally, you should select a 500W-630W PSU, as the power curve is best. The key is to find the mentioned card. Latest maps could support UEFI BIOS, and that would not work for you.

  • Question about the Qosmio F30-140 system memory

    I have a Qosmio F30-140 NB (to 667 MHz front side bus) and it has 1024 MB (533 MHz) DDR2 memory.
    If I want to increase the size of the memory, can I use DDR2 667 MHz for my NB type? and if this is true can I remove the type of DDR2 533 MHz or we as well as usef type of 667 MHz (no conflict).
    Please notify.

    THX

    Hello

    Surely, you can mix the modules. It will work because the 667 Mhz Module itself slower clock down to the FSB of the module installed in the system. So if you install another module of 667 Mhz, the frontsidebus must run at 667 Mhz Mhz and not at 533 Mhz. (I guess)

    But you can mix, which will not fail.

    Welcome them

  • Questions about the Extension of JavaScript and SQLite

    Hi all

    I worked with some my colleague on projects related to WebWorks applications, but there are technical issues that our developers want to know and seek professional advice.

    (1) extension JavaScript & PlayBook

    According to the literature, we know that BlackBerry WebWorks Application have the ability to integrate with data, characteristics and features of the development environment Java® underlying as well as the native phone smart BlackBerry® using special JavaScript® (Extension of JavaScript) objects. So, we should be able to create® for Java (JAR) libraries and program the WebWorks app for BlackBerry Java API to call in libraries. Now, we know that BlackBerry® PlayBook provide a SDK WebWorks (Beta) for us to develop apps for PlayBook WebWorks, also means that in the environment of the PlayBook we can also use the JavaScript Extension trick to call the Java API of BlackBerry?

    (2) SQLite on HTML5

    HTML5 standard offer of SQLite for us to store data in a SQLite database format. But the SQLite file seems limited only to be used in the Application of WebWorks. I wonder if there are ways we can read these file to another application (Application Java or other applications WebWorks) SQLite?

    In fact, what I want to know is the possibility of having a WebWorks Application capable of handling a SQLite file that is received from the server side on-the-fly, and then return the entire SQLite file to the server.

    It would be appreciated if some of you can give some tips about this, thank you.

    Wowzzz

    lasterra is right about these two points...

    We have not yet published the details on creating extensions in the AIR for WebWorks on PlayBook. We are currently working to finalize the open source on the WebWorks for PlayBook SDK so that we can download on github.  The complete source code for the platform will be available on github so that you can see what's going on under the hood.

    Creating extensions in the AIR for WebWorks is very different from Java. We started to use a new architecture that should be able to provide the URI and proceedings access to APIs and placing more procedural API code in JavaScript itself vs. the ScriptableObject Java code existing today.

    This new architecture will be a foretaste of the platform architecture WebWorks to proceed.

    It welcomes more details about creating extensions in the AIR... but currently the API underlying main platform on the BlackBerry PlayBook is AIR and the functionality of an extension will be limited to what is possible on the AIR platform and its extensions.

    In the development of the PlayBook options evolve, so too will be the architecture of the platform WebWorks... I can't really say much more than this now

  • Question about the keep buffer Pool and the Recycle Buffer Pool

    What will be the Pool of buffers to keep and recycle Buffer Pool contains actually in the Database Buffer Cache, especially what kind of objects? I know the definitions, but need to know the practical aspects to their topic.

    918868 wrote:
    What will be the Pool of buffers to keep and recycle Buffer Pool contains actually in the Database Buffer Cache, especially what kind of objects? I know the definitions, but need to know the practical aspects to their topic.

    When all else fails, read the Fine

    http://docs.Oracle.com/CD/E11882_01/server.112/e16638/memory.htm#PFGRF94285

  • Questions about the Qosmio F30-141 and OS

    Hello!
    I intend to get laptop Qosmio F30-141, but after purchase I want to replace an operational system on Linux Fedora Core, and with she would like to know, if properly supported by the given operating system this model (supported wi - fi particularly interested), or recommend another model?

    Thank you

    The problem could be that the Toshiba does not support Linux drivers and you will have to search in internet and 3 third-party Web sites compatible and supported drivers!
    Besides computers laptop Toshiba supports several tools and utilities that enables the features of the laptop.
    I imagine that you will not be able to use these features as FN keys for example

Maybe you are looking for

  • Why Firefox 20 stop my module appearance of work, even if it is private browsing, so what?

    Read the question.

  • Pavilion dv6: graphic driver problems

    I recently updated my graphics drivers on the AMD website, which I did not know that at the time, did not fully support the laptop itself. After having done that, I had a problem with playback of videos where in certain circumstances the video would

  • HP 15 laptop: unable to connect to wifi

    Hello world Please, I really need your help. I had my laptop has lowered Windows 8 for Windows 7 (64-bit). Now after the installation of the new operating system, I can no longer connect to the wifi. Here are the details of my laptop and the problem.

  • Satellite L300-1 has 3 - need some drivers

    HelloI need help to install a * SM BUS controller * and a * Signal Processing controller and PCI data acquisition * for my computer laptop Toshiba Satellite L300-1 has 3.I have a processor intel T3200.Help, please.Thank you.

  • DV6 battery unknown (93)

    Hello. I own a computer laptop dv6-3165sf and something just happened to the battery. Last week it worked 100% sustainable well, as long as it should be and HP Battery Check report was also clear. I had the battery out of the laptop for 5 days, and t