Using the & quot; as & quot; operator vs casting?

I have recently read the docs on the types of data in AS3 and I'm still not not clear about some things. If anyone has blogged about this, please point me there.

One of the problems are the "cast" syntax is identical to the syntax of the top-level function. Compare String (objString) to XML (event.result). The latter is a top-level function, but the first is a "cast". Or is it?

An option for the casting of the string is objString.toString (). What is the difference? I'm not so interested in the underlying details of the language, as in understand when to use which.

The same issue exists for the top-level XML (event.result) function, which can be done with the 'like' operator: event.result as XML. When to use which? Are there performance problems? Documentation "operator" is unsatisfactory.

Any discussion of this will be appreciated.

Tracy

ActionScript 3.0 has the ACE operator because it circumvents a gap with the cast operation () in ActionScript. Consider this:

var a: Object = new Array (1,2,3,4).
var b:Array = Array (a);

What is b? This is a table of 1 item: [[1,2,3,4]];

The operator got takes care of this:

var b:Array = a, as Array;

The absolute difference in the operators, is that if the cast variable is not of the correct type, the as operator returns null while the operator () throws an exception:

var j: Number = Number (a); exception!
var k: Number = a, as number; In this case, but normally null NaN

The feeling here at Adobe is to use the as operator because it is not ambiguous and just check for Null. If you prefer to catch exceptions and know when X (y) is a cast vs a conversion, then use it. More of a preference, but sometimes only that to do what you need.

Tags: Flex

