Help -- Script timing out during http event listener

So, I have created an HTTPService to retrieve an XML file. The event listener is basically just parsing that XML file and doing another necessary calculation. Unfortunately, the script times out because while small in size, there's a lot of data in it.  I know there's a way to override this with the compiler, but this doesn't seem like a smart thing to do. What are other solutions?
I need the XML data to be loaded when the Flash player loads because it basically displays graph data that people need to be able to see as soon as the page finishes loading.
Thanks so much for you input. I didn't anticipate this timeout problem!

I changed my code to use the URLLoader(), not that it would resolve the problem, but maybe it's the preferred way to do this?
Project Overview (that's relevant):
The XML data is a bunch of numbers that I need to display on a graph as soon as the page is loaded. So, it must be parsed and obviously remapped to the height of the panel.
The mostly relevant code:
// openXML() is being called by my controller, which is called by my application's initialize
public function openXML():void {       
            var loader:URLLoader = new URLLoader();
            loader.addEventListener(Event.COMPLETE, loadXML);
            loader.load(new URLRequest(xmlURL));
private function loadXML(evt:Event):void {
            trace("start");
            var xml:XML = new XML(evt.target.data);
            // setup all <R> (Reading) tags as an xml list
            xmlList = xml.R;
            for (var i:int=0;i<xmlList.length();i++) {
                value[i]=xmlList.v[i];
            // each value will then need to be remapped to fit the panel
            // call the gsrController -- which will in turn draw all this stuff       
So the problem is, I'm new to Flex, and the lack of multithreading seems to be hurting me? I would LOVE for a way for the openXML() file to be able to return the xmlList so that I can take all of that logic OUT of that event listener, which is the way it should be. But how could I do that? I don't think that I can tell openXML() to wait on that event listener before it returns anything - haha.
When I was testing this stuff a few days ago, everything was working perfectly, it was when I used data that corresponded to 40 minutes worth of video that it became a problem!
(And to provide a better overview of what I'm doing, the XML data is for drawing this line that the video player ticker is syncing up with as the video plays......)

Similar Messages

  • "Device timed out" during sync

    I'm running Windows XP SP2, iTunes 7.5, and iPod software 1.1.2 and I keep getting this error message when trying to sync my new Touch. It worked fine on my old 3rd Gen iPod. I have USB 2.0 also. Anyone else getting the "Device timed out" during the sync process?

    I'm still having problems, I can't even update to 1.1.3 because of this problem. Most of the time I don't get any songs on there before it times out but some times two or three songs will go on and it will time out. This is really a problem, I have to go to a new computer just to try and restore because this one gets an error.
    Friday I am going to the genius bar, I am hoping they can work it out.

  • ORA-12535: TNS:operation timed out (during DBLINK testing)

    Hi,
    I have created a database link using the follwoing script :
    create database link UIIODS.WORLD
    connect to <user_id>
    identified by <pwd>
    using '(DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 147.147.3.41)(PORT = 1552))
    (CONNECT_DATA =
    (SERVICE_NAME = uiiods)
    But when I am executing the sql : select * from [email protected]
    it gives the error : ORA-12535: TNS:operation timed out.
    I am trying to create the database link from a 9.2.0.5 database server and sid of this service_name is R2SRVR5.world.
    Please find below TNS,sqlnet and listener entries of the server R2SRVR5.WORLD :
    R2SRVR5_DBSRC.WORLD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 157.227.6.39)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = R2SRVR5.WORLD)
    UIIODS.PROD =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 147.147.3.41)(PORT = 1552))
    (CONNECT_DATA =
    (SERVICE_NAME = uiiods)
    # SQLNET.ORA Network Configuration File: C:\oracle\ora92\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    # NAMES.DEFAULT_DOMAIN = tcskolkata.co.in
    SQLNET.AUTHENTICATION_SERVICES= (NONE)
    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
    # LISTENER.ORA Network Configuration File: C:\oracle\ora92\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = tcs061243)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\ora92)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = R2SRVR5.WORLD)
    (ORACLE_HOME = C:\oracle\ora92)
    (SID_NAME = R2SRVR5)
    (SID_DESC =
    (GLOBAL_DBNAME = dbsrc.world)
    (ORACLE_HOME = C:\oracle\ora92)
    (SID_NAME = dbsrc)
    (SID_DESC =
    (GLOBAL_DBNAME = NEWDBSRC.WORLD)
    (ORACLE_HOME = C:\oracle\ora92)
    (SID_NAME = NEWDBSRC)
    PING and TNSPING working fine,but DBLINK is not working.
    Please provide a solution.
    Thanks in Advance,
    Koushik

    Hi,
    Sorry for late response. Please find below the timing for TNSPING.
    C:\>ping 147.147.3.41
    Pinging 147.147.3.41 with 32 bytes of data:
    Reply from 147.147.3.41: bytes=32 time=246ms TTL=247
    Reply from 147.147.3.41: bytes=32 time=242ms TTL=247
    Reply from 147.147.3.41: bytes=32 time=237ms TTL=247
    Reply from 147.147.3.41: bytes=32 time=227ms TTL=247
    Ping statistics for 147.147.3.41:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 227ms, Maximum = 246ms, Average = 238ms
    C:\>tnsping 147.147.3.41
    TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 29-DEC-2005 15:03:49
    Copyright (c) 1997, 2003, Oracle. All rights reserved.
    Used parameter files:
    C:\Oracle10g_Home\network\admin\sqlnet.ora
    Used EZCONNECT adapter to resolve the alias
    Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=147.147.3.41))(ADDRESS=(PROTOCOL=TCP)(HOST=147.147.3.41)(PORT=1521)))
    OK (700 msec)
    C:\>tnsping uiiods.prod
    TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 29-DEC-2005 15:04:02
    Copyright (c) 1997, 2003, Oracle. All rights reserved.
    Used parameter files:
    C:\Oracle10g_Home\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 147.147.3.41)(PORT = 1552))) (CONNECT_DATA = (SERVICE_NAME = uiiods)))
    OK (580 msec)
    Please suggest any solution.
    Regards,
    Koushik

  • Io exception: Connection timed out during Active Sync

    I received this connection exception during an Active Sync Process.
    The exception caused the process to halt for 9 minutes - it then picked again and continued processing accounts.
    We are running IdM v5.0 SP6, Tomcat Application Server, and an Oracle 9 Repository.
    Any ideas?

    Hi,
    It seems the query is taking too long and eventually the connection to the database is timing out.
    I also believe that you are on the supported database configurations for WLS 10.0 MP1 :-
    Link:[http://edocs.bea.com/platform/suppconfigs/configs100/100_over/supported_db.html]
    You will also have to look in the weblogic server log for relevant errors like socket exceptions.
    Regards.

  • Timed out during Export of Transport Pack

    Hi all,
    While trying to add Objects into the transport package to be exported, we face a 500 connection timed out. Has anyone faced this issue? Could you pls share on how to resolve this? THanks!

    Did you check your security software settings? See this article: http://support.apple.com/kb/TS3125

  • Timed Out during sync.

    All too often when I am trying to sync/dowlnoad some music from my WIndows PC to my iPod Touch, I get an error message "Timed Out"; this sync could not be completed. This can happen within a few Seconds of the Sync starting, so I cannot have used excessive time. What it going on? What am I doing wrong? and how can I stop this happening?

    Did you check your security software settings? See this article: http://support.apple.com/kb/TS3125

  • Plsql script timing out...?

    I'm finding that when I run a script on a particular server it sometimes runs through all the way but if the time it takes is too long (say there are more than a certain number of records) it seems to hang. The limit seems to be about two hours. There is no error message, it just doesn't complete and the records don't seem to go. I am pretty confident this is not a bug in the script. Could it be timing out? Is there a server setting that would make this happen and if so can i find it out using sqlplus without being logged in as a sysadmin, so that at least I know what to ask the person who can make adjustments?

    As you don't say, what your script is doing, it is hard to say. But a wild guess would be, that you are modifying some data within this script and there are other transactions going on while the script is running. And by chance (the longer the script runs the bigger the chance), some records you are trying to modify in your script are already modifyed but not commited. So your session (i.e. script) is waiting until the other session issues a commit/rollback. And if the other transaction doesn't do a commit/rollback (he/she probably went for lunch) it seems your script is timing out.

  • Network connection timed out during iPhone4 update to ios 7.1.2 in iTunes on mac mini

    I've tried several times to update my iPhone 4 to the iOS 7.1.2 update using iTunes on my Mac mini.  Each time, after about an hour or two, I get the message that the network connection has timed out.  I don't have any security software installed, so that can't be the issue.  I have the most recent version of iTunes, so that can't be it either.  I can't update directly on my phone, because I don't have enough space left.  Any suggestions as to why the network is timing out??
    Thanks for anyone's help in advance.

    simple hold the power button and the home button for 15 seconds and release the home to the iphone to turn on.
    them try to connect to the computer in the itunes and when ask to update you choose to only download not update , when finish update the iphone .

  • Network connection timed out during update

    I have an iPod generation 4. Whenever I try to update to the latest iPod software and get an error message "Network connection timed out. Try again later." Any advice?
    Thanks.

    Disable your computer's security software during the update.

  • Why does my network keep timing out during the update?, Why does my network keep timing out during the update?

    I've been trying unsuccessfully for a week to update my iPad and my iPod but it keeps giving me an error message staing that the network timed out. Does anyone know how to fix it?

    The update is several hundred megs
    Which means it can't be done over 3G if you're trying it that way. And if your other internet connection isn't fast enough it will time out.
    People have also had issues with their firewalls or anti virus software....the software detects the update file as a virus or malware (incorrectly of course) and blocks it. So you can also try disabling your firewall or anti virus and give it a try and see if that helps.

  • Connection server timing out during software update?

    my itouch is stuck on version 2.2.1 and every time I try to update it to the newer versions, an error message pops up saying that the conncetion server timed out. my network connection is active, i can download apps and music and stuff i just cant get this software update for some reason, any ideas?

    I had little problem downloading the update for my iPad. However, it took about a day to download the the update for my iPod. It kept timing out.

  • My network connection timed out during home sharing??

    when transferring songs from another library on another computer my network connection times out?? help !!!!

    Disable your computer's security software during the update.

  • IPhone 4.0 update is "timing out" during download

    I'm trying to perform a 4.0 software update on my 3G and it's getting about 75% through it and a message comes up saying "error- a time-out has occurred- check your network settings and try again." It has happened at least twice and I am getting frustrated. Can anyone help?

    Sounds like you have a Windoze PC. If so, try temporarily disabling your antivirus, anti-adware, anti-spyware and any other anti-whatever that is required with that secure OS.

  • Commit timed out during oracle 2pc

    Hi, all
    I have a session bean with container managed transaction. In one of
    the business methods, I need to update tables from 2 different Orcale
    datasources. I am using the XA driver
    oracle.jdbc.xa.client.OracleXADataSource when setting up the 2
    connection pools. I have a log statement as the last line in my
    method. The message gets logged without any delay. However, control
    doesn't return from the method. And eventually, I get a timeout
    message.
    My guess is that the transaction manager has problem committing the
    changes. But I don't know how to resolve this issue. Can someone help?
    Thanks in advance.
    TS

    I suggest you try to start WL with debuffing turned on, that will give you a lot
    of messy debug output, but at least you be able to see how resources listed and
    delisted by transaction manager and how transaction started and commited.
    To turn debugging on add following parameter in WLS startup line:
    -Dweblogic.Debug=weblogic.JTAXA,weblogic.JDBCConn,weblogic.JTA2PC,weblogic.JTAJDBC
    Hope this helps.
    [email protected] (ts) wrote:
    Hi, all
    I have a session bean with container managed transaction. In one of
    the business methods, I need to update tables from 2 different Orcale
    datasources. I am using the XA driver
    oracle.jdbc.xa.client.OracleXADataSource when setting up the 2
    connection pools. I have a log statement as the last line in my
    method. The message gets logged without any delay. However, control
    doesn't return from the method. And eventually, I get a timeout
    message.
    My guess is that the transaction manager has problem committing the
    changes. But I don't know how to resolve this issue. Can someone help?
    Thanks in advance.
    TS

  • Help with event listener

    I'm having some trouble trying to figure out how this event listener will work.
    The main application is building an arrayCollection of a calendarDay custom components which is displayed by a DataGroup.
    Within each calendarDay custom component i may create an arrayList of a DriverDetailComponent custom components displayed within the calendarDay by a DataGroup.
    If a user double clicks on the DriverDetailComponent that is two layers in I would like to change states of the main application.  I'm having trouble figuring out what item in the main application to set the listener on.  Please help.
    I can't figure out how to post the below as scrollable code snips so this is very long.
    Main application code:
    <code><?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:components="components.*"
                   preinitialize="readDataFile()"
                   creationComplete="buildRowTitles()"
                   width="1024" height="512"  backgroundColor="#A4BDD8">
        <s:states>
            <s:State name="State1"/>
            <s:State name="driverDetailState"/>
        </s:states>
        <!--
        <fx:Style source="EventCalendar.css"/>
        creationComplete="readDataFile()"    creationComplete="driversList.send()"-->
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->       
            <mx:DateFormatter id="myDateFormatter"
                              formatString="EEE, MMM D, YYYY"/>
            <!--<s:HTTPService id="driversList"
                           url="files/drivers.xml"
                           result="driversList_resultHandler(event)"
                           fault="driversList_faultHandler(event)"/>
            <s:HTTPService id="postDriversList"
                           url="files/drivers.xml"
                           method="POST"
                           result="postDriversList_resultHandler(event)"
                />-->
            <!--<s:Move id="expandTab"
                    target="{labelTab}"
                    xBy="250"/>-->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import components.CalendarDay;
                import components.TruckDriver;
                import components.calendarDay;
                import events.CancelChangeDriversEvent;
                import events.ChangeDriversEvent;
                import events.EditDriverEvent;
                import mx.collections.ArrayCollection;
                import mx.collections.ArrayList;
                import mx.containers.Form;
                import mx.controls.Alert;
                import mx.controls.CalendarLayout;
                import mx.core.FlexGlobals;
                import mx.core.IVisualElement;
                import mx.core.WindowedApplication;
                import mx.printing.FlexPrintJob;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.rpc.xml.SimpleXMLEncoder;
                import spark.components.Application;
                import utilities.FormatUtil;
                import utilities.ObjectToXML;
                /* public var prefsFile:File; */ // The preferences prefsFile
                [Bindable] public var driversXML:XML; // The XML data
                public var stream:FileStream; // The FileStream object used to read and write prefsFile data.
                public var fileName:String="driversArrayCollection";
                public var directory:String = "AceTrackerData";
                public var dataFile:File = File.documentsDirectory.resolvePath(directory + "\\" + fileName);
                [Bindable]
                public var drivers:ArrayCollection=new ArrayCollection();
                private var fileStream:FileStream;
                [Bindable]
                public var calendarDayArray:ArrayCollection = new ArrayCollection;
                public var i:int;
                [Bindable]
                public var weekOneTitle:String;
                [Bindable]
                public var weekTwoTitle:String;
                [Bindable]
                public var weekThreeTitle:String;
                [Bindable]
                public var weekFourTitle:String;
                public var day:Object;
                protected function readDataFile():void
                    if(dataFile.exists)
                        fileStream = new FileStream();
                        fileStream.open(dataFile, FileMode.READ);
                        drivers = fileStream.readObject() as ArrayCollection;
                        fileStream.close();
                    else
                        drivers = new ArrayCollection();
                        var driver:TruckDriver = new TruckDriver("New", "Driver", 000);
                        drivers.addItem(driver);
                        saveData(drivers);
                    buildCalendarArray();
                protected function buildCalendarArray():void
                    calendarDayArray.removeAll();
                    for (i=0; i<28; i++)
                        var cd:calendarDay = new calendarDay;
                        cd.dateOffset= i-7
                        cd.drivers=drivers;
                         cd.addEventListener("editDriverEvent",editDriverEvent_Handler);
                        calendarDayArray.addItem(cd);
              private function saveData(obj:Object):void//this is called on the postDriversList result handler to create and write XML data to the file
                    var fs:FileStream = new FileStream();
                    fs.open(dataFile, FileMode.WRITE);
                    /* fs.writeUTFBytes(myXML); */
                    fs.writeObject(drivers);
                    fs.close();
                protected function driverschedule1_changeDriversHandler(event:ChangeDriversEvent):void
                    saveData(drivers); 
                    readDataFile();//i read the drivers file again, this refreshes my data, and removes any temporary data that may have been stored in the drivers array
                    buildCalendarArray();
                    currentState = 'State1';//this hides the driversdetail window after we've clicked save
                    /* postDriversList.send(event.driverInfo); */  //this needs to be different
                    /* Alert.show("TEST"); */
                protected function driverschedule1_cancelChangeDriversHandler(event:CancelChangeDriversEvent):void
                    /* Alert.show("Changes have been canceled."); */
                    readDataFile();//this re-reads the saved data file so that the changes that were made in the pop up window
                    // are no longer reflected if you reopen the window
                    buildCalendarArray();
                    currentState = 'State1';  //this hides the driversdetail window after we've clicked cancel
                protected function buildRowTitles():void
                    var calendarDay0:Object;
                    var calendarDay6:Object;
                    calendarDay0=calendarDayArray.getItemAt(0);
                    calendarDay6=calendarDayArray.getItemAt(6);
                    weekOneTitle = calendarDay0.getDayString() + " - " + calendarDay6.getDayString();
                    weekTwoTitle=calendarDayArray.getItemAt(7).getDayString()+ " - " + calendarDayArray.getItemAt(13).getDayString();
                    weekThreeTitle=calendarDayArray.getItemAt(14).getDayString()+ " - " + calendarDayArray.getItemAt(20).getDayString();
                    weekFourTitle=calendarDayArray.getItemAt(21).getDayString()+ " - " + calendarDayArray.getItemAt(27).getDayString();
            ]]>
        </fx:Script>
        <s:Group height="100%" width="100%">
            <s:layout>
                <s:BasicLayout/>  <!--This is the outermost layout for the main application MXML-->
            </s:layout>
        <s:Scroller width="95%" height="100%"  >
        <s:Group height="100%" width="100%"  ><!--this groups the vertically laid out row titles hoizontally with the large group of calendar days and day titles-->
            <s:layout>
                <s:HorizontalLayout/>
            </s:layout>
        <s:Group height="95%" width="50" ><!--this is the group of row titles layed out vertically-->
            <s:layout>
                <s:VerticalLayout paddingLeft="40" paddingTop="35"/>
            </s:layout>
            <s:Label text="{weekOneTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
            <s:Label text="{weekTwoTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center" />
            <s:Label text="{weekThreeTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
            <s:Label text="{weekFourTitle}"
                     rotation="-90"
                     backgroundColor="#989393"
                     height="25%" width="115"
                     fontWeight="normal" fontSize="15"
                     paddingTop="4" textAlign="center"  />
        </s:Group>
        <s:Group height="100%" width="100%" >
            <!--this vertically groups together the horizontal day names group and the tile layout datagroup of calendar days-->
            <s:layout>
                <s:VerticalLayout paddingLeft="5"/>
            </s:layout>
        <s:Group width="100%" >
            <s:layout><!--this group horizontal layout is for the Day names at the top-->
                <s:HorizontalLayout paddingTop="10"/>
            </s:layout>
            <s:Label id="dayNames" text="Sunday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Monday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Tuesday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Wednesday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Thursday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Friday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
            <s:Label text="Saturday" width="16%" fontWeight="bold" fontSize="18" textAlign="center"/>
        </s:Group>
            <!--<s:SkinnableContainer width="16%">-->
                <s:DataGroup id="calendarDataGroup"
                             dataProvider="{calendarDayArray}"
                             itemRenderer="{null}"  resizeMode="scale"
                              height="100%" width="100%"
                              >  <!--  I had to use a null renderer because otherwise each instance is added in a group container renderers.DriverScheduleRenderer-->
                    <s:layout >
                        <s:TileLayout requestedColumnCount="7" />
                    </s:layout>
                </s:DataGroup>
            <!--</s:SkinnableContainer>-->
        <!--<mx:FormItem label="Today's Date:">
            <s:TextInput id="dateToday"
                         text="{myDateFormatter.format(testDate)}"/>
        </mx:FormItem>-->
        <!--<components:DriverSchedule drivers="{drivers}"
                                   changeDriversEvent="driverschedule1_changeDriversHandler(event)"/>-->
            <s:HGroup>  <!--this groups together my drivers button and my print button at the bottom of the calendar-->
            <s:Button id="showDriverDetailButton"
                      label="Driver List"
                      click="currentState = 'driverDetailState'">
                <!--</s:Button>
                <s:Button id="printButton"
                    label="Print"
                    >  click="printButton_clickHandler(event)"-->
                </s:Button>
            </s:HGroup>    <!--this is the end of the small hgroup which pairs my drivers button with the print button-->                  
        </s:Group><!--this ends the vertical grouping of the day names and the tile layout calendar-->   
    </s:Group>        <!--this ends the horizontal grouping of the calendar (names and days) with the week labels at the left-->
        </s:Scroller>
            <s:SkinnableContainer includeIn="driverDetailState"
                                  width="95%" height="95%"  horizontalCenter="0" verticalCenter="0"
                                  backgroundColor="#989898" backgroundAlpha="0.51">
                <s:BorderContainer horizontalCenter="0" verticalCenter="0">
                <components:DriverSchedule id="driverSchedule"
                                            drivers="{drivers}"
                                           changeDriversEvent="driverschedule1_changeDriversHandler(event)"
                                           cancelChangeDriversEvent="driverschedule1_cancelChangeDriversHandler(event)"
                                           />
                </s:BorderContainer>
            </s:SkinnableContainer>
        </s:Group>  <!--end of basic layout group-->
    </s:WindowedApplication>
    </code>
    calendarDay.mxml code:
    <code>
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx"
             creationComplete="initDay()"
              width="100%">  <!--width="16%" height="25%"  width="160" height="112"-->
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <mx:DateFormatter id="myDateFormatter"
                              formatString="MMM D"/>
        </fx:Declarations>
        <fx:Metadata>
            [Event(name = "editDriverEvent", type="events.EditDriverEvent")]
        </fx:Metadata>
        <fx:Script>
            <![CDATA[
                import components.CalendarDay;
                import components.DriverDetailComponent;
                import events.EditDriverEvent;
                import mx.collections.ArrayCollection;
                import mx.collections.ArrayList;
                import mx.controls.CalendarLayout;
                import mx.controls.DateField;
                [Bindable]
                public var todayCollection:ArrayCollection = new ArrayCollection;
                [Bindable]
                public var todayList:ArrayList=new ArrayList; //arraylist created as data provider for dataGroup, this is where all drivers with an arrival date of today are added
                [Bindable]
                public var currDate:Date =new Date; //this will be used to contain the current real world date
                [Bindable]
                public var calDate:Date = new Date; //this is used below to determine the date of the calender day that is being created
                [Bindable] 
                public var todaysDate:CalendarDay;
                [Bindable]
                public var currDay:int;
                [Bindable]
                public var dateOffset:int;
                public var drivers:ArrayCollection= new ArrayCollection();
                   public var driver:Object;  
                public var rowLabel:String;
                public function initDay():void
                    todaysDate  = new CalendarDay(currDate, currDate.day, dateOffset)//currDate represents the day the operating system says today is
                        currDay=todaysDate.returnDate().getDate();//currDay is an int representing the day of the month
                        calDate=todaysDate.returnDate();//calDate represents the actual date on the calendar (MM-DD-YYY) that is currently being evaluated
                        /* if (currDay ==currDate.getDate()) //i want to highlight the day if it is in fact today
                            cont.styleName="Today";
                            if (calDate.getDate() == currDate.getDate())
                            calDayBorder.setStyle("backgroundColor", "#FFFF00");
                        else
                            calDayBorder.setStyle("backgroundColor", "#EEEEEE");
                         addDrivers(); 
                    return;
                  public function addDrivers():void
                       var count:int = 0;
                      /*var driverDetail:DriverDetailComponent;
                      var driver =  */
                    for each (driver in drivers)
                    {//i check the date value based on data entry of mm-dd-yy format against the calculated date for the day
                        //the calender is building and if it is equal the drivers information is added to this day of the calendar
                        if (DateField.stringToDate(driver.arrivalDate,"MM/DD/YYYY").getDate() == calDate.getDate())
                                var driverDetail:DriverDetailComponent = new DriverDetailComponent; //i create a new visual component that adds the id and destination to the calendar day
                                driverDetail.driverid = drivers[count].id; //i feed the id property which is the truck# - firstName
                                driverDetail.driverToLoc=drivers[count].toLoc; //i feed the toLoc which is the current destination of the driver
                                driverDetail.driverArrayLocation=count;   //here i feed the location of this driver in the "drivers" array so i know where it's at for the click listener
                                todayList.addItem(driverDetail);
                            //this concatenates the drivers truck number first name and destination to display in the calendar day
                                /* todayList.addItem(driver.truckNumber + " - " + driver.firstName + " - " + driver.toLoc); */
                    count ++;
                public function getDayString():String
                    rowLabel =myDateFormatter.format(calDate);
                    return rowLabel;
            ]]>
        </fx:Script>
        <s:BorderContainer id="calDayBorder" width="160" styleName="Today" cornerRadius="2" dropShadowVisible="true" height="100%">
            <s:layout>
                <s:BasicLayout/>   
            </s:layout>
            <!--I need to make a custom item renderer for my calendar days that limits the height and width of the day, and also puts the items
            closer together so i can fit maybe 5 drivers on a single day-->
            <s:DataGroup dataProvider="{todayList}"
                         itemRenderer="spark.skins.spark.DefaultComplexItemRenderer"
                         bottom="-2"
                         width="115" left="2">  <!--width="94%"  width="100"  width="16%"-->
                <s:layout >
                    <s:VerticalLayout gap="-4"/> <!--The reduced gap pushes the drivers together if there are serveral on one day. This helps cleanly show several drivers on one day-->
                </s:layout>
            </s:DataGroup >
            <s:Label  text="{currDay}" right="3" top="2" fontSize="14" fontWeight="bold"/>
        </s:BorderContainer>
    </s:Group>
    </code>
    DriverDetailComponent code:
    <code><?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
             xmlns:s="library://ns.adobe.com/flex/spark"
             xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Metadata>
            [Event(name = "editDriverEvent", type="events.EditDriverEvent")]
        </fx:Metadata>
        <fx:Script>
            <![CDATA[
                import events.EditDriverEvent;
                import mx.controls.Alert;
                [Bindable]
                public var driverid:String;
                [Bindable]
                public var driverArrayLocation:int;
                [Bindable]
                public var driverToLoc:String;
                protected function label1_doubleClickHandler(event:MouseEvent):void
                    Alert.show("You have selected " +driverid +" at location "  + driverArrayLocation.toString() +" in the drivers ArrayCollection.");
                    var eventObject:EditDriverEvent = new EditDriverEvent("editDriverEvent",driverArrayLocation);
                    dispatchEvent(eventObject);
            ]]>
        </fx:Script>
        <s:Label id="driverDetailLabel" text="{driverid} - {driverToLoc}"  doubleClick="label1_doubleClickHandler(event)" doubleClickEnabled="true"/>
    </s:Group>
    </code>

    lkb3 wrote:
    I'm trying to add a listener to [this JOptionPane pane dialog box|http://beidlers.net/photos/d/516-1/search_screenshot.JPG|my dialog box], so that when it pops up, the cursor is in the text box, but then if the user clicks a button other than the default, the cursor reverts back into the text box.
    The code I have is this:
      // BUILD DIALOG BOX
    JLabel option_label = new JLabel("Select a search option:");
    // Create the button objects
    JRadioButton b1 = new JRadioButton("Search PARTS by name");
    JRadioButton b2 = new JRadioButton("Search ASSEMBLIES by name");
    JRadioButton b3 = new JRadioButton("Search DRAWINGS by name");
    JRadioButton b4 = new JRadioButton("Search all by DESCRIPTION");
    b1.setSelected(true);
    // Tie them together in a group
    ButtonGroup group = new ButtonGroup();
    group.add(b1);
    group.add(b2);
    group.add(b3);
    group.add(b4);
    // Add them to a panel stacking vertically
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
    panel.add(b1);
    panel.add(b2);
    panel.add(b3);
    panel.add(b4);
    JLabel name_label = new JLabel("Enter a search term (add *'s as required)");
    JTextField name = new JTextField(30);
    name.addComponentListener(new ComponentListener() {
    public void componentHidden(ComponentEvent ce) { }
    public void componentMoved(ComponentEvent ce) { }
    public void componentResized(ComponentEvent ce) {
    ce.getComponent().requestFocus();
    public void componentShown(ComponentEvent ce) { }
    Object[] array = { option_label, panel, name_label, name };
    // GET INPUT FROM USER
    int res = JOptionPane.showConfirmDialog(null, array, "Select", JOptionPane.OK_CANCEL_OPTION);
    String searchTerm = name.getText();This sucessfully has the focus in the text box when opened; is there a way to get the focus to go back into the text box after the user clicks a radio button?
    Thanks!
    [this JOptionPane pane dialog box|http://beidlers.net/photos/d/516-1/search_screenshot.JPG|dialog Joption]
    you will need to add ItemListener to the JRadioButtons

Maybe you are looking for

  • [MSI PRO MOD] IRON MAIDEN bY Mario Viana (2XHAF XB)

    [MSI PRO MOD] IRON MAIDEN bY Mario Viana (2XHAF XB) DESIGN: Iron Maiden: COOLER MASTER HAF XB DUAL "Modder MVIANA" I apologize for the photos, they are mobile and also do not dominate the English The hardware is not as current, however still gives a

  • Help! I need to transfer everything!!

    I need to transfer everything from a ibook G4 to my Pro. Both have the most recent updates and same version OS. I need to get my office programs, all of my itunes account, pics, and other stuff from the ibook to the pro. I only have one OS disk that

  • How to send emails using Automatic Work Items in Collections using XML Publ

    Hi, We are using XML Publisher to send correspondances in Advanced Collections. We want to send email correspondances using Automatic Strategy Work Items. Can anybody please help on how to send these?

  • Iphoto needs aperture update (I dont have aperture)

    Today I went to open iPhoto, and it says "To open this Aperture Library in iPhoto, you need Aperture 3.3 or later" The only thing is I don't have aperture, nor do I recall ever installing it in the past. I tried holding down command/option to reconfi

  • Transform a Word document into a RoboHelp7 project

    Hi all, One question: Is it possible to transform a Word document into a RoboHelp7 project besides copy and paste from the document into the project? Thank you