Check text in string AS3.0

So for my Flash class in school I'm making a game, this game has a keypad in it that if you enter the right code it unlocks the door. I have most of it down but am still confused.
So far I have a dynamic text box and when you hit the number buttons I'm using appendText() to add the number to the textbox. There's a clear button that clears the box, and an enter button to enter the code.
buttonEnter.addEventListener(MouseEvent.CLICK,codeCheck);
function codeCheck(e:MouseEvent):void {
          if (KEYPAD_TEXT.text == num1 + num2 + num3 + num4){
                    keypadUnlock = true;
                    trace(keypadUnlock);
          else {
                    KEYPAD_TEXT.text = String("Invalid");
                    trace(keypadUnlock);
Above is the code I am currently using, if I click the enter button right now all it does is tell me the code is invalid wether the code is right or not. This is because I don't know how to check what is actually in the textbox. So if the correct code is 1234 and I enter 1234, how do I make the if statement check wether or not the string says 1234 so that I can set my keypadUnlock to true and unlock the door?
If you need any more information please ask.

use:
kglad wrote:
use:
buttonEnter.addEventListener(MouseEvent.CLICK,codeCheck);
function codeCheck(e:MouseEvent):void {
          if (KEYPAD_TEXT.text == String(num1)+String(num2)+String(num3)+String(num4)){
                    keypadUnlock = true;
                    trace(keypadUnlock);
          else {
                    KEYPAD_TEXT.text = String("Invalid");
                    trace(keypadUnlock);
p.s.  please mark helpful/correct responses.

Similar Messages

  • Dynamically size movieclip to fit text's string height and width

    Hello,
    I am trying to dynamically size a movieclip to fit the size of a text's string height and width (This text is inside the movieclip)
    here is my code so far..
    var Font1_ = new Font1();
    var Format2:TextFormat = new TextFormat();
    Format2.size = 36;
    Format2.align = TextFormatAlign.CENTER;
    Format2.font = Font1_.fontName;
    var MessageBox:MovieClip = new MessageBoxMC();
    MessageBox.Text1.defaultTextFormat = Format2;
    MessageBox.Text1.embedFonts = true;
    MessageBox.Text1.antiAliasType = AntiAliasType.ADVANCED;
    MessageBox.Text1.wordWrap = true;
    MessageBox.Text1.width = 800;
    MessageBox.Text1.height = 400;
    MessageBox.Text1.textColor = 0xFFFFFF;
    MessageBox.Text1.cacheAsBitmap = true;
    MessageBox.Text1.mouseEnabled = false;
    MessageBox.Text1.text = String("Use the Arrow Buttons to move");
    MessageBox.width = MessageBox.Text1.width;
    MessageBox.height = MessageBox.Text1.height;
      MessageBox.x = 400;
      MessageBox.y = 200;
      addChild(MessageBox);
    this isn't working for me.. anyone know the best way to do this?
    I also want the text to be centered in the movieclip, with a border of around 2-4 pixels
    I am also not sure if i should be using text.length? any advice and input is greatly welcomed.
    thanks in advance!

    Essentially, you need to check for a change in .textWidth or .textHeight, which are different from .width and .height.
    This code works for me (assumes a background box called bg and a foreground text instance fg inside a moveclip and an X and Y bounds offset variable to say how far away you want the box from the text and a textFrameNudge to provide a tweak value).
         // Resize background box
         thisBox.bg.x = thisBox.fg.x - boundsOffsetX + textFrameNudge; // I'm using .4 as the tweak value for textFrameNudge
         thisBox.bg.y = thisBox.fg.y - boundsOffsetY;
         thisBox.bg.width = thisBox.fg.textWidth + boundsOffsetX*2 +textFrameNudge*thisBox.fg.getTextFormat().size;
         thisBox.bg.height = thisBox.fg.textHeight + boundsOffsetY*2;

  • Can't access text properties in AS3. only in MXML

    Please help, I want to access the text property via as3. The code below.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="listService.send()" height="100%" width="555" backgroundAlpha="0.0">
    <mx:Script>
        <![CDATA[
            import mx.collections.XMLListCollection;
            import mx.rpc.events.ResultEvent;
            namespace ink = "http://www.inktomi.com/";
            use namespace ink;
            [Bindable] private var xmlList:XMLList;
            [Bindable] private var listCollection:XMLListCollection;
            [Bindable] private var listData:XML;
            [Bindable] public var serviceURL:String = "http://boss.yahooapis.com/ysearch/news/v1/";
            [Bindable] public var searchFor:String = "biotechnology%20AND%20biotech";  
            private const PROXY:String = "http://localhost/employeePhoneDesktop/src/php/proxy.php?url=";
            private const APIID:String = "###################";
            private const PARAMS:String = "&format=xml&orderby=date";
            private function resultHandler(e:ResultEvent):void {
                listData = e.result as XML;
                // add the imems to an XMLList and XMLListCollection
                // so that they can be used with the repeater class
                // and update automatically
                xmlList = e.result.resultset_news.result as XMLList;
                listCollection = new XMLListCollection(xmlList);
                setData();
            private function setData():void {
                itemRepeater.dataProvider = listCollection;
    ------>  abstract.text = "test in AS3";
                abstract.visible = false;
        ]]>
    </mx:Script>
        <mx:HTTPService id="listService" url="{serviceURL + searchFor + APIID + PARAMS}" result="resultHandler(event)" resultFormat="e4x"/>
        <mx:VBox>
            <mx:Repeater id="itemRepeater">
                <mx:VBox verticalGap="0" x="10" y="10">   
                    <mx:LinkButton id="itemTitle" label="{itemRepeater.currentItem.title}" width="400"/>
                    <mx:Label text="{itemRepeater.currentItem.source + ' | ' + itemRepeater.currentItem.date}"/>
      ---->           <mx:Text id="abstract" text="test in MXML" width="400" visible="true" />
                </mx:VBox>
            </mx:Repeater>
        </mx:VBox>
    </mx:Canvas>

    I am getting it from yahoo boss API.(the public api for news search)
    <ysearchresponse responsecode="200" xmlns="http://www.inktomi.com/">
      <nextpage>
        <![CDATA[/ysearch/news/v1/biotechnology%20AND%20biotech?count=10&appid=&orderby=date&format=xml&start=10]]>
      </nextpage>
      <resultset_news count="10" start="0" totalhits="122" deephits="122">
        <result>
          <abstract>
            President Obama is "right to push for [health care] reform now, despite calls to postpone efforts solely on the economic recovery," a Philadelphia Inquirer editorial states.
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=13usgm8rr/**http%3A//www.news-medical.net/news/2009/05/14/Editorial-says-Obama-is-e2809cright-to-push-for-health-care-reforme2809d.aspx
          </clickurl>
          <date>
            2009/05/15
          </date>
          <language>
            english
          </language>
          <source>
            News-Medical-Net
          </source>
          <sourceurl>
            http://www.news-medical.net/
          </sourceurl>
          <time>
            00:39:35
          </time>
          <title>
            Editorial says, Obama is “right to push for health care reform”
          </title>
          <url>
            http://www.news-medical.net/news/2009/05/14/Editorial-says-Obama-is-e2809cright-to-push-for-health-care-reforme2809d.aspx
          </url>
        </result>
        <result>
          <abstract>
            By Bill Berkrot
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=137ejnkf3/**http%3A//www.iii.co.uk/news/%3Ftype=afxnews%26articleid=7322383%26subject=companies%26action=article
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            Interactive Investor
          </source>
          <sourceurl>
            http://www.iii.co.uk/
          </sourceurl>
          <time>
            22:37:09
          </time>
          <title>
            (AFX UK Focus) 2009-05-14 23:15 UPDATE 1-Tarceva helps keep lung cancer from worsening-study
          </title>
          <url>
            http://www.iii.co.uk/news/?type=afxnews&amp;articleid=7322383&amp;subject=companies&amp;action=article
          </url>
        </result>
        <result>
          <abstract>
            <![CDATA[The American Civil Liberties Union action in filing a lawsuit yesterday against Myriad Genetics is going to lead to one of the most important legal battles in the history of biotechnology, asserts Genetic Engineering & Biotechnology News (GEN). The ACLU charged that the patenting of two human genes linked to breast and ovarian cancer will inhibit medical research. The organization also claims ...]]>
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=11epq02rp/**http%3A//www.physorg.com/news161542716.html
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            PhysOrg
          </source>
          <sourceurl>
            http://www.physorg.com/
          </sourceurl>
          <time>
            22:07:23
          </time>
          <title>
            ACLU -- Myriad Genetics lawsuit will become landmark case
          </title>
          <url>
            http://www.physorg.com/news161542716.html
          </url>
        </result>
        <result>
          <abstract>
            <![CDATA[( Mary Ann Liebert, Inc./Genetic Engineering News ) The American Civil Liberties Union action in filing a lawsuit yesterday against Myriad Genetics is going to lead to one of the most important legal battles in the history of biotechnology, asserts Genetic Engineering & Biotechnology News. The ACLU charged that the patenting of two human genes linked to breast and ovarian cancer will inhibit ...]]>
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=126eo9o3d/**http%3A//www.eurekalert.org/pub_releases/2009-05/mali-agl051409.php
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            EurekAlert!
          </source>
          <sourceurl>
            http://www.eurekalert.org/
          </sourceurl>
          <time>
            21:53:26
          </time>
          <title>
            ACLU -- Myriad Genetics lawsuit will become landmark case
          </title>
          <url>
            http://www.eurekalert.org/pub_releases/2009-05/mali-agl051409.php
          </url>
        </result>
        <result>
          <abstract>
            Thornburg Core Growth Fund is outdoing its peers and the U.S. market so far this year, but manager Alex Motola would prefer that stocks hadn’t run up so far, so fast.
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=13e2var20/**http%3A//www.marketwatch.com/enf/rss.asp%3Fguid=%257B3976B0E2-6447-495E-9D35-37F2098C04DB%257D%26siteid=rss
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            Market Watch
          </source>
          <sourceurl>
            http://www.marketwatch.com/
          </sourceurl>
          <time>
            21:51:01
          </time>
          <title>
            The Stockpickers: Fund manager eyes FLIR Systems, Alexion, Equinix
          </title>
          <url>
            http://www.marketwatch.com/enf/rss.asp?guid=%7B3976B0E2-6447-495E-9D35-37F2098C04DB%7D&amp;siteid=rss
          </url>
        </result>
        <result>
          <abstract>
            WINNIPEG, MANITOBA--(Marketwire - May 14, 2009) - Kane Biotech Inc. (TSX VENTURE:KNE) (the "Company"), a biotechnology company engaged in the development of products that prevent and disperse microbial biofilms, has closed its previously announced private placement offering (the "Offering") with aggregate gross proceeds to the Company of $250,000 from the sale of 3,571,429 units ("Units") at a ...
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=127a0beqs/**http%3A//www.marketwire.com/mw/release.do%3Fid=990128%26sourceType=3
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            Marketwire
          </source>
          <sourceurl>
            http://www.marketwire.com/
          </sourceurl>
          <time>
            21:50:53
          </time>
          <title>
            Kane Biotech Announces Closing of Private Placement Offering
          </title>
          <url>
            http://www.marketwire.com/mw/release.do?id=990128&amp;sourceType=3
          </url>
        </result>
        <result>
          <abstract>
            The organizers of the annual biotechnology trade show at Progress Corporate Park were fully prepared to scale back this year's event in light of the sour economy.
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=12ede36kg/**http%3A//www.gainesville.com/article/20090513/articles/905131010%26tc=yahoo
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            The Gainesville Sun
          </source>
          <sourceurl>
            http://www.gainesville.com/
          </sourceurl>
          <time>
            21:16:50
          </time>
          <title>
            Biotech trade show draws strong turnout
          </title>
          <url>
            http://www.gainesville.com/article/20090513/articles/905131010&amp;tc=yahoo
          </url>
        </result>
        <result>
          <abstract>
            VANCOUVER, BRITISH COLUMBIA--(Marketwire - May 14, 2009) - Allon Therapeutics Inc. (TSX:NPC) reported today in its First Quarter 2009 operating results that the Company is on track to achieve its 2009 milestones, including completing a partnership with a major pharmaceutical company and advancing the clinical development of lead neuroprotective product candidate davunetide intranasal (AL-108) ...
          </abstract>
          <clickurl>
            http://lrd.yahooapis.com/_ylc=X3oDMTVjZGJ2c21rBF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA3pGU3g1R0tJY3JwUkdqcVQ3SkNxcVpaaDJBOTZXa29NdXBjQUFPanA-/SIG=1272cla75/**http%3A//www.marketwire.com/mw/release.do%3Fid=990087%26sourceType=3
          </clickurl>
          <date>
            2009/05/14
          </date>
          <language>
            english
          </language>
          <source>
            Marketwire
          </source>
          <sourceurl>
            http://www.marketwire.com/
          </sourceurl>
          <tim...
         listCollection
    <result xmlns="http://www.inktomi.com/">
      <abstract>President Obama is "right to push for [health care] reform now, despite calls to postpone efforts solely on the economic recovery," a Philadelphia Inquirer editorial states.</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=13usgm8rr/**http%3A//www.news-medical.net/news/2009/05/14/Editorial-says-Obama-is-e2809cright-to-push-for-health-care-reforme2809d.aspx</clickurl>
      <date>2009/05/15</date>
      <language>english</language>
      <source>News-Medical-Net</source>
      <sourceurl>http://www.news-medical.net/</sourceurl>
      <time>00:39:35</time>
      <title>Editorial says, Obama is “right to push for health care reform”</title>
      <url>http://www.news-medical.net/news/2009/05/14/Editorial-says-Obama-is-e2809cright-to-push-for-health-care-reforme2809d.aspx</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>By Bill Berkrot</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=137ejnkf3/**http%3A//www.iii.co.uk/news/%3Ftype=afxnews%26articleid=7322383%26subject=companies%26action=article</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>Interactive Investor</source>
      <sourceurl>http://www.iii.co.uk/</sourceurl>
      <time>22:37:09</time>
      <title>(AFX UK Focus) 2009-05-14 23:15 UPDATE 1-Tarceva helps keep lung cancer from worsening-study</title>
      <url>http://www.iii.co.uk/news/?type=afxnews&amp;articleid=7322383&amp;subject=companies&amp;action=article</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract><![CDATA[The American Civil Liberties Union action in filing a lawsuit yesterday against Myriad Genetics is going to lead to one of the most important legal battles in the history of biotechnology, asserts Genetic Engineering & Biotechnology News (GEN). The ACLU charged that the patenting of two human genes linked to breast and ovarian cancer will inhibit medical research. The organization also claims ...]]></abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=11epq02rp/**http%3A//www.physorg.com/news161542716.html</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>PhysOrg</source>
      <sourceurl>http://www.physorg.com/</sourceurl>
      <time>22:07:23</time>
      <title>ACLU -- Myriad Genetics lawsuit will become landmark case</title>
      <url>http://www.physorg.com/news161542716.html</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract><![CDATA[( Mary Ann Liebert, Inc./Genetic Engineering News ) The American Civil Liberties Union action in filing a lawsuit yesterday against Myriad Genetics is going to lead to one of the most important legal battles in the history of biotechnology, asserts Genetic Engineering & Biotechnology News. The ACLU charged that the patenting of two human genes linked to breast and ovarian cancer will inhibit ...]]></abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=126eo9o3d/**http%3A//www.eurekalert.org/pub_releases/2009-05/mali-agl051409.php</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>EurekAlert!</source>
      <sourceurl>http://www.eurekalert.org/</sourceurl>
      <time>21:53:26</time>
      <title>ACLU -- Myriad Genetics lawsuit will become landmark case</title>
      <url>http://www.eurekalert.org/pub_releases/2009-05/mali-agl051409.php</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>Thornburg Core Growth Fund is outdoing its peers and the U.S. market so far this year, but manager Alex Motola would prefer that stocks hadn’t run up so far, so fast.</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=13e2var20/**http%3A//www.marketwatch.com/enf/rss.asp%3Fguid=%257B3976B0E2-6447-495E-9D35-37F2098C04DB%257D%26siteid=rss</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>Market Watch</source>
      <sourceurl>http://www.marketwatch.com/</sourceurl>
      <time>21:51:01</time>
      <title>The Stockpickers: Fund manager eyes FLIR Systems, Alexion, Equinix</title>
      <url>http://www.marketwatch.com/enf/rss.asp?guid=%7B3976B0E2-6447-495E-9D35-37F2098C04DB%7D&amp;siteid=rss</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>WINNIPEG, MANITOBA--(Marketwire - May 14, 2009) - Kane Biotech Inc. (TSX VENTURE:KNE) (the "Company"), a biotechnology company engaged in the development of products that prevent and disperse microbial biofilms, has closed its previously announced private placement offering (the "Offering") with aggregate gross proceeds to the Company of $250,000 from the sale of 3,571,429 units ("Units") at a ...</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=127a0beqs/**http%3A//www.marketwire.com/mw/release.do%3Fid=990128%26sourceType=3</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>Marketwire</source>
      <sourceurl>http://www.marketwire.com/</sourceurl>
      <time>21:50:53</time>
      <title>Kane Biotech Announces Closing of Private Placement Offering</title>
      <url>http://www.marketwire.com/mw/release.do?id=990128&amp;sourceType=3</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>The organizers of the annual biotechnology trade show at Progress Corporate Park were fully prepared to scale back this year's event in light of the sour economy.</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=12ede36kg/**http%3A//www.gainesville.com/article/20090513/articles/905131010%26tc=yahoo</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>The Gainesville Sun</source>
      <sourceurl>http://www.gainesville.com/</sourceurl>
      <time>21:16:50</time>
      <title>Biotech trade show draws strong turnout</title>
      <url>http://www.gainesville.com/article/20090513/articles/905131010&amp;tc=yahoo</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>VANCOUVER, BRITISH COLUMBIA--(Marketwire - May 14, 2009) - Allon Therapeutics Inc. (TSX:NPC) reported today in its First Quarter 2009 operating results that the Company is on track to achieve its 2009 milestones, including completing a partnership with a major pharmaceutical company and advancing the clinical development of lead neuroprotective product candidate davunetide intranasal (AL-108) ...</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=1272cla75/**http%3A//www.marketwire.com/mw/release.do%3Fid=990087%26sourceType=3</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>Marketwire</source>
      <sourceurl>http://www.marketwire.com/</sourceurl>
      <time>21:06:17</time>
      <title>Allon Therapeutics Releases First Quarter Operating Results</title>
      <url>http://www.marketwire.com/mw/release.do?id=990087&amp;sourceType=3</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>Commercial crops of biotech sugarcane are one step closer to becoming a reality in Australia through new and improved genetic transformation technologies.</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=139iihgnm/**http%3A//nqr.farmonline.com.au/news/state/sugar/general/gm-cane-one-step-closer/1511778.aspx%3Fsrc=rss</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>North Queensland Register</source>
      <sourceurl>http://nqr.farmonline.com.au/</sourceurl>
      <time>19:04:06</time>
      <title>GM cane one step closer</title>
      <url>http://nqr.farmonline.com.au/news/state/sugar/general/gm-cane-one-step-closer/1511778.aspx?src=rss</url>
    </result>
    <result xmlns="http://www.inktomi.com/">
      <abstract>NEW YORK (GenomeWeb News) — The Minnesota State Legislature has approved $16 million in funding for a biomedical research partnership between the University of Minnesota and the Mayo Foundation.</abstract>
      <clickurl>http://lrd.yahooapis.com/_ylc=X3oDMTVjdG04ZXZ1BF9TAzIwMjMxNTI3MDIEYXBwaWQDWGpiSkhFX1YzNEguNldqRmdXSjBEUlJpVUdWSHVwRTJMWkFKM1o1Nnpmc04uT2pPS2VrZmNVcTZDR3VUTkdQc0gzTS0EY2xpZW50A2Jvc3MEc2VydmljZQNCT1NTBHNsawN0aXRsZQRzcmNwdmlkA1VDNU9NbUtJY3JybzRJZThoSEtpcjVjLjJBOTZXa29NdmIwQURSYk0-/SIG=12ijqf36u/**http%3A//www.genomeweb.com/minnesota-senate-passes-16m-medical-genomics-biotech</clickurl>
      <date>2009/05/14</date>
      <language>english</language>
      <source>GenomeWeb News</source>
      <sourceurl>http://www.genomeweb.com/</sourceurl>
      <time>18:48:03</time>
      <title>Minnesota Senate Passes $16M for Medical Genomics, Biotech</title>
      <url>http://www.genomeweb.com/minnesota-senate-passes-16m-medical-genomics-biotech</url>
    </result>

  • I have a Text control string box with some initial text. I would like to highlight old text with click of mouse and type in new data from keyboard

    I have a text control string box with some initial text (says: Please enter Name). I would like the operator to click on the text control box and have it automatically highlight so that when new data is typed in the old erases (all at once) and the new data is now in the text box.
    I tried using the "Text.Selection" property node and when I run it and put the mouse inside the text box the initial text is highlighted and if I press "delete" on the keyboard or if I start to type in new data the initial data does delete but once I start to type new characters they erase each other. For example if I want to type in “Willi
    am” I type the “W” and then the “I” but the “I” erases the “W” and now I am only left with an “I” in the text box and so on. I appreciate any help

    It seems you are continuously setting the property node over and over again. This should only happen once if you mouse over it.
    Create a property node for your text control with the following three items:
    (1) KeyFocus (wire a "true" constant to it)
    (2) Text.SelStart (Wire a "zero" constant to it)
    (3) Text.SelEnd (Wire a constant containing the string length of the text).
    Put this property node inside an event structure, triggered by "Mouse enter" on the string control.
    (see if the attached example works for you)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Enter_Name.vi ‏23 KB

  • Cut text from string

    Hello. Is there any way I can cut text from string?
    I have responseResult variable which has value: {"success":true,"error":"No any errors."}
    I want >>No any errors. << text from that string variable.

    Like Varun suggested above, this text is JSON, and you can parse out the various values using JSON deserialising.
    If you just want to use standard string manipulation (which I wouldn't recommend unless this is the only string you want to 'cut up') you can use various combinations of string functions.
    For example, you could split the string at every double-quote mark:
    string jsonString = "{\"success\":true,\"error\":\"No any errors.\"}"; // initial string
    string[] strParts = jsonString.Split('\"'); // split string into an array of parts of the original separated at each double quote symbol
    string partINeed = strParts[5]; // get the specific part needed
    That's not a good way to do this in general (you should add proper JSON parsing), but for a single use it's OK. Note that you have to hard-code which piece of the string you're getting, which is not a safe approach.
    Also note I used "\" in those strings so I could incorporate double-quotes in the string.
    For more detailed string manipulation read up on RegEx. If you need to parse a lot of these strings in your app use JSON.
    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.
    Thank you guys. That solved my problem.

  • Is this a proper way to check if a string exist in a db-column?

    I don't know I am posting this in the right forum... anyway... I am trying to check if a string as an email address exist in a database with jsp (by returning true if the string exist). I have managed to do it but I am not sure if this is the best way.
    As you see I have used stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" ) and checked by if rs.next() returning false or true. Here is my code in short format:
    boolean strExist = false;
    String myInputStr = request.getParameter("inputStr");
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery( "SELECT myDbColumn FROM myTable where myDbColumn=myInputStr" );
       if(rs.next())
          strExist = true;
       else
          strExist = false;
        return strExist;Is this the proper way of checking if a string exist in a db-column???
    Thanks

    I responded to your first thread [here.|http://forums.sun.com/thread.jspa?threadID=5374902]

  • Can you save an entire text message string?

    Can you copy an entire text message string to forward in an e-mail or otherwise save? Thanks.

    try this page
    https://discussions.apple.com/thread/3798706?start=0&tstart=0

  • Error #1056: Cannot create property text on String.

    Ok, i fixed the last error message, but i still cant get the xml to load, I am getting this error message now
    What does this mean, I can't seem to figure it out.
    I am trying to load the title of a video reel onto a button
    and load a corresponding move, 1 of 4...getting this error now
    ReferenceError: Error #1056: Cannot create property text on String.
        at main2_fla::MainTimeline/setVids()
        at main2_fla::MainTimeline/xmlLoaded()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    this is the correspoding codeits referring to:
    function setVids():void {
        for(var i = 0; i < 3; i++) {
            var name_txt:String = vidList_XML.vid[i + count].file;
            var reelTitle = this["vid" + (i + 1)].name;
            reelTitle.text = name_txt;

    It is telling you that you can't create a property called "text" on an instance of the String class.
    var reelTitle = this["vid" + (i + 1)].name;
    That is assigning the name property of this["vid"+(i+1)] to the variable reelTitle. You haven't typed the variable, but "name" properties are always Strings, so reelTitle is a String.
    And the String class is not dynamic, so you can't just go adding properties to it.
    My guess is that you want something like this:
    var reelTitle:TextField=this.getInstanceByName("vid"+(i+1))
    reelTitle.text=name_txt
    Or something like that....

  • Check if a string contains another string

    can anybody help?
    String st="DC";
    how can i check if another string contains "DC" or not?

    How bout
    if(someString.indexOf(st) != -1) {
         //someString contains st at some point
    }

  • How check if a string contains a generic character?

    I want know how i can check if this string
    String mio= new String("Error 101");contains this substring
    1xxwhere "xx" are two generic characters that follow "1".
    Thanks
    Message was edited by:
    PremierITA

    Use a regular expression.Pattern threeDigitNumberThatStartsWith1 = Pattern.compile(".*1\\d\\d.*");
    Matcher matcher = pattern.matcher(mio);
    if(matcher.matches()) {
      // found it!
    else {
      // didn't find it
    }More about pattern matching here: http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html

  • Text input action AS3

    I have a text input field on the timeline that I want the user to enter specific information in. When that information is correctly entered, I need the timeline to progress.
    I successfully used the following AS2, but I cant find corresponding code for AS3
    on (keyPress "x") {
    gotoAndPlay("s05");
    Any help on converting this function to AS3 is greatly appreciated.

    You can use an Event.CHANGE listener for the textfield and then test its value in the event handler function to see if it agrees with the required string...
    inputtField.addEventListener(Event.CHANGE, testEntry);
    function testEntry(evt:Event):void {
         if(inputField.text == "whatever"){
              // do stuff

  • How to pass line text into string of 72 characters

    Hi,
    I need to to pass  material text lines to a file for processing into different SAP system.
    Currently i am having multiple text lines stored in an internal table. I am looping that table and checking the string length of a first line.If it is less than 72 characters then i need to add spaces at the end of the text and make it 72 and pass it to workarea-field.
    However, while passing the next line text it is overwriting the spaces of first line and that is making the text meaning difficult to understand when passed to the other SAP system.
    Let me know how to approach.
    Thanks,
    Ankur

    Hi,
    This will not work as it splits the text as per the position.
    However what i would need is if i am entering text like this.
    Material ABCD --> Line 1
    This is finished product 9-series material used for high-value equipments. ---> Line 2
    Currently,  when transferring this data over the file it goes to the other system as
    Material ABCDthis is finished product---> upto 72 characters
    9 series material used for high-value ---> upto 72 characters
    equipments.
    So if there is less than 72 characters in the first line it takes 2nd line text. However it is ok if the text has more than 72 characters as it goes into the next line and still makes the meaning intact.

  • Uploading data to BW from a TEXT file , string fields show error

    I am trying to upload a TEXT file to SAP BW:
    City     Value   Date
    City1    100.00   20060101
    City2    200.00   20060102
    City3    300.00   20060103
    The text file has 3 fields:
    City (CHAR -STRING)
    Value (Numc)
    Date   (Dats)
    I have defined a file source system, the infosource and the datasource in order to upload the text file to BW.
    When uploading the infopackage of the text file, an error appears for the infoobject of type CHAR (STRING).
    The PSA is loading the record but it is in RED status showing that the characters are not allowed in the CITY field.
    The upload is made right if i substitute the string with a number, then the upload shows the green light.
    I need to upload string values to the CITY infoobject in my infocube, but the infopackage shows the red light when the text file includes characters like 'City1', it only permits numbers in the CHAR field.
    Please help me in order to upload a text file with CHAR (string) values to BW.
    Thanks in advance for your valuable help.
    I am working with CSV files.
    Carlos Eduardo España.
    [email protected]

    Hi Cempro,
    Always remember, the input file should have upper case letters. In your case, you have given in lowercase , so please change to upper case and run the Infopackage again. This should go fine.
    note: If the input file has lowercase letters, it need a different approach, meaning, you need to check few boxes. So, to avoid all thet, just change in your input file and just run the Infopackage.
    Remember, to do an ENTER at the "input file" section in the "external data" tab in Infopackage screen. This way, you are instructing the Infopackage to use the newly changed file.
    Thanks,
    Raj

  • Replace the text numbers string in a txt file using C++.. Help Me..

    Read a Document and replace the text numbers in a txt file using c++..
    For ex: 
    Before Document: 
    hai hello my daily salary is two thousand and five and your salary is five billion. my age is 
    twenty-five. 
    After Document: 
    hai hello my daily salary is # and your salary is #. my age is #. 
    All the text numbers and i put the # symbol.. 
    I am trying this code: 
    #include <iostream>
    #include <fstream>
    #include <string>
    using namespace std;
    ifstream myfile_in ("input.txt");
    ofstream myfile_out ("output.txt");
    string line;
    void find_and_replace( string &source, string find, string replace ) {
    size_t j;
    for ( ; (j = source.find( find )) != string::npos ; ) {
    source.replace( j, find.length(), replace );
    myfile_out << source <<endl;
    cout << source << endl;
    int main () {
    if (myfile_in.is_open())
    int i = 0,j;
    //string strcomma ;
    // string strspace ;
    while (! myfile_in.eof() )
    getline (myfile_in,line);
    string strcomma= "two";
    string strspace = "#";
    find_and_replace( line , strcomma , strspace );
    i++;
    myfile_in.close();
    else cout << "Unable to open file(s) ";
    system("PAUSE");
    return 0;
    Please help me.. Give me the correct code..

    Open the file as a RandomAccessFile. Check its length. Declare a byte array as big as its length and do a single read to get the file into RAM.
    Is this a simple text file (bytes)? No problem. If it's really 16-bit chars, use java.nio to first wrap the byte array as a ByteBuffer and then view the ByteBuffer as a CharBuffer.
    Then you're ready for search/replace. Do it as you would in any other language. Be sure to use System.arraycopy() to shove your bytes right (replace bigger than search) or left (replace smaller than search).
    When done, a single write() to the RandomAccessFile will put it all back. As you search/replace, keep track of size. If the final file is smaller than the original, use a setLength() to the new size to avoid extraneous data at the end.

  • How to insert text to string in c3

    hi
    we have file name with extension ,now we want add  some name to the file name
    EX: Testdocument.doc
    now we want Testdocument123.doc
    How to add 123 before extension(.)
    i am using this code
    string Val="123";
    string FileName = filename.Insert(0, Val);
    Out Put is:123Testdocument.doc

    Hi PS_L, 
    You can get the last index of ".", and use that with filename.Insert as a point in the string to insert the new text.
    string Val="123";
    string FileName = filename.Insert(filename.LastIndexOf("."), Val);
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

Maybe you are looking for

  • Fire problems after tiger

    hi all. I upgraded to tiger this week and now my firewire doesn't want to work. tiger = 10.4.8 FCP = 5.0.4 When i try to capture from a DV device it crashes with no pop ups afterwards. When i try to capture from a HDV device i can control the camera

  • Display hperlink in report based on column values

    Hi, I have a requirement to make report column as hyperlink column with the condition that 1 . If report column values is 0 then on '0' hyperlink should not display. 2 . In other values hyperlink should display. Please help me to achive this. Thanks

  • How to integrate UWL funciton with database information.

    Hi I am using web dynpro and GP to implement a workflow system (for example order process system). I need to implement a function to display on going order status of current processor. Database records around 10 order that were handled by current pro

  • Creating lines in a form during runtime

    I need to create some lines in a form canvas during runtime. How can i do that? Thanks for attemption.

  • Verizon PAP2 admin password or unlock guide.

    I recently purchased a pap2-vn that was previously used on Verizon. I did not do enough research and just found out it is locked and can only be unlocked with an admin password. Does anyone know of the username and password? Any guide to unlock the V