AS3 Big Problem please read and suggest or help maybe?

how can i make this using split or other codes or way?
i mean  i create a keyword
for example my keyword is "HELLO"
then if you input "HELLO" the output will be "HI"
even if i output "HELLO THERE" the ouput will be still "HI" because my keyword is HELLO
its for our thesis project PLEASE HELP US

Although your description doesn't clarify exact use cases it feels like you need to create a map of strings and read map on user entry. Here is an example - just paste it on timeline:
var systemText:TextField;
var inputText:TextField;
var wordMaps:Dictionary;
var keyword:String = "hello";
init();
function init():void
          drawTextFields();
          setMaps();
function setMaps():void
          wordMaps = new Dictionary();
          wordMaps["hello"] = {response: "HI", inputs: ["hi", "how are you", "what's up"]};
          wordMaps["good bye"] = {response: "babye", inputs: ["bye", "fairwell", "get lost"]};
function drawTextFields():void
          systemText = new TextField();
          systemText.defaultTextFormat = new TextFormat("Arial", 12);
          systemText.width = 300;
          systemText.height = 200;
          systemText.multiline = true;
          systemText.border = true;
          inputText = new TextField();
          inputText.defaultTextFormat = new TextFormat("Arial", 12);
          inputText.width = 300;
          inputText.height = 22;
          inputText.type = TextFieldType.INPUT;
          inputText.border = true;
          inputText.multiline = inputText.wordWrap = false;
          addChild(systemText);
          addChild(inputText);
          systemText.x = systemText.y = inputText.x = 10;
          inputText.y = systemText.y + systemText.height + 10;
          inputText.addEventListener(Event.CHANGE, onInput);
function onInput(e:Event):void
          var re:RegExp = new RegExp(wordMaps[keyword].inputs.join("|"));
          systemText.text = "You: " + keyword + "\n\nSystem: " + (re.test(inputText.text) ? wordMaps[keyword].response : "");

Similar Messages

  • BEFW11S4 Problems, Just read and try to help!

    I have a BEFW11S4, i have one computer directly connected to the BEFW11S4, and the internet works fine, that is what i
    am using now, but i have another coord going into a Netgear router, and i have 2 computers connected to the netgear router that
    arent working at all, and i also have a wireless laptop that isnt working either, my question is why is the one computer working
    but the other three not? and i also looked into the advanced settings, in the router, and it shows the INTERNET IP ADDRESS at
    0.0.0.0, so i have no idea what could possible be wrong, and ideas?

    First lets address the second NetGear router.  Make sure on that router you change its IP address to the same IP range that your Linksys router is using.  To do that you have to access the NetGear's user interface and change the IP to 192.168.2.1 and disable the DHCP.  If that router is set up to keep the two segments separate the assign a static IP in the Linksys router and set the IP in the NetGear to that IP.  That will give that segment (subnet) internet access and you will not see each other. 
    Now on the wireless issue did you set up your SSID so you can identify it when you do a site survey from your laptop?  If their are other wireless networks in your area make sure your channel is set at least four away from the other wireless networks.  Also when or if you set up any security on the wireless network use either WPA or WPA2 (if your wireless devices support it) and make sure you can remember them or write them down so when you connect your laptop you can enter the settings exactly. If your laptop will not see your SSID then make sure you have broadcast SSID enabled and your antennas are firmly attached.
    Richard Aichner (Ikester)

  • Problem on reading and writing from from a *.txt file

    I get Problem on reading and writing from from a *.txt file. The following is the read() method...
    The software said the DataInputStream is depreciated. Can anyone help me please?
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        String str = "";
        try
          in = new BufferedReader(file);
          //in = new FileInputStream(file);
          for(;;)
            str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);
      }

    Thank you for your reply. I have made some change. However, there is an incompetable type found error.
    in = new BufferedReader(new InputStreamReader(in));The following are all of the code.
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        //BufferedReader in = null;
        String str = "";
        try
          in = new BufferedReader(new InputStreamReader(in));
          //in = new FileInputStream(file);
          for(;;)
            BufferedReader Bstr = new BufferedReader(new InputStreamReader(in));
            //str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);

  • Problem with iTunes and iPhone Music organization. PLEASE READ AND HELP!

    Hello All!
    I have this problem concerning iTunes and my iPhone. When I add music, and I update the Artist title to organize it in my iPhone, It shows EDITED on my mac in iTunes, but not my iPhone. I took a screen shot of what It shows. The TOP is iTunes showing "Arie Dixon" and "Arie Dixon & Olivia Cipolla" two seperate CD's, yet different Artist Titles, just the way I want it. The BOTTOM shows how the file was originally, in 3 seperate titles, "Bebe Boohgz" "The Jackmove 3" and "Arie Dixon 'Bebe Boohgz' and Olivia Cipolla". The problem is that iTunes shows it in the correct title, but my iPhone won't. This is my 2nd iPhone 4 I have that has this problem. I'm not sure if it's the settings or encoding, can someone help me out? I can't be the only person with this problem. Apple rep looked at me like o_O
    I also have music that won't appear in my iPhone, I manually have to search for, but appears on my iTunes in the correct title.
    I also have everything updated, and have the new os x release.

    kcinokc wrote:
    I have a 3GS and the ios is 4.3.4.   I am trying to load the latest version so I can then get the icloud.
    So plug the device into the computer and upgrade.
    Are you getting a specific error message when trying to do this?
    As for the message about the media disappearing, of course it will.  This is how iOS upgrades work.  The device is wiped and the newest version of iOS for the device is installed as a "new" device then the device is restored using the backup created prior to the upgrade.
    All the content on the device should already exist in iTunes on the computer.
    If you want to move your iTunes library to a different drive for capacity reasons, do the following:
    Close iTunes
    Copy or Move the ENTIRE iTunes folder from the C drive to the other drive.
    While holding SHIFT launch iTunes.  iTunes will then prompt the user to select a library or create a new one.  Point iTunes to the new iTunes folder location.

  • Big Problems with Vista and Audigy

    Hello.
    My name is Jana and I'm from Germany. This board is my last hope now.
    I have big problems to use my audigy 2zs in Vista Business (32 bit).
    I use the latest driver from 9.3.07.
    The installation process works fine and I get no errors. But I can't start the AudioConSole . I always get an error, that no audio device was found (error message is german)?!? The device manager shows no problems and the audigy 2zs is correctly listed.
    I need this AudioConSole to activate the 5. speaker settings. In the sound preferences in Vista is that not possible.
    My speakers also need the creative software from cd to activate the bass, but I when I install this software and then restart, only a few programs are installed (but they don't work). I need especially the speaker settings but there is unfortunately no way to install this software.
    I did this procedure at least 5, 6 or 7 times, but it always don't works.
    So please can you help me?
    Sry for my bad english.

    Hmm... Try to redownload the drivers from the website, because Creative has updated them to include a proper signature. It is possible that the drivers do not load if they are not signed, which would explain why the AudioConsole does not launch. Also, Windows Vista does the Bass redirection by itself:? If you select 5. speakers from the standard Control Panel, you will be asked whether you have satellites or full-range speakers. Selecting satellites means that the lower frequencies need to be played by the Subwoofer instead. If that still doesn't work, you can do the following:? Extract the downloaded drivers using WinRAR (or similar) (right-click and then extract). Then go to the Subfolder "Drivers\wdm\common\i386"? and run "CtPanel.exe". From there going to the speakers tab there is a "BASS-M" option...

  • Callable statement Clob problem..reading and writing

    Hi,
    I am having problem ,,trying to read and write a clob object ...
    DB Server is oracle 9i and app server is WAS5.1
    I am geting exception...
    java.sql.SQLException: Missing IN or OUT parameter at index::
    pls check the code below..
    Connection connection = null;
    CallableStatement csmtObj = null;
    Clob clob = null;
    try {
    connection = getConnection();
    csmtObj = connection.prepareCall("{call MYPROC(?,?,?)}");
    csmtObj.registerOutParameter(1,Types.CLOB);
    csmtObj.setString(2,"xxx");
    csmtObj.setString(3,"YYY");
    csmtObj.execute();
    clob = csmtObj.getClob(1);
    } catch (Exception exception){
    exception.printStackTrace();
    throw exception;
    Regards

    Thanks
    I was able to resolve the reading part but ...I am getting exception while writing ..
    it says parameter type conflict..
    This is the code
    public static boolean putStringAsCLOB(String strContent, String strDataType,
              String strOperType) {
         boolean operationStatus=false;
         Connection connection = null;
         CallableStatement csmtObj = null;
    String clob = strContent;
    ByteArrayInputStream bais = new ByteArrayInputStream(pfoAsBytes);
    InputStreamReader reader=new InputStreamReader(bais);     
    try {
              connection = getConnection();
              csmtObj = connection.prepareCall("{call MYPROC(?,?,?)}");     
              csmtObj.setCharacterStream(1,reader,pfoAsBytes.length);
         csmtObj.setString(2,strDataType);
              csmtObj.setString(3,strOperType);
              operationStatus=csmtObj.execute();
         } catch (Exception exception){
              exception.printStackTrace();          
         } finally{
              if(connection != null){
                   try {
                        connection.close();
                   } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
         return operationStatus;
    Regards
    Message was edited by:
    user606712

  • I have a big problem please help me

    Hi,
    first of all, excuse my very bad english.
    I have a big problem. I made a big movie (2 hours) with a lot of effect in iMovie HD and I made a big mistake : I erase it without burning.
    Is there a way to save my life ??? A secret folder with a backup ?
    thanks a lot

    Hi yab-yab:
    Welcome to the discussions! (Your English is not bad)
    How did you delete it? Empty imovie trash? Empty Finder trash?
    Did you look in Applications->iMovie (or wherever you saved it) and see if the movie was saved there? if it is not there, it is gone ;(
    Sue

  • Here's a challenge please read and help.......

    I work for a company of a 1000 people and the owners bought everyone an ipod.
    the problem is that my boss wants me to record each persons serial number to their ipod and print it out for his records.
    i know that the serial number is on the back of the unit but that would take to long.
    I also know that when its plugged into the ipod updater program the serial number also shows.
    I would like to know if someone can build me a script that would grab the serial number to each ipod i plug in to the updater (maybe bash script, grab from string) copy it to the clip board and paste it to a text edit document. ohh and also a dialog box so i can write the persons name down. and if that can be added to the document as well.
    Sincerely
    an over worked employee.

    If you still have the boxes handy, check to see if the S/N is printed on with a barcode. If so you can just zap those all in with a reader and be done with it in minutes.
    Otherwise, to fish that string out of Updater first you must launch Apps/AppleScript/AppleScript Utility.app and check Enable GUI Scripting (enter an admin pass), then you can run this script…
    click here to open this script in your editor<pre style="font-family: 'Monaco', 'Courier New', Courier, monospace; overflow:auto; color: #222; background: #DDD; padding: 0.2em; font-size: 10px; width:400px">tell application "System Events" to tell process "iPod Updater" to set an_sn to the value of static text 6 of group 1 of window 1
    tell application "TextEdit"
    activate
    set a_name to the text returned of (display dialog "Enter a name for iPod " & an_sn default answer "")
    if the length of (get documents) is less than 1 then make new document
    tell (a reference to the front document's text) to set contents to contents & an_sn & tab & a_name & return
    end tell</pre>Edit

  • Ingo or other experts, Could you please read and help us

    Hi Ingo,
    I am an avid reader of your blog, the new book and took your help in the past.
    Need your advice on the following scenario regarding..(I think SNC would solve this, but i need your advice)
    Scneario:
    1. Will be going live in couple of days with reporting solution. Environment: BO XI 3.1, Back-end, SAP ECC 6.0, SAP BI 7.0
    2. Users log in through Info-View
    3. Only 2 types of reports after they log-in a) crystal based on ERP b) webi based on BWP
    4. BO is already mapped to ERP(R/3 production box), BWP(BW production box)
    5. SSO profile parameter on ERP & BWP are set. SSO works
    User Actions:
    1. Right now, user id & passwords are same in ERP & BWP
    2.. When users log into info-view using their login ERP credentials(user-id & password), then they can run crystal reports or webi reports, and since passwords are same in ERP & BWP, the SSO works seamlessly and world is perfect.
    However, here is the question:
    3. Down the lane, the passwords for the same user id between ERP and BWP are bound to differ for whatever reason
    4. How do we make sure that even if passwords are different between ERP and BWP, users will log into info-view with only ERP user-id&password, AND STILL RUN BOTH CRYSTAL AND WEBIs succesfully.
    PLEASE OFFER YOUR ADVICE. Is SNC the answer? If so, I read your blog on SNC, but it takls about Windows AD and all that. We aren't using Windows AD to log into info-view.
    Thanks a TON in advance
    Nishith

    Moving to the SAP Integration kit forum
    Regards,
    Tim

  • Ingo-Could you please read and help us. SNC question

    Hi Ingo,
    I am an avid reader of your blog, the new book and took your help in the past.
    Need your advice on the following scenario regarding..(I think SNC would solve this, but i need your advice)
    Scneario:
    1. Will be going live in couple of days with reporting solution. Environment: BO XI 3.1, Back-end, SAP ECC 6.0, SAP BI 7.0
    2. Users log in through Info-View
    3. Only 2 types of reports after they log-in a) crystal based on ERP b) webi based on BWP
    4. BO is already mapped to ERP(R/3 production box), BWP(BW production box)
    5. SSO profile parameter on ERP & BWP are set. SSO works
    User Actions:
    1. Right now, user id & passwords are same in ERP & BWP
    2.. When users log into info-view using their login ERP credentials(user-id & password), then they can run crystal reports or webi reports, and since passwords are same in ERP & BWP, the SSO works seamlessly and world is perfect.
    However, here is the question:
    3. Down the lane, the passwords for the same user id between ERP and BWP are bound to differ for whatever reason
    4. How do we make sure that even if passwords are different between ERP and BWP, users will log into info-view with only ERP user-id&password, AND STILL RUN BOTH CRYSTAL AND WEBIs succesfully.
    PLEASE OFFER YOUR ADVICE. Is SNC the answer? If so, I read your blog on SNC, but it takls about Windows AD and all that. We aren't using Windows AD to log into info-view.
    Thanks  a TON in advance
    Nishith
    Edited by: SAPBO786 on Sep 21, 2009 1:16 AM

    looks like a double entry.
    ingo

  • Non-functioning monitor, please read and help!

    Hello everyone!
    We have had wonderful function from our 24inch iMac for over 2 years now. We've never had a problem with it and it mostly functions for family entertainment. It is not overworked graphically besides some gaming.
    Anyways, usually the computer does stay on for extended periods of days, however it is always put into sleep mode at night. This morning when we go to wake it up, nothing happens. We can hear the computer working in the background, can turn volume up/down, eject disk, etc. We have not upgraded anything recently, added new applications, or changed/added hardware. Using a flashlight on the screen reveals no image at all, doesn't seem like just the backlight is out. I've tried manual restart, leave comp unplugged for an hour, reset pram/nvram, but nothing.
    By your expert opinion, where do we go from here? Is there something obvious we're missing, or is this the end of the road for the monitor? Thanks for your time!
    Message was edited by: John & Karen

    Hi, Welcome to the discussion area!
    If you have a 24" iMac you have an Intel-based iMac not an iMac G5. You really should post in the Intel-based iMac discussion area.

  • Everyone please read and help me with this...

    ok so about a year ago i installed iTunes on my computer and had a couple hundred songs downloaded. about half of them were bought out of iTunes. I had them all onto my iPod nano. Then a few weeks later my computer crashed. The hard drive "died" as you can call it. I have recently bought a new computer with Windows XP and we will soon be getting an upgrade to Vista.
    I have two questions...
    1). does anyone remember about the online live support we used to get from live apple representatives? it was instant messaging with the representatvies and they would help you with your problems. Does anyone know if that still exists? and if it does could you please give me a link to that site?
    2). Is there any possible way for me to take the songs i have on my iPod and put them into my new library?
    please everyone i need all the help i can get...ive lately been playing all my songs from a speaker system i bought that would connect with my iPod...i would like them to be on my computer...
      Windows XP  
      Windows XP  
      Windows XP  

    Copying from iPod to Computer threads...
    http://discussions.apple.com/thread.jspa?threadID=868833&tstart=0
    http://discussions.apple.com/thread.jspa?threadID=893334&tstart=0
    http://discussions.apple.com/thread.jspa?messageID=797432&#797432
    Also these useful internet articles...
    http://www.engadget.com/2004/11/02/how-to-get-music-off-your-ipod/
    http://playlistmag.com/help/2005/01/2waystreet/
    iPod: Frequently Asked Questions
    http://docs.info.apple.com/article.html?artnum=60920
    Patrick

  • ATTENTION. PLEASE READ AND BE SAFE!

    Hey everyone, iv just had a scam happen to me which by googling the name of the offender it turns out to be quite a common one. the scammer known as xxxxxxxxxxxx is now using the skype name xxxxxxx
    please avoid and be safe guys. skype i hope you find this rat xxxxxxx thats threatning to ruin peoples lives.
    i have blocked and reported the user i just hope the threats arent followed through with and that they just give up.

    Hello and thank you for reporting this information to us. As this is a public internet site we don't permit Skype names or actual names to be posted.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Multithreaded problem in read and write thread

    This is a producer consumer problem in a multi-threaded environment.
    Assume that i have multiple consumer (Multiple read threads) and a
    single producer(write thread).
    I have a common data structure (say an int variable), being read and written into.
    The write to the data sturcture happens occasionally (say at every 2 secs) but read happens contineously.
    Since the read operation is contineous and done by multiple threads, making the read method synchronized will add
    overhead(i.e read operation by one thread should not block the other read threads). But when ever write happens by
    the write thread, that time the read operations should not be allowed.
    Any ideas how to achive this ??

    If all you're doing is reading an int, then just use regular Java synchronization. You'll actually get a performance hit if you're doing simple read operations, as stated in the ReadWriteLock documentation:
    Whether or not a read-write lock will improve performance over the use of a mutual exclusion lock depends on the frequency that the data is read compared to being modified, the duration of the read and write operations, and the contention for the data - that is, the number of threads that will try to read or write the data at the same time. For example, a collection that is initially populated with data and thereafter infrequently modified, while being frequently searched (such as a directory of some kind) is an ideal candidate for the use of a read-write lock. However, if updates become frequent then the data spends most of its time being exclusively locked and there is little, if any increase in concurrency. Further, if the read operations are too short the overhead of the read-write lock implementation (which is inherently more complex than a mutual exclusion lock) can dominate the execution cost, particularly as many read-write lock implementations still serialize all threads through a small section of code. Ultimately, only profiling and measurement will establish whether the use of a read-write lock is suitable for your application.

  • Problems while reading and displaying .pdf-Documents from Bfile

    Hi
    I want to read and display .pdf-Documents in Adobe-Reader that are stored as BFile. While displaying the Document Adobe Reader is showing several Errors like " ..less Picture-Data read than expected.. ". Is this a Buffer-Problem? or whatelse ??
    Thanks for help
    null

    PrintStream wr = new PrintStream(socket.getOutputStream());
    wr.close();I suspect this is the problem. You could try socket.shutdownOutput() - or you could just leave the streams alone and let socket.close() shut things down.
    Grant

Maybe you are looking for

  • Calculating total working hours

    Hai Experts , i want to calculate the total working hours of every employee. my scenario is .. i am having a table zworkinghours the fields are SNO  -numc EMPID-int4--- employee id DATEE-dats--- date WHOURS-tims--- hours worked sample datas: (PK)SNO 

  • Lync 2010 server and UM role on different domains in different forests

    Hello  I have a Lync 2010 environment running on domain A, with exchange 2010 UM also running in Domain A.  We are in the process of migrating users and mailboxes from domain A to domain B.  Once we reach our enterprise voice users with exchange UM e

  • In single user mode is it possible to create a user

    in single user mode is it possible to create a user using the niutil command. if so, can the user be given admin status so that software can be added to the system. if it's possible could you post a link to how this is done or tell me if you have tim

  • Active tab stopped highlighting

    The active tab in my Firefox Window used to have a highlight. I changed some other appearance color features and the active tab highlight has dissappeared. I don't know how to get it back. And working without it is very difficult.

  • Changing Speed of Flash Parts

    I'm VERY new to flash programming. I downloaded a template and changed around some of the text to suit my needs. Some of the text sequences are too quick and I wanted to slow them down so that the end user can read them. I don't think there is an eas