Similar Questions

  • the quote operator is supported?

    Hey all,.

    It is more a question of SQL, but is supported in the quote operator?

    ex:
    SELECT q'!Tyson's string which contrains escaped ticks ' ' '!' 
      FROM DUAL
    Thank you

    Janet Tyson

    Tony,

    Maybe what you are looking for Oracle doc. See example use of literal text with Q or q as an alternative quoting mechanism.

  • When you use the question mark, appears like a capital E with accent French and cannot use the quotes.

    Original title: I can't use my question mark (rises like a capital E with accent French and cannot use the quotes)

    I'm having a problem from time to time with my ability to use marks quotaion, brands etc. How can I treat it DEFINITIVELY the question.

    Thank you

    Hi golfnut11,

    1. you are using a laptop?

    2. you remember to make changes to the computer priro to this question?

    Step 1:

    If you use a laptop, check if the FN key is enabled. If so, then try to turn it off and check.

    Step 2:

    You can also try to check the keyboard on the screen and if the problem occurs or not.

    Check out the link:

    Type without using the keyboard (on-screen keyboard)

    http://Windows.Microsoft.com/en-us/Windows7/type-without-using-the-keyboard-on-screen-keyboard

    If you use a Microsoft keyboard, you can also consult the following article:

    Troubleshoot wired keyboards that do not or only the erroneous characters category
    http://support.Microsoft.com/kb/258826

    Hope this information is useful.

  • By using the quote delimiter with set off.

    I have problems with the quote delimiter pick up the colon as a variable binding. For some reason any where there is a colon infront tick it break (ex. 2) but in (Exodus 3) he is behind the colon, it works perfectly.

     set define off
    DECLARE
     s1 VARCHAR2(20);
     s2 VARCHAR2(20);
     s3 VARCHAR2(20);
    BEGIN
      s1 := 'Isn''t t:his cool';
      --s2 := q'{Isn't th:is cool}';
      s3 := q'{Isnt th:is co'ol}';
      dbms_output.put_line(s1);
      dbms_output.put_line(s2);
      dbms_output.put_line(s3);
    END;
    /

    In this case simply update your client. From your database in version 10 already, you must also use a client version 10.

    9i and 10g client can be installed on a PC without a problem alnongside. It's just that the 10g client is installed with a little more subfolders. Maybe you have already installed and just continue to use the old client (old link?).

    On a windows client system 10g would be in a structure like this: file://c:/oracle/product/10.2.0/client_1/bin

    whereus 9i client is in: file://c:/oracle/ora92/bin

    Published by: Sven w. on July 21, 2011 19:33

    Published by: Sven w. on July 21, 2011 19:36

  • Flash/PHP/MySQL - send to DB fail using the & quot; : & quot;

    for some reason when you use the character ":" (with quotes) in the input string / / / its sends do not and insertion in the database, but if I do not use ":" it works perfectly fine... At one point, I had a 'Violation' error, but do not know if this is...

    NVM, figured out. Escape() to encode the text in html.

  • creating a tag using the & quot; pageType eq & quot; work for 2 titles instead of one page

    I have the code in my application that works through different directories. The page with the code is in a directory called CF and there are pages in a different directory that need to use the same code. for now, it is set up like this:

    < cfif pageType eq 'events' >
    they get this code
    < cfelse >
    they get this code
    < / cfif >

    I need to do something like this:

    < cfif pageType eq 'events' OR 'News' >
    they get this code
    < cfelse >
    they get this code
    < / cfif >

    When I write it like that, I get an error of not being able to convert to Boolean code.

    Is there and more easy way to do this?
    Thank you.

    Phoenix

    Azadi solution will probably be your best bet for maintainability, especially if you are going to have a bunch of pageType, you want to check. You should be able to combine the business news and events in 1 label :



    they get the code news and events


    they get other code

  • Flash &amp; lt; &amp; gt; PHP &amp; lt; &amp; gt; MySQL: FLVplayer (NOT using the &amp; quot; &amp; amp; quot; method)


    I have a CMS system im develop and I only just based it on the index.php page using an index.php? AP = viewer.php as model for the php doc...

    Now anyway, I set it up like this:
    index.php? AP = videoviewer.php & id = 25

    ID is the id of the database,

    on this game page I have a script that gets the name of the file "$thefilename" of this identifier and places it in a variable, after this code, I have a flash with a compononent FLVplayer.


    loadVariables ("index.php? AP = videoviewer.php & view =" + id, _root.test);
    XX var = trace (_root.test.thefilename);

    xoo var = ' contentsss /' + xx;

    theplayer. Load (Xoo)


    and of course, its does not work... I don't want to use the method of the echo = > echo "& thefilename =". $thefilename; because I don't have the name of the file to share...

    Any ideas?

    > can I use loadvariables ("thepage.php", "GET"); to get this variable?
    No, loadVariables and LoadVars sends a GET or POST request to a server. If the Flash Player is already in the HTML of your PHP code returned to the client browser, it is too late to use LoadVars or loadVariables. You can use a separate PHP script to make this request GET/POST also, but I think the FlashVars method makes more sense if you already have the variable ready by the time you return markup to the client. Discover the FlashVars here:
    http://KB.Adobe.com/selfservice/viewContent.do?externalId=tn_16417&sliceId=1

    NOTE: If you use a script to embed Flash, including that used in the generation of markup with the Flash IDE, you may need to use a different syntax for these scripts to create the FlashVars. As far as Flash embed scripts go, I like SWFObject and the syntax to add a FlashVar to this script is so.addVariable ("MyVar", "my value")

  • to use the NOW() function with operator (such as NOW () - 120) 11.1.1.6.11 or 11.1.1.7.1

    Hi all

    I want to use the function NOW with a different operator in obiee11.1.1.6.11 or 11.1.1.7.1

    but every time I have a creating a filter as

    TRAN_DATE is equal to NOW()-120, we become "an arithmetic operation is being performed on a non-digital type.»

    11.1.16.11 and 11.1.1.7.1

    Hare TRAN_DATE is in RPD datetime data type

    Can someone tell me how to replace the error and make the report run and return the results

    Do now () - 120 is a very simplistic way to look at it because it is highly ambiguous. IE: NOW less 120 "what?" Minutes? Seconds? Years? Petroleum products?

    Accuracy is the key. Now() gives a timestamp (a real timestamp DATA TYPE object!), so I guess you mean days.

    Timestamp data types are changed (projected through time) using the TIMESTAMPADD function, which in your case would by this formula:

    TIMESTAMPADD (SQL_TSI_DAY,-120, NOW()))

  • sending of form variables using the &amp; quot; GET &amp; quot;

    Here's what I do:
    Email input field text and 2 fields hidden, which I think I just set up the fields but they are not visible with the values already entered. The info should be sent to a campaign account to email with Sendito on their server. I guess I would use a form any of loadVariables to send field values, but I'm missing something... and I think it's the whole thing of 'GET '. I attach the HTML they give you down...

    Basically, when you enter your address and sign in HTML then takes you to a page on the sendito site and makes the thing whole confirmation. I'm stuck with Sendito because of my client and I really wouldn't want to have a window with the list HTML sign you... you know. Any help would be great!

    use:

  • using the &amp; quot; deleteTextField &amp; quot; function

    Here is the code I use to try to remove text fields:

    _root.createTextField ("band_name" + i + "_txt", _root.getNextHighestDepth (), 210, YPos, 160, 20);
    _root ["band_name" + i + "_txt"] .setNewTextFormat (detailsFormat);
    _root ["band_name" + i + "_txt"] .text = users [j] .band_name;

    ...

    for (var i = 0; i < display; i ++) {}
    _root ["del" + i + "_mc"] .removeMovieClip ();
    _root ["UPD" + i + "_mc"] .removeMovieClip ();
    _root ["band_name" + i + "_txt"] .removeTextField)

    The removeTextField function simply does not work. Any ideas?

    Yes. I use a variable I initialize at the beginning of my project and an increment for each time use a depth.

  • Using the guest host as operating system operating system

    When using VMware Server, if you install it on Server 2003, can use you your host operating system in your guest OS.  Or would you have to install another copy of it?

    Just trying to make sure I have good understanding.  If I install XP as a guest operating system, which is accessible remotely.  In addition, the same image can be created again and again or should I create a new serial numbers don't?  I'm fine with the purchase of new numbers of seria, but did not know how to create the guest operating system has worked.

    Consider each virtual machine comments as another computer.  So, everyone needs an operating system installed.  You can install the same host operating system, but it is a different facility.

    Microsoft allows you to use product keys Windows 4 ~ 5 times and then they will not activate them.  So if you remove an active Windows VM, that use of the key is lost.

    You may be able to copy a virtual machine already activated without having to re - activate, I'm not sure.  Like to do a clean install of Windows XP, activate and update, then copies of the virtual machine before you install additional software.

  • for BPEL XPath query, escape the quotes

    Hello

    Can someone tell me how to correct this query. Basically, I need the last part in quotes to be somehow escaped and the compilation process.

    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@Name = "ID"]')

    The Xpath query component is as follows: /ns1:createObject/req/Object [bpws:getVariableData('counter')] / options/property [@name = 'Id']


    I tried follows him:

    single quotes around the double quotes
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@name = '"' Id'" ']')

    using the ' & quot;
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/property [@name = & quot;) ID & quot;] ")

    Using single quotes around Id
    Ora:countNodes ('Receive_createObject_InputVariable', 'request','/ ns1:CreateObject/req/Object [bpws:getVariableData('counter')] / options/Property [@Name = 'Id']')


    Kind regards

    Hello

    You can't escape quotes in the assign activity, the only solution is to use a processing activity.

    You can use one of the following in your plan of xslt to count nodes having the Id with quotes.

    If Id is an attribute then use the following syntax:

    If Id is an element can use the following syntax:

    I have

    Kind regards
    Diakité
    http://SOA-HOWTO.blogspot.com

    Published by: Dharmendra Dubey on October 15, 2008 20:37

    Published by: Dharmendra Dubey on October 15, 2008 20:39

    Published by: Dharmendra Dubey on October 15, 2008 20:39

  • UDP COMMUNICATION FROM ONE SYSTEM TO ANOTHER BY USING THE TYPE CAST

    Dear reader,

    I tried a simple communication udp from one system to the other. I have conditions of that does not change the receiver vi It is set. I'm attaching my vi sending and receiving the part. Please go through it and give me suggestion on how to code the part shipment without changing the receiving party and successffully communicating by udp.

    I am just a starter in LabVIEW.I believe your suggestions of ideas will be very useful to move forward.

    Concerning

    Srinath, R

    One thing you should know is that cast a DBL (or table DBL) requires eight bytes (or an integer multiple of 8).

    The sender must send 8 bytes, which is easier to do by remodeling (padding) of the Boolean array with 8 element (using the table to reshape) prior to cast to a string.

    Here is the code that works. You can easily implement it your original code.

  • Can I use the jet with the i pad2 P1102w laser printer?

    Can I use the P1102w printer with my i pad or iPhone?

    Hello

    Your printer is compatible with Airprint with the latest firmware.

    Make sure your iPhone / iPad have iOS version 4.2 and more to support Airprint.

    Upgrade the firmware of the printer to your PC by using the tool below, using the tool for your operating system:

    Windows / Mac OS

    You will then be able to print from the iOS built in function print as long as they are connected to the same network as your printer.

  • What is the equivalent of | operator using the Q-quote mechanism?

    Version: 11.2.0.3

    I started a thread on similar requirement last week. I didn't want to resurrect. So, I start a new thread.

    We have a stored procedure called generate_table_stats that meet the stats for tables with a few additional options.

    Usually, this procedure is performed as below

    generate_table_stats exec ('EMP_DTL', 'BASIC');

    We want to generate the exec above instructions dynamically for all tables.

    In the traditional method of quotations, we use the concatenation (|) operator to separate the column names whose values are retrieved dynamically from the table queried.

    Similarly, how can I get a column of values printed when you use the Q-quote mechanism?

    In my column in table_name attempt below must be retrieved from user_tables. But table_name and pipes that are treated as literal string (which is not surprising).

    What is the equivalent of | (concatenation operator) when you use the Q-quote mechanism?

    -Expected results

    generate_table_stats exec ('EMP_DTL', 'BASIC');

    generate_table_stats exec ('CUSTOMER_DTL', 'BASIC');

    .

    .

    .

    -My attempt using Q-quote

    -Using # as the quote delimiter

    SQL > select q'#exec generate_table_stats ('| table_name |', 'BASE'); #' From user_tables;

    Q' #EXECGENERATE_TABLE_STATS('||) TABLE_NAME |', 'BASE')

    -----------------------------------------------------

    generate_table_stats exec ('| table_name |', 'BASE');

    generate_table_stats exec ('| table_name |', 'BASE');

    generate_table_stats exec ('| table_name |', 'BASE');

    generate_table_stats exec ('| table_name |', 'BASE');

    .

    .

    .

    .

    Hello

    The concatenation operator. works the same with any string expression.

    x | There

    Returns a string that is the same as sting followed immediately the string x y, x is

    • a literal string with Q before the first single quote
    • a literal string without Q
    • a VARCHAR2 column
    • a function that returns a string, or
    • any string expression.

    The string can be everything above, too.

    If you concatenate strings of 3 or more, like this

    str1. str2. ... || Suro

    then each of the STRS can be any kind of expression, independent of others.

    If you want to concatenate strings of 3, the 1st and the 3rd being Q-literals and the 2nd being a column, you can do it like this:

    Select q' generate_table_stats #exec (#' | table_name)

    || q ' #, ' BASIC'); #'

    From user_tables;

    Each of literals has its own Q and her own pair of start and end markers (all the ' # s in the example above).

    Since the first string literal has no any single-quotation marks incorporated, it is unnecessary to use Q-rating, and it could be misleading; a person who bed the code might think the actaully string contains ' #'s.  I prefer wriite the query in the form

    Select ' generate_table_stats exec (' | table_name)

    || q ' #, ' BASIC'); #'

    From user_tables;

Maybe you are looking for

  • Impossible to be re - connect my iMac to my iCloud account

    Hello. My iMac has been connected to my iCloud account, but apparently there is a bug somewhere I so disconnected icloud and agreed that all data belonging to my iCloud data (e-mail, calendar, contacts, etc.) could be wiped clean from the iMac. After

  • Syncing my Iphone problem

    Hello!! So the other night, I tried to sync my old 5s iPhone that I use as an iPod. Everything was fine, but at the last stage of the synchronization, a window appears with a message that says: "iTunes cannot sync photos to the iPhone"iPhone Ricky"be

  • Y570 fan does not work best after 2 years

    My Ideapad y570 is over 2 years old and large. The only problem that I've faced these last 6-8 months is when I start playing games and the laptop overheats and stops. The fan speed is set for an effective Heat Dissipation and this mode is perfect fo

  • For an IMAQ image, how is calculated the size of the area of alignment to the left or to the right?

    For an IMAQ image, how is calculated the size of the area of alignment to the left or to the right? My initial assumption of the diagram http://zone.NI.com/reference/en-XX/help/370281M-01/imaqvision/imaq_getimagepixelptr/ is that the left and right a

  • Laptop sent repair 4 times

    I've had my HP Dv7 sent repair for the same audio problem out-of-the-box 4 times now and the supervisor who once told me that, after three repairs without resolution, I have right to compensation, is saying that I need to send in my laptop again, and