Declaring variable

private var _history:Vector.<BitmapData>;
can any1 plz explain me this format of declaring variable specially ".<BitmapData>" part....
Thanx..

A Vector is a special kind of array than can only hold one 'type' of data. So in your example, the array _history will only hold BitmapData objects. This makes the access of the array much faster. Contrast this with _myArray:Array that might contain a mixture of object types as in:
_myBitmap:Bitmap
_myMovieClip:MovieClip
_myArray = new Array();
_myArray.push(_myBitmap);
_myArray.push(_myMovieClip;
If you pushed _myMovieClip into your _history Vevctor, you would get an error at run time since _myMovieClip is not a BitmapData object.
You can see more here:  http://help.adobe.com/en_US/AS3LCR/Flash_10.0/Vector.html

Similar Messages

  • How to declare variables in standard text  - so10 t.code

    Hello Friends,
             How to declare variables in standard text  - so10 t.code? Your response will be appreciated much.
    Thanks
    Sri

    For Script & Smartform  Text - &VAR&

  • Declaring Variable in Web dynpro ABAP

    Hi all
    I want to know how to declare variables globally and how to use internal tables from one method to another method without declaring each and every time in methods?
    Please suggest me to do this
    Appreciated your solution
    Regards
    Indiranjithn

    Hi
    This code in onselct method. For example
    DATA lt_node_am_detl1 TYPE wd_this->Elements_node_am_detl1.
    logic to move the data to internal table.
    lo_nd_node_am_detl1->bind_table(  lt_node_am_detl1 ).
    Now the filterd data in internal table and
    I declared this internal table in componentcontroller attributes tab like
    lt_node_am_detl1  and Elements_node_am_detl1 (Associate column ) and i tick the pulic check box.
    i am using another method onclick() .
    As you said the internal table declaration is not required if declared already in componentcontroller attributes tab .
    data wa_itab like line of lt_node_am_detl1 .
    Loop at lt_node_am_detl1 to wa_itab.
    endloop.
    while debugging i am not getting data in internal table .. Should I declared correctly in componentcontroller attributes tab .
    Tlhanks
    Indiranjithn

  • How to declare variable in the scipt

    data is coming from standard program .
    rf140-stida key entry date.
    bsik-bldat posting date
    i want to display difference between  rf140-stida and bsik-bldat in scipt form it will give number of days.
    how can i declare variables for this.
    how to write code in my form.

    Hi
    U need to create a routine to calculate the difference:
    /: DEFINE &DELTA& = SPACE
    /: PERFORM <FORM NAME> IN PROGRAM <PROGRAN NAME>
    /: USING &RF140-STIDA&
    /: USING &BSIK-BLDAT&
    /: CHANGING &DELTA&
    &DELTA&
    The routine has to be defined in your Z-PROGRAM and to have these interface:
    FORM <FORM NAME>  TABLES IN_TAB_EM     STRUCTURE ITCSY
                                                       OUT_TAB_EM STRUCTURE ITCSY.
      DATA: DELTA TYPE I.
      DATA: DATE1 LIKE SY-DATUM,
                 DATE2 LIKE SY-DATUM.
    * ---> Rembember the date has the ouput format, so it has to be converted in the
    * input format
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'RF140-STIDA'.
      IF SY-SUBRC = 0.
         DATE1(4)     = IN_TAB_EM-VALUE+6(4).
         DATE1+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE1+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'BSIK-BLDAT'.
      IF SY-SUBRC = 0.
         DATE2(4)     = IN_TAB_EM-VALUE+6(4).
         DATE2+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE2+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      DELTA = DATE1 - DATE2.
      READ TABLE  OUT_TAB_EM WITH KEY NAME = 'DELTA'.
      IF SY-SUBRC = 0.
         WRITE DELTA TO OUT_TAB_EM-VALUE.
         MODIFY OUT_TAB_EM INDEX SY-TABIX.
      ENDIF.
    ENDFORM.
    Max

  • Declare variables in an MDX query

    Is it possible to declare variables in an MDX query like transact sql? something like this:
    DECLARE @date1 date
    DECLARE @month1 int
    set @date1 = '12-12-2012'
    set @month1=DATEPART(m, @date1)-1
    select @date1 as dt1, @mesreferencia as mt1

    Hi ,
      In MDX , you will not be able to put variables in MDX. But Query scoped calculated measures can be used for such cases. The equivalent MDX for the above is
    WITH MEMBER [MEASURES].Dt
    As
    CDATE('12-12-2012')
    MEMBER MEASURES.DTPart
    As
    DATEPART("M", MEASURES.Dt)-1
    SELECT {MEASURES.Dt,MEASURES.DTPart} ON 0
    FROM [Adventure Works]
    Best Regards Sorna

  • Declare variables in function module

    hi gurus,
    i am making a function module in which i need to make some performs so as to do code reusability. but for that i need to declare variable globally. As i am working wth function modules for the fisrt time. can anyone please help me with that. i dnt want these variables in improt or export parameters.
    regards
    vibhor

    hi vibhor,
    there is a tab "display object list" on the top of the sap screen when u r in dat function module. press that.
    on the left side of ur screen there will complete lists of object used in fm. in includes there will a top include, declare all the variables u need globally in that top include. u can also create more includes for different performs if u want for modularizing ur program..
    regards
    palak

  • Can I declare variables in Reports from SQL Query

    Hi
    I have a Report from SQL Query published as a portlet on a page among other reports. In the query report I am using the fuction WWCTX_API.GET_USER at quite a few places to filter the data returned to the user. Can I assingn the user id to a variable at some level & replace the fuction WWCTX_API.GET_USER with the variable in all the places.
    For eg:
    usr varchar2(25);
    usr:= PORTAL30.WWCTX_API.GET_USER;
    select USER_ID, USER_LVL, BUSINESS_ID, BRANCH_ID from crs_user where user_id=usr;
    can i declare variable and assign the value like the above at any level(Report or Page Level) to the acces the variale in queries.
    Thanks in advance

    I have found that you can't use a * in a dynamic page.
    Try this:
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    You can also add table tags for column formating:
    <table>
    <tr><td>column 1</td></tr><tr><td nowrap>
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    </td></tr></table>
    Martin

  • Can we declare variable dynamic

    Hi ,
    Can we declare variables dynamically.
    [ java uses this feature in Garbage Collection.]
    Thanks ,
    Adi

    but jvm uses this dynamic decalration in Garbage
    Collection.
    then can't we use the same.I'm not sure I understand what you mean? Do you mean that objects are dynamically created at runtime? Yes they are but the variables in the class definitions were all declared at compile time.

  • "Reset" declared variables to initialized state?

    Hiya!
    This might sound like a very stupid question, but I have not figured out a way to do this. I am working on a "personal information manager", where users can enter a date in a lovely swing textfield, it get's parsed to Integer and a GregorianCalendar is created with it. Once I created the Calendar, the TextFields are emptied again, but of course the Integer instance variables are still declared with the old values. This leads to the fact that a user could click "add date" again and a date is created without entering any number at all.
    My question:
    Is it possible to set declared variables back to the state they had when initialized? They should be "empty"...
    I can`t set them null...
    Thanks for your help, it's much appreciated!

    The only type of variable where "empty" has any meaning is for an empty string: "". Otherwise there is no empty. Objects are by default initialized to null, numeric primitives to zero, and I think chars to '' but I could be mistaken about that one - I never use chars. So if you're using Integers, they could either be null, or an Integer - nothing else.

  • Declare Variable in Smartforms from BT and EPF tables

    Hi All,
    I am developing a smartform to display the payslip of employees.
    In my smartform I need to use fields from the BT table and EPF Table.
    I need to declare variables for the same fields in smartform.
    How can this be achieved.
    Any pointers or suggestions would be helpful.
    Thanks,
    Saher

    Hi
    Please search with the search term smartforms and u will get many threads which will answer your question.
    In  general, in form interface of smartform we declare the tables whose values are passed from the print program.
    IN global definitions, we declare the variables we use in the smartform.
    Regards,
    Vishwa.

  • What happens to dynamically declared variables when I'm not using them?

    Hello, I'm making a game using Flash Pro cc. But I wonder what happens to aTile, which is dynamically declared MovieClip variable through a loop. And each aTile gets the 2 EventListener's.
    for(var i:Number=0; i<pVector.length;i++){
        var aTile:ATile=new ATile();
        aTile.x=pVector[i].x;
        aTile.y=pVector[i].y;
        aTile.gotoAndStop(Math.ceil(Math.random()*Color));
        nVector.push(aTile);
        Spr.addChild(aTile);
        aTile.addEventListener(MouseEvent.CLICK,Clicked,false,0,true);
        aTile.addEventListener(Event.COMPLETE, stop,false,0,true);
         // the current function ends here. what happens to aTile now ?? Is it going to be garbage collected? By the way, this piece of code runs whenever a player starts a new level of my game. And I don't make use of the aTile variable in other functions. I use only the nVector variable. And does declaring a dynamic variable in a loop mean a multiple of them are created? For example, if I loop the piece of code above 5 times, does it mean 5 aTile variables are created? Or each time you declare
    var aTile:ATile=new ATile(); again, does it replace the 'old' aTile with the 'new' aTile and therefore only 1 aTile exists after the loop????

    I feel there is a gap in understanding of using variables by reference vs. by value. You should look it up.
    1. new instructs Flash to create a distinct instance that per se has absolutely nothing to do with aTile variable.
    2. REFERENCE to this new instance is assigned to variable aTile. aTile var is a temporary pointer to instance.
    3. It does not replace old tile - it replaces reference.
    4. If reference to the instance is not stored elsewhere - upon exiting of function this instance will be gced.
    5. By creating another reference to the instance you prevent it from GC. One of the ways you preserve instance is by adding it to display list when using addChild.
    You can look at this this way (it is a lame example but still it illustrates parts of the concept)
    Say you have
    1. basket;
    2. basket is small and can hold only one apple;
    3. table;
    4. an apple;
    5. apple can be placed into the basket or table;
    6. dog who love apples.
    7. Dog is trained not to take apples from baskets but table but is free to eat apples that are on the ground.
    So, once apple is in the basket or on the table - it is safe.
    If you move these entities into the realm of AS3, basket and table become declared variables, apple an instance and dog garbage collector.
    What this example demonstrates is that apple exists independently of basket or table. You can put apple to the basket OR on the table OR you can put apple into basket and place basket onto the table.
    1. Find apple instance (if you know whether apple is in the basket, on the table or in the basket on the table)
    2. Prevent dog from eating apple.
    3. Allow dog to eat it (destroy it when garbage collector kicks in) by assuring that apple is in neither basket or on the table.

  • Declare Variable Data Types

    From my understanding, there is no need to declare variables
    data type like String, Number, Array for it to function. For
    example:
    var abc:String = "abcde";
    var abc:Number = 1234;
    var abc:Array = new Array();
    We can write it in easier way and it is still working.
    abc = "abcde";
    abc = 1234;
    abc = new Array();
    So, what is the purpose and benefit to declare the variable
    specific data type?

    i mean that as3 (= actionscript 3) requires variable typing
    in most situations or the flash compiler will throw an error.
    and no, failing to use strict typing won't cause any
    debugging problems.
    there's also some "feeling" that strict typing enhances code
    efficiency, but i haven't seen anything convincing on this.

  • Declare variable in Scriplet or Declaration?

    When I declare variable in Scriptlet
    <%
         java.util.Date a = new java.util.Date();
    %>
    current time is <%=a%>When Refresh browser I get different outout
    current time is Mon Jun 17 19:44:14 ICT 2002
    current time is Mon Jun 17 19:44:26 ICT 2002
    current time is Mon Jun 17 19:44:34 ICT 2002
    current time is Mon Jun 17 19:44:42 ICT 2002
    but when I declare variable in Declaration
    <%
         java.util.Date a = new java.util.Date();
    %>
    current time is <%=a%>When Refresh browser I get same out.put
    current time is Mon Jun 17 19:45:19 ICT 2002
    current time is Mon Jun 17 19:45:19 ICT 2002
    current time is Mon Jun 17 19:45:19 ICT 2002
    current time is Mon Jun 17 19:45:19 ICT 2002
    I see many code, some code declare in Declaration, some code declare in Scriptlet
    Which application or Which situation should declare in Declaration, and declare in Scriptlet?

    Declarations are placed in the generated servlet after the class definition but outside of any method. Use them for instance variables and method overrides. For a multithreaded servlet, all threads will share these variables so you have to be very careful to avoid concurrency problems.
    Scriptlet code is placed in the _jspService() method so variable definitions are local to that method and in effect have request scope.  It is usually safer to define your variables here because of potential threading problems.
    In your example, when you declare in a scriptlet:
    <% java.util.Date a = new java.util.Date(); %>the definition is placed in jspService() and so a Date object is created on every request (and released at the end of jspService).
    Using the declaration, the Date object is created when the servlet is instantiated which is why you get the same value on every request.

  • Possible to declare variable on demand?

    Hi,
    Using Oracle 9i. I am new to PL/SQL (coming from C#), I would like to know if it is possible to declare a variable close to the where it is used. For example, in the Execution block of the procedure, let's assume I want to do:
    .. existing code ...
    vTest integer;
    vTest := 123;
    .. existing code (continued) ...
    Doing so, the procedure failed to compile. The only way I know so far is to declare the vTest integer; in the declaration block. Can you please let me know how to declare the variable in the body of the procedure?
    Thanks in advance.

    1) The line numbers are added by SQL*Plus as you enter code in order to make it easier to debug (i.e. when the error message says there is an error on line 15, it's much easier if SQL*Plus has added line numbers than if you have to manually count them). They are not intended to be part of the code block.
    2) Having nested DECLARE ... BEGIN ... END blocks in a piece of code would certainly strike me as unusual. Much like nested procedure declarations-- they are syntactically legal, and very occasionally useful, but they are sufficiently unusual that I would tend to avoid them if only because they are likely to confuse future developers that come along later. I've personally never seen code that did this in production, though I have seen a handful of folks use nested procedures, i.e.
    CREATE PROCEDURE p1
    AS
      PROCEDURE p2
      AS
      BEGIN
        NULL;
      END p2;
    BEGIN
      p2;
    END;I believe Tubby's point is that while it is good in general to declare variables close to where they are being used, if you have small modular code, the variable declaration block of your procedure ought to be very close to where the variable is being used. If you have a procedure that fills multiple pages and has multiple PL/SQL blocks, it is very likely that you should have factored out most of that code into smaller procedures and put everything in a single package.
    Justin

  • Declaring variables in loops.

    I am wondering about how the compiler deals with variables that are declared within the loop they appear in. Obviously if you have a:
    while (loop == true);  {
    int var;
    // do something that involeves var...The suggestion is that it allocates an int with every loop iteration?
    If I declare my variables outside of the context in which I use them, then they persist throughout code that doesn't need them.
    Surely the compiler is smarter than that?

    If I declare my variables outside of the contextin
    which I use them, then they persist throughoutcode
    that doesn't need them.The same goes for the variables declared in a loop.No it doesn't.
    If I write this:
    public class test
         public static void main(String[] args)
              for (int x = 0; x < 255; x++) {
                   int y = 12;
                   System.out.print(x + ", ");
              System.out.println("\n" + y + x);
    }The compiler throws two errors because the lower println statement has never heard of either x or y.
    Just declare the variables in the scope block closest
    to where they are needed. You're worrying about
    things that need not concern you.Oh, it does concern me though. I want my programs to be as neat as clean as possible and I also want to learn to be the best programmer I can: I'm not here to just leap on a gravy train! : )
    See, I do want to format my files in the manner you suggest, with variable declared in the scope in which they used, but how do I make adjustments to them later: I want to do this from the top of my file.
    If anybody has the answer I'll give them four more Duke dollars! : )

Maybe you are looking for

  • Can we pull data from one cube to another cube

    Hi All, I need to pull the data for a 4 fields from an existing info cube to another cube. Can any one let me know the procedure of how to do this. Thanks in Advacne

  • SOAPAction HTTP header case sensitive

    Hi gurus, I am trying to consume a webmethods java webservice via XI/PI NW2004 and when I send a request, PI send the soapaction field in uppercase. POST http://webservices.kuehne-nagel.com/HelloWorld_test HTTP/1.0 Accept: / Host: https://webservices

  • Makepkg fatal error: dbus/dbus.h: No such file or directory

    Hello everyone. I downloaded lxappearance2-git from AUR and I tried to makepkg but got the following error at the end of the making procedure: lxappearance.c:37:23: fatal error: dbus/dbus.h: No such file or directory I inspected the generated makefil

  • How to get userinformation by passing userid

    Hi All, I know how to get IUser Object for the current logged in user and get the user information like Job title, City, Time Zone, Country, Department etc.. The same details I want go get for a particular user (not current logged in user). Hence I a

  • Trouble-shooting SAP BEx authentication issues

    Hi Experts, When I am faced with an authorization issue in Business Explorer, it is quite troublesome as it is not as simple as executing SU53 and finding out the missing authorization objects.  SU53 does not seem to work on Business Explorer (i.e. e