Create cache variable for image

hi everyone
i am using swfloader to load an image, and storing its conents in an array so if it is loaded again in future it can be loaded directly from that variable instead of downloading it again.
First time when i load the image , it is loaded properly, and when i load the same image secondtime, it loads it properly from this variable but old image is removed from the page. I am not able to understand what is causing this, here is the code which I used for this.
public function loadimage(_data:Object){
// check if it does not exists in cachedata variable then download  else load from 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 function onImagesComplete(event:Event,imgcontainer):void
                var __tpLd:SWFLoader = event.target as SWFLoader;
                var imgContents=__tpLd.content;
// store in cachedata variable
                cachedata[filename]=imgContents;
                var extension:String=filename.substring(filename.length-3,filename.length);
                imgcontainer.addChild(imgContents);          
please help me on this...
thanks

That is because you are caching _tpLd.content which will be a Bitmap object. So, as soon as you do an addChild again on it, it will be removed from the previous container as it can only have one parent.
The solution is to cache BitmapData instead:
          var bitmapData:BitmapData = (content as Bitmap).bitmapData;
                     _imageDataCache.putImageData(_imageId, bitmapData);
So, you can re-use it by constructing a new Bitmap object from the same BitmapData. The difference in memory usage will be negligible as you are using the same BitmapData again.
Here is an implementation of CachedImage component along with ImageDataCache so that we do not have to write plumbing code everywhere. You can use it or modify your code on the same lines. It is available at:
                              http://xebee.xebia.in/2010/11/25/flex-in-memory-image-cache/

Similar Messages

  • Problem creating cache group for a table with data type varchar2(1800 CHAR)

    Hi,
    I am using TimesTen 7.0 with Oracle 10.2.0.4 server. While creating Cache Group for one of my table I'm getting the following error.
    5121: Non-standard type mapping for column TICKET.DESCRIPTION, cache operations are restricted
    5168: Restricted cache groups are deprecated
    5126: A system managed cache group cannot contain non-standard column type mapping
    The command failed.
    One of my filed type in oracle table is Varchar2(1800 CHAR). If I change the filed size to <=1000 it (E.g. Varchar2(1000 CHAR)) then the Create Cache command works fine.
    MyDatabase Character Set is UTF8.
    Is it possible to solve without changing the filed size in the Oracle Table?
    Request your help on this.
    Thanks,
    Sunil

    Hi Chris.
    The TimesTen server and the Oracle Client is installed on a 32-bit system.
    1. ttVersion
    TimesTen Release 7.0.5.0.0 (32 bit Linux/x86) (timesten122:17000) 2008-04-04T00:09:04Z
    Instance admin: root
    Instance home directory: /appl/TimesTen/timesten122
    Daemon home directory: /var/TimesTen/timesten122
    Access control enabled.
    2. Oracle DB details
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Oracle Client - Oracle Client 10.2.0.4 running in a 32 bit Linux/x86
    3. ODBC Details
    Driver=/appl/TimesTen/timesten122/lib/libtten.so
    DataStore=/var/TimesTen/data
    PermSize=1700
    TempSize=244
    PassThrough=2
    UID=testuser
    OracleId=oraclenetservice
    OraclePwd=testpwd
    DatabaseCharacterSet=UTF8
    Thanks,
    Sunil

  • What is the best way to create shared variable for multiple PXI(Real-Time) to GUI PC?

    What is the best way to create shared variable for multiple Real time (PXI) to GUI PC? I have 16 Nos of PXI system in network and 1 nos of GUI PC. I want to send command to all the PXI system with using single variable from GUI PC(Like Start Data acquisition, Stop data Acquisition) and I also want data from each PXI system to GUI PC display purpose. Can anybody suggest me best performance system configuration. Where to create variable?(Host PC or at  individual PXI system).

    Dear Ravens,
    I want to control real-time application from host(Command from GUI PC to PXI).Host PC should have access to all 16 sets PXI's variable. During communication failure with PXI, Host will stop data display for particular station.
    Ravens Fan wrote:
    Either.  For the best performance, you need to determine what that means.  Is it more important for each PXI machine to have access to the shared variable, or for the host PC to have access to all 16 sets of variables?  If you have slowdown or issue with the network communication, what kinds of problems would it cause for each machine?
    You want to located the shared variable library on whatever machine is more critical.  That is probably each PXI machine, but only you know your application.
    Ravens Fan wrote:
    Either.  For the best performance, you need to determine what that means.  Is it more important for each PXI machine to have access to the shared variable, or for the host PC to have access to all 16 sets of variables?  If you have slowdown or issue with the network communication, what kinds of problems would it cause for each machine?
    You want to located the shared variable library on whatever machine is more critical.  That is probably each PXI machine, but only you know your application.

  • How to create Presentation variable for columns and to use it in Narrative?

    Hi All,
    Anybody know how to create presentation variable for a column (i.e., i need to create it in edit formula section itself). And then, I should use it in Narrative section to display that column value. Is it possible? Or do i need to use any other variable for this requirement? If so please let me know, how to create it? This is very urgent requirement.
    Thanks in Advance
    Thenmozhi

    Hi Satya,
    I just want to create a table that should horizontally display the values like below:
         SUID Tag # :123456               Year Mfg: 2007                                                                                     
         Description: computer corporation FA ID#: 4576
         Model Number: 4569 hESC: #ert
         Serial Number: 78945 Flags: c
    Department: Hematology
    User: thenmozhi
    Database: OLAP
    I think we can create this type of report using either Narrative or Static Text. But I am not sure whether it is possible or not? And also another thing is that sectioning is applied for SUID Tag # column. So, depending on the dashboard prompt if the SUID Tag # retrieves two or more values.
    Then the first value for example 123456     and the values for the other columns related to this SUID Tag # value should display in the first page (i.e., page 1). And if the next value of the SUID Tag # for example say 678901 then the values should move to second page that is like this:
         SUID Tag # :678901               Year Mfg: 2008                                                                                     
         Description: Computer Manufacturing FA ID#: 4577
         Model Number: 4570 hESC: #eth
         Serial Number: 78946 Flags: G
    Department: Hematology
    User: Rehman
    Database: OLAP
    Thanks
    Thenmozhi

  • Can i Create Output Variable for DB Polling in BPEL 11g?

    Hi Team,
              I want to create the Output Variable for DB Polling,But when i double click on Reply Activity-->Create New Variable it is giving error message like "Can't Create output variable.The Selected operation doesn't have an Output Message".
    My Question is Can we create Output Variable for DB Polling, if Yes tell me the procedure to create the Output variable ?
    Regards,
    Kiran

    Hi Kiran,
    In these scenario generally runtime faults occurs so you can use the CatchAll activity and rethrow activity to complete the instance in error state. Also before the completion of the process if exception occurs you can rollback all the transaction.
    or
    you can use the Fault handling framework:
    Using Fault Handling in a BPEL Process - 11g Release 1 (11.1.1.7)
    Regards,
    Anshul

  • Variables for images?

    RH 8 outputting a CHM or webhelp
    Is it possible to use variables to switch images in and out when I compile?
    I would like to use single source to create 2 guides for 2 audiences. While nearly all of the text content is the same, the screen shots need to vary by audience.
    I know I can have popups/dropdowns to accommodate both audiences in one topic...just thinking of a more ideal solution...
    Thanks.

    Hi there
    You may accomplish this using Conditional Build Tags. You tag the desired images, then exclude tags at compile time using a Build Expression.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How to create a variable for key figure (value will be entered by the user

    I want to create one query, where the user has to entered a max value when the query is started, so that only the query rows will be listed, where the key figure value (integer) of the row is smaller than the max value given.
    How can i define that variable which has to start at the begin of the query; and also the restricted key figure iin consideration of the KF variable.
    Thanks for helping
    Ar.

    Hi Arnaud,
                Go to Conditions-> Right click -> New Condition -> Edit -> NEw -> Selct the KEy figures from the dropdown( the KFs that are used in the rows/columns) -> Select Less than from the operator drop down (less than is for you case) -> Values, there is an option to create a variable -> Select the variable -> transfer. It will appear on the top.
    Save & Execute, you will find it in your selction criteria.
    Regards
    Sunil

  • Can we create range variable for Query Key Date

    Hello Gurus,
    Can we create a range variable for Query Key Date ? when I tried to give a range of values for Query Key Date, I am unable to find Range Values option. I found only Single Values.
    so, Please let me know if we can use Range variables for Query Key Date ??
    Thanks in advance,
    Regards,
    Aarthi

    Hi Aarthi,
    This is relevant for the time dependant master data that is being pulled in thw query. Like if you are using a nav attr in the query and this nav attr is time dependant, then which record (from the char master data) is to be pulled into the report, depends upon the key date that you specify.
    The default key date value is the date on which the query is executed, that is <Today>.
    Hope this helps...

  • Create New Variable for COPA Drilldown Reports in KE3E

    Hi,
    How can we create a formula variable for COPA Drill down reports in KE3E? In standard global variables formula variable is not avaiable, I need to create a formula variables like ...from period, to period, last fiscal year and next fiscal year..
    While creating report in KE31/KE35 trying create local variables, but it doesn't.
    Can any body advise how can we create a new variables for  "from period, to period, last fiscal year and next fiscal year.."
    Thanks
    VS Rao

    Hi Rao
    For Period (From &To)
    1. KE3E
    2. Type of Var = Char Value
        Enter variable name, say, ZPERIOD
        Field Name = PERDE
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Selection Option
    For Fiscal Year
        Type of Var = Char Value
        Enter variable name, say, ZGJAHR
        Field Name = GJAHR
        Replacement type = Entry
        Enter Description
        Parameter/selectop = Parameter
    For Next and Last Fiscal Year
    When you define your form in KE34/KE35
    Use the variable ZGJAHR in your report
    In the column for Next Year, Enter "ZGJAHR+1" as the local variable for GJAHR
    In the Column for Last year, Enter  "ZGJAHR-1" as the local variable for GJAHR
    Regards
    Ajay M

  • Creating OLAP variables for infopackages

    Hello Gurus,
    I am interested in creating an "z" OLAP variable and then use in the DATA SELECTION in the infopackage,
    Where can I create the same?
    Thanks in advance.

    Hi,
    The following links will be very helpful for you.
    Step by step OLAP variable for Infopackage
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a05ac9fa-f44c-2c10-dbb8-ef54c102707c?quicklink=index&overridelayout=true
    Regards,
    Kush Kashyap

  • Create Same  Variable for 2 differents queries

    Hi guru's,
    I try to create one same variable in query designer for differents queries whiche have not the same field. I explain:
    For example, I have one of my query based on a ODS which has a field called EAN but its technical name is RIS_R1007_F57 and I have another query based on another ODS which has also a field called EAN with the following techincal name RIS_EANMD_F1.
    I would like to create a report with 2 tables and each query inside with in the variable screen, a variable which seeks in the both tables.
    Anyone has an idea?
    Thanks in advance for your help.
    Regards,
    Rawizzz.
    Edited by: rahhaoui mohamed on Jan 26, 2010 11:39 AM

    Hi.
    What I understand, is that you have something called EAN and this is stored in two ODS. In each ODS a DIFFERENT characteristic is used to store the EAN info.
    Thus, technically, you got two completely unrelated fields. The fact that they both contain the data for the same "thing" (the EAN), is something you can "tell the system" by creating a characteristic, let's say tech name ZEAN with description "EAN" and then load the values from both char's (RIS_R1007_F57 & RIS_EANMD_F1) into this new char (ZEAN).
    You could do this in different ways, but one way to do this, is to add the ZEAN to BOTH ODS and then in the load to each of the ODS, map the RIS_R1007_F57 to ZEAN and the RIS_EANMD_F1 to ZEAN.
    Now you can create two queries, query 1 on the data from ODS1, where you have RIS_R1007_F57 and ZEAN, and query2 on ODS2, where you have RIS_EANMD_F1 and ZEAN.
    In query1, you use ZEAN to make your restriction/selection, so create a variable on the ZEAN infoobject, ZVAR_1. When you are done, create query2 on the other dataset. Use ZEAN to make your restriction/selection AGAIN. You will find in the variables section the variable ZVAR_1 which you created before. Use it again and finish query2.
    Put both queries in a workbook, maybe on different sheets depending on what you need. Then, set the workbook properties to show the same variable in different queries only once.
    That should work.
    Br
    Jacob

  • Create a variable for user input entry to act as i/p to anothr variable

    Hi,
    I have a requirement in my report where i have two variables one is user entry called "A" the a other user exit "B" and the query is based on an ods.
    <b>
    Scenario:</b> If the user were to enter a string  XXX in A, i need to do a search on certain columns in ODS and store the corresponding keys (single column) in an internal table and the internal table column will act as multiple single values for variable B .
    <b>Questions:</b>
    1. How to get  the value entered in A.(so i can do select statement on ODS table).
    2. In the select statement we need to specify FROM table, so what would the ods table name be.
    3. How to store the values from the select statement into the internal table.
    4.How to populate the values in internal table into variable B.
    5.Once all this is done i need to reset the variable A to empty.
    p.s: ABAP code for any of the following would be highly appreciated.

    hi Karthik,
    1.  you can try
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'varA'.
                  l_var = LOC_VAR_RANGE-LOW.
    2. ods table name = /bic/a[odsname]00 or /bi0/a[odsname]00
    3. use select .... from... into table ...
    4. loop at that internal table and populate as sample code
    5. try to create a RKF with restriction to variable A, and hide this keyfigure,
        not use in reporting.
    hope this helps.
    Populating material numbers from a table to customer exit bex variable
    tables : /bic/azods00.
    DATA: it_ods like /bic/azods00 occurs 0 with header line.
    CLEAR L_S_RANGE.
    WHEN 'varB'.
        IF I_STEP = 2.
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'varA'.
                  l_odsfield = LOC_VAR_RANGE-LOW.
    SELECT * FROM /bi INTO TABLE it_ods
    WHERE odsfield = l_odsfield.
    loop at it_ods.
    L_S_RANGE-LOW = it_ods-fieldselected.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    endloop.
          ENDLOOP.

  • PHP create array/variable for two dropdowns and insert into one column

    Hello,
    I have been trying for days to get this to work. Any help would be very appreciated.
    The dropdown code:
    <?php //Dropdowns for hours and minutes
    $hour = array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
    $min = array (.00, .25, .50 ,.75);
    echo '<span class="red">Hours :</span><select name="hour">';
    foreach ($hour as $value1) {
    echo "<option value=\"$value1\">$value1</option>\n";
    echo '</select>';
    echo '<span class="red">Quarter Hours :</span><select name="min"';
    foreach ($min as $value2) {
    echo "<option value=\"$value2\">$value2</option>\n";
    echo '</select>';
    //Dropdowns for hours and minutes
    //Create variable to send to the time field using a hidden field
    function input_time($value1, $value2) {
    $time = count($value1 + $value2);
    return $input_time;
    ?>
    <input name="time" type="hidden" value="<?php echo "$input_time";?>" />
    The Schema:
    CREATE TABLE `ND_time_sheet` (
      `time_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `day` varchar(10) NOT NULL DEFAULT '',
      `date` varchar(8) NOT NULL DEFAULT '',
      `project_id` varchar(8) DEFAULT NULL,
      `non_bill` tinytext,
      `staff_id` varchar(5) NOT NULL DEFAULT '',
      `time` decimal(3,2) unsigned zerofill DEFAULT NULL,
      `type` varchar(30) NOT NULL DEFAULT '',
      PRIMARY KEY (`time_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1
    Thanks!

    9677670421 wrote:
    hi... i am trying to do the same but i am having the 2D array of data when first time if i clicked in table it should show the the first row values and if i again clicked same value should show in the second row and so on... but insted in my code if clicked (using insert into array ) at a time it is showing two rows of the data pl help me ..........
    This seems to be a different problem, so you should have started a new thread instead.
    Can you show us your code, tell us what you are clicking, tell us what you get and what you expect to get instead. Thanks.
    LabVIEW Champion . Do more with less code and in less time .

  • Creating placeholder boxes for images?

    I'm trying to work on a newsletter idea for someone, but I'm running into a small, but big issue with Pages. In InDesign, I can create an image box, size it, then place the image later. Have I missed something, or does Pages lack this capability? I'm currently working with '09, so it might have been added in a later version, but since this is the only thing I'm using it for, I don't want to buy the next version unless I absolutely have to.

    Yes, you can create image placeholders. If you look at the included templates, almost every image is a placeholder. Insert an image, any image, in your document & then select it & resize it if you want. Now go to Format > Advanced > Define as Media Placeholder. You can then drag & drop any image which will be resized to fit.

  • Create input variable for Attribute

    Hi Guyz,
    How do I create an input variable or restrict the query on an attribue of an Infoobject in the query
    The attribute is Navigational.
    I have to restrict the query by certain values of that attribute.

    Hi Ajay,
    Can you please throw in more details...
    I pulled in the Characteristic in the rows column of query designer, next I pulled the attribute and placed it under the Char.
    Now while restricting it..
    1) I right click on characteristic and choose restrict, Create a new variable.
    2) What type of Variable do I create ... User entry or replacement path...
    3) In the same screen where give in the name, tech name, processing by, Characteistic ... I only see the Characteristic here.
    Am I doing it right?
    If possible can you give the steps too.
    Thanks,
    Kumar.

Maybe you are looking for

  • Migration from EP6SP2 to EP6SP11

    Hi All, We are currently live in EP6SP2 Patch 4 for Portal and CM for around 3000 users...My client is interested in migrating to the current EP6SP11 Netweaver'04 version. Would like to discuss with anyone who has done the same...would know the follo

  • 1. How do I add CSS effects to a certain element?

    How do I add CSS effects to a certain element? There are several effects (like customized hover effects) that I could with CSS. I want to know how do I add the CSS effects for a certain element/object from within Edge animate.

  • Chart in forms 6i

    Hello, I created within forms 6i with the chart wizard a chart with emp.ename as x-axis-values and emp.sal as y-axis-values. The table emp is contained in data block mytable, the chart item in the data block mycharts. The emp.empno are also displayed

  • Conatcts huge problem need help A.S.A.P

    I am having trouble with my contacts on my Ipod touch at the top of the page it has a half circle with a arrow and i have tried clicking it and it does nothing it wont let me add contacts. it has also erased all of my contacts put on there and has on

  • Where MVC patten is used in WEBDYNPRO

    Hi All, I worked on BSP and webdynpro. I am having the following doubt. In Webdynpro,  how exactly the MVC architecture is followed. In BSP  :  we are creating the global class ( Model ).  when creating the controller , in DO_Request we are calling t