create the image cache variable

Hello world

I use swfloader for loading an image and store its contents in an array, so if it is loaded again in the future it can be loaded directly from this variable instead to download again.

First time when I load the image, it is loaded correctly and when I load the image even secondtime, it loads correctly for this variable, but old image is removed from the page. I am not able to understand what is the cause, here's the code I used for that.

public void loadimage(_data:Object) {}

check if it does not exist in the cachedata variable, then download another load from the cache

If (cachedata [_data.url] == null) {}
var _swfloader:SWFLoader = new SWFLoader;
_swfloader. Load (_data. (URL);
_swfloader.addEventListener (Event.COMPLETE, EventDelegate.create (onImagesComplete, imgconta iner));
} else {}
imgcontainer.addChild (cachedata [_data.url]);
}

}

public void onImagesComplete(event:Event,imgcontainer):void
{
var __tpLd:SWFLoader = event.target as SWFLoader;
var imgContents = __tpLd.content;

store in the variable cachedata

CacheData [filename] = imgContents;

var extension: String = filename.substring (filename.length - 3, filename.length);

imgcontainer.addChild (imgContents);

}

Please help me on this...

Thank you

It's because you're cached _tpLd.content which will be a Bitmap object. Thus, as soon as you do an addChild again about it, it will be removed from the previous container because it can have only one parent.

The solution is rather to BitmapData cache:

          varbitmapData:BitmapData = (contentasBitmap).bitmapData;

_imageDataCache.putImageData (_imageId, bitmapData);
For example, you can reuse it by building a new Bitmap of the same BitmapData object. The difference in memory usage will be negligible that you use again the same BitmapData.
Here is an implementation of the CachedImage with ImageDataCache component so that we do not have to write the plumbing around code. You can use or modify your code in the same direction. It is available at:
                              http://xebee.xebia.in/2010/11/25/Flex-in-memory-image-cache/

Tags: Flex

Similar Questions

  • Cannot create the Image of the system or system, unknown error repair disc: 0x80004005.

    Original title: cannot create the Image of the system or system repair disc

    I just bought a new Windows 7 computer. I tried to create a system repair disc, but still receive the error msg - error (0x80004005) unspecified. I tried - and lost - several DVDs in the process. Also, not able to create a System Image disc. The computer says that I have to format the drive and when I click OK, it goes through the movement, then gives me an error msg that the Format has failed. (In addition, it does me not the possibility not to format the drive.)  Very frustrating...

    Hi iamkira,

    This problem can be caused by a conflict with other programs installed on your computer, usually antivirus software. Follow the steps described in this document to create the drive in a clean boot state.

    Let us know if that helps.

  • Failed to save the system or create the image of the system, error: the problem occurred while trying to connect with the VSS writers (0 x 80042318).

    Original title: cannot backup Windows 7 system.

    When I try to back up the system or create the image of the system I get the following message, the error was detected in the Volumn Service VSS (Shadow Copy) the problem occurred while trying to connect with the VSS writers.  Verify that the event system Service and the VSS service are running and look for errors related to event logs. (0 x 80042318).

    Hi bernardolahoustino,

    Please keep us informed. Please let us know the State of the question, so that we can help you further.

  • Help to create the image preview for flv player

    Hello

    I created an application that includes a selection of the videos menu system and a video player.  Currently the flv player video when the application opens begins loading.  I would change this option to display a preview image which would not disappear until my users click on a button to display a video.

    I tried to use the preview image in the flv player and received this error message:

    "The preview image is displayed only during the creation. To generate a preview image of runtime, use the button export and load the image back by writing your own ActionScript. »

    Can anyone help me please with actionscript, I need to load my image in the player?

    Thank you

    :

    Fl.video import. *;
    Import fl.video.VideoEvent;

    showPosterFrame (null);

    display.autoPlay = false;

    function showPosterFrame(event:Event):void {}
    myPoster.visible = true;
    }
    function hidePosterFrame(event:Event):void {}
    myPoster.visible = false;
    }
    function playMovie(event:MouseEvent):void {}
    hidePosterFrame (event);
    Display.Play ();
    }

    myPoster.addEventListener (MouseEvent.CLICK, regarderMovie);

    Create variables
    var safeVideo:String = ' Videos/Fotolia_12024529_V_M (video security) .flv ";
    var safeVideoPlaying:Boolean = false;

    var videoToPlay:String;

    Manage the complete video events
    function videoCompletedHandler(event:VideoEvent):void {}
    If the security video has completed, and then play the video selected
    If {(safeVideoPlaying)


    safeVideoPlaying = false;
    Display.source = videoToPlay;
    } else {}
    showPosterFrame (null);
    }
    }
    display.addEventListener (VideoEvent.COMPLETE, videoCompletedHandler);
    display.addEventListener (VideoEvent.PLAYING_STATE_ENTERED, hidePosterFrame);

    Respond to a button click
    function buttonClickedHandler(event:MouseEvent):void {}
    var videoNum:String = event.currentTarget.name.substr (6).
    videoToPlay = ' videos/video' + videoNum + '.flv ';

    display.autoPlay = true;

    Safe video game
    safeVideoPlaying = true;
    Display.source = safeVideo;
    }
    for (var i: uint = 1; i<>
    This ["Button" + i.ToString ()] .addEventListener (MouseEvent.CLICK, buttonClickedHand ler);

    }

    p.s., make sure that there no artifacts as spaces in the variable object/forum names.

  • NB100 - cannot create the image of the main partition

    Hello.

    I am a Toshina NB100 user and I am happy with my netbook, but I have a problem.

    I always work with partition on my hard drive. 20GB primary partition and the secondary partition have 100 GB.
    I have the windows xp operating system on the primary partition, and on the secondary partition I music, photos, programs, games, etc.

    When I want to created an image of my main partition with Acronis partition magic or with other programs the NB1000 do not recognize the hard drive, the machime write a caption "I can not find the HD. I thing that the problem is the fault of the Bios.

    Anyone know of this problem? or maybe someone could do?

    Hello

    I doubt that it is a BIOS problem.

    The fact is that the laptop uses the SATA HDD controller and your imaging software cannot recognize the HARD drive due to lack of SATA drivers.

    The Intel Matrix Storage Manager package located on the Intel page contains the necessary files to the SATA.

    Good bye

  • How to create the image that was stored on the HARD drive

    Hello

    When I fixed my windows, I chose "Restore Factory Setting" options.
    This happens to reformat my hard drive and I lose the "TOSHIBA HDD Recovery" image.

    Is it possible to create this image again?

    Thanks in advance for your help.

    Hello

    The use of the Toshiba HDD image would format the HARD drive, but should not remove the Toshiba HDD image files that are stored on the second partition!
    That's why I put t know why you said you lost the image of Toshiba HDD.
    That is a little strange.

    On the other hand, you can try to create the recovery disk using tool of preinstalled Toshiba Toshiba recovery disc Creator called.
    This tool helps you to create the recovery disk using Toshiba image files stored on the second partition.
    I think you should try this.

    See you soon

  • Satellite L350-170: creating the image of the partition backup system

    New here so first of all, Hello to all.

    Need some advice if possible please.
    I just got a new laptop L350-170 with Windows Vista Home Premium.
    I went thro' the installation process and created with the program toshiba recovery disks but also make the thro' the post.

    What I want to do now is create an image of the full backup ' c' drive now that I have installed additional programs and adjust settings to get the laptop how I want it.

    I've tried acronis true image, but laptop won't boot from the restore cd, even tho ' cd/dvd is set in the bios as "first boot.
    Says it can't find the "boot partition" and assume that it is something with the toshiba restore program not be circumvented.

    Is there a 'ghost' type program that will allow me to create an image, and then start the disk in order to restore everything from the created image and therefore not lose everything I installed carefully?

    I suppose that, if I try to use the toshiba program once again, it will only reproduce the original installation.
    I hope someone can advise.

    TIA

    Hello!

    The Toshiba recovery disc sets only the laptop back to the factory settings. It s not a program backup like Acronis, but with the recovery disc you have installation of Windows with all the drivers and tools of Toshiba.

    What version of Acronis True Image do you use? I use version 11 and I have no problem on my laptops and PCs. It works perfectly.
    Maybe you should do a update.

    Have you set the SATA mode in the BIOS to AHCI or compatible? Maybe you need a driver SATA when you have defined it AHCI, but I think in its new version of Acronis you t need a n.

    I hope I could help a bit and if you have problems, make me know it.

    Good bye

  • Create the image with black and white patterns

    Hello

    With the attached VI I am able to create an image that is completely black (or white or any color according to values in the color palette). See picture1.

    Is it possible to create an image as photo 2 and photo 3 or any other form which consists of black and white patterns? I need an image with black and white areas that a camera can recognize.

    Thanks for any help.


  • create the simple register variable in Foglight 5.6.4 AND 5.5.8

    Hello

    is it a short and simple piece of code to simply create a register variable named "numero_fichier" with the value "60" in full?

    It's certainly very simple... but not for me ;)

    Thank you very much

    concerning

    VECD

    I just ran this script in the script console.

    He created the variable and filled both global default and extended by default to the integer value 60.

    varname = "numero_fichier";

    regValue = 60;

    topsvc = server.get ("TopologyService");

    type = topsvc.getType ("TopologyObject");

    Regsvc = server.get ("RegistryService");

    regsvc.createRegistryVariable (varname, java.lang.Integer)

    regsvc.saveRegistryValue (regsvc.createRegistryValue (varname, regValue));

  • Cannot create the image of the system due to an internal error

    Widows 7 cannot create an image system due to an internal error.

    What should do?

    Original title: the system image

    Hello

    Please contact Microsoft Community.

    I understand that you can not create the system image.

    I will definitely help you with this.

    What is the exact error of the internet you found?

    I suggest that you go through the links below:

    Refer to the suggestion given by Shubham Chaubey said may 17, 2016:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-update/unable-to-create-a-system-image/1f1011e6-468d-4AE1-99bd-c9be27677b41

    I hope this helps. Please post back with the State of the question and we will be happy to help you further.

  • Failed to create the image: 0x8078002A and I/O device error (0x8007045D)

    I get these errors when put to create an image on the D: drive letter any help would be appreciated.

    original title: 0x8078002A and I/O device error (0x8007045D)

    Found this on the page of Western Digital.  He's trying now all will let you know if it works or not?  Fingers crossed

    Error: 0x8078002A occurs when you back up to a 2.5 or 3.0 TB drive in Windows 7 backup and restore

    Answer ID 6618 | Last updated 19/05 / 2011-->

    Problem:
    If you are using Windows 7 backup and restore with a drive to 2.5 or 3.0, the backup fails with an error code of (0x8078002A).

    Cause:
    This problem is caused by a problem with the Windows 7 backup and restore when using disks with logical sector of 4 K sizes, which are found on WD 2.5 TB and larger external hard drives. This is different from a 'Advanced Format' drive (AFD) that use 4 K physical sector sizes. Readers of AFD should not cause this problem.

    Solution:
    It is always possible to use a disc, as long as you don't need to use the drive with Windows XP. Using the quick WD Formatter tool, select factory default configuration to reformat the drive.

    Warning: This tool will erase all data on your drive, in order to take the necessary precautions.

    After formatting the drive mode factory default , the reader will be usable in Windows Vista and Windows 7. However, the drive will not be recognized in Windows XP. It is the only way to get Windows 7 Backup and Restore to work properly.

  • Cannot create the image of the system under win7 64 bit

    I can't create a system image of my entire system and save the image to another hard disk.  I always get internal error ' 0 x 80070424.  I here to detect my other readers (also tried to connect an external hard drive) i get presented with the internal error message.  I don't stand less why I just do a clean install.

    The installation went with a hitch.

    System
    Card mother "Gigabyte X48T-Dq6 with the latest version of the bios installed.
    Core 2 duo quad core 2.6 Ghz cpu extrime.
    4 GB of ddr3 RAM.
    3 * 500GB & 1 * 1 TB hard drive
    XFX Gforce 295 1.7 GB of ram
    Ed xfi Platinum sound card
    DVD - rw standard

    Hi spyman1871,

    Try the checkdisk Defragmenter and disk running from the command prompt.

    Step 1: Checkdisk to run as administrator command prompt

    To do:

    1. go to start and type cmd in the search box.

    2. right click on cmd in the list and select run as administrator.

    3. click on Yes in the user account control prompt.

    4. If you want to repair errors without scanning the volume for bad sectors, at the command prompt, type chkdsk volume: / f, and then press ENTER.

    Note If one or more files on the hard disk are open, you will receive the following message is displayed:

    Chkdsk cannot run because the volume is in use by another process. You want to schedule this volume to check the next time that the
    the system restarts? (Y/N).

    Type there, and then press ENTER to schedule the disk check, and then restart your computer to start the disk check.

    5. to fix the errors, look for bad sectors and recover readable information, at the command prompt, type chkdsk volume:/rand press ENTER.

    Step 2: Run the command prompt Disk Defragmenter:

    To do this, type the following in the command prompt window.

    defrag c:-v,

    where C is the drive letter. You can choose according to the reader like you would to run disk defragmentation.

    Note: the command quick application shows no indication of progress, so be patient.

    The Windows Live OneCare scanner cleaning will find and remove the invalid registry on your PC. Cleaning scan will check your registry and
    Locate all items that can be deleted safely. You can then choose to delete all the items that the Analyzer detects or select the individual items for removal.

    http://OneCare.live.com/site/en-us/Center/cleanup.html

    See also this thread with a similar problem for more ideas on how to solve this problem.

    http://social.technet.Microsoft.com/forums/en/w7itprogeneral/thread/55f5fe3a-a1cb-4855-ba4d-73f32c202246

    Kind regards
    Amal-Microsoft Support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • create the image of dvd or iso file

    Windows 7 pro how can 64, I create an ISO file or a picture of a dvd?

    Try using WinToFlash and Windows 7 USB/DVD download tool to create bootable Windows 7 USB drive.

    http://www.microsoftstore.com/store/msstore/HTML/pbPage.Help_Win7_usbdvd_dwnTool
    http://WinToFlash.com/home/en/

    How to create an ISO Image of CD, DVD, or BD file (on the PC Support Web site): http://pcsupport.about.com/od/software-tools/a/create-iso-image-file.htm

  • How to create multiple thumbnail images while creating the Image assets

    Hi all!


    I have a requirement to create several thumbnail images (of different sizes), while creating new assets of image. These vignettes must be associated with different attributes after the recording of assets. I thought you used miniature filter, but I read that it uses a library of swing, it's very very inefficient memory-wise and we can experience the memory leak and crashes with only a very limited number of images... Another solution is to set up the filter citing ImageMagick with a system exec: it's fast, it does not have the memory and it also generates a much greater quality of thumbnail image resizer that comes with swing.


    What do you think, and how can I implement this?


    Thank you very much!

    Hello Elena,

    We noticed some performance issues in our current client, so we changed the miniature filter by default:

    A temporary file is no longer used for the input image. The source image is used directly, because it is not changed by the thumbnail generator.

    This avoids some performance issues, we have detected. First of all, because of the way the image has been copied (a byte is read and written each time), and second, because of some file systems environments run badly.

    In addition, it relies on "deleteOnExit", which can produce an impact on the performance of the application server, as the JAVA virtual machine must maintain a list of files to delete when leaving, and which consumes memory. It is even more problematic on servers that are not restarted very often.  And if at the end the application server is not normally off, these files would not be removed.

    On the other hand it seems that the thumbnail generator is not necessary that the image source file ends with the extension of the right.

    Now we use the provided source image directly, it's a ".tmp" instead of a file (for example) the file ".gif".

    It will be useful,

    Gerardo

  • Cannot create the READONLY cache

    Dear all,

    We try to create a Readonly cache. Here are the details:

    Con1: command > dssize

    PERM_ALLOCATED_SIZE: 307200
    PERM_IN_USE_SIZE: 9585
    PERM_IN_USE_HIGH_WATER: 9585
    TEMP_ALLOCATED_SIZE: 65536
    TEMP_IN_USE_SIZE: 10915
    TEMP_IN_USE_HIGH_WATER: 13728

    Con1: command > cachegroups;

    Group cache CACHEADM. TEST:

    Group cache type: read-only
    AutoRefresh: Yes
    AutoRefresh Mode: incremental
    AutoRefresh State: paused
    AutoRefresh interval: 5 seconds
    AutoRefresh Status: ok
    Aging: No aging set

    Table roots: HR. BIGDATA
    Table type: read-only

    Group 1 found cache.

    Con1: command > call ttgridstatus;

    < MYGRID1_alone1_1: Update member phase 9 >

    1 row found.

    But when trying to LOAD the CACHE, we get following error:

    Con1: command > test LOAD CACHE GROUP COMMIT EACH 256 LINES;

    5056: cache will fail: = < error Oracle > error_type, error_code = < 1740 >,.

    ERROR_MESSAGE: ORA-01740: missing double quote in identifier

    The command failed.

    and once again if if run the command above, we get

    Con1: command > test LOAD CACHE GROUP COMMIT EACH 256 LINES;

    799: unable to connect to the daemon. check the status of demon

    The command failed.

    but the devil is running...

    Help, please?

    You are able to view the statement of 'create a cache...'?

    Thank you

Maybe you are looking for