Event Listening across two components?

Let's say I have two components. One of them has a button.
The other will post an Alert once it detects that the button has
been pressed.
How can the Alert component detect the button press of the
other component? I figured an eventListener would been needed, but
I am not sure how to write it.

Something like that might work, but from a programming
standpoint, your components should be designed in such a way that
they know absolutely nothing about the outside world (parent or
other components). For all it knows, it's the only component in
existence. But, using events, he could send out a message (event),
that if someone else (another component) happened to hear it, they
could do something in response to it. Think of the movie "Contact"
(if you've ever seen it).
Anyway, your best bet is to make a custom event that is able
to encapsulate an ArrayCollection. Then when the button is clicked,
you wrap up the AC in the event and send it out. Your other
component will be listening for events that are of that type (your
custom event). Then he can unwrap the AC in it and use it. If you
do not know how to create custom events and/or send data in events,
look up a tutorial on it. It's not that difficult to implement if
you can follow the concept I just talked about. However, I've also
personally tried to make a custom event to pass an ArrayCollection,
and for some reason it never worked (even though I followed some
tutorials down to the letter).

Similar Messages

  • Syncing iCal to 5G Ipod -- All Day Events appear across 2 days

    When I synchronize my iCal calendars to my 5G iPod, the all day events span across two days in the iPod calendar only. Is there a setting somewhere that gives the iPod calendar the ability to recognize the all day events instead of having them span 24 hours (7am to 7am the following day).
      Mac OS X (10.4.8)   MacBook Pro 15in 2.33 GHz Intel Core 2 Duo

    This appeared to be a timezone issue, when daylight savings time came around the iPod and iCal dates synchronized correctly.

  • Can event listeners be listened to by components which they are registed on

    Is it possible to have an event listener being listened to by the component on which it has registered interest to listen for changes. I am linking a database to a GUI and i have indicated that the GUI listens for changes to the database, but can the database also listen for changes to the GUI without having to make the database register interest in listening to changes to the GUI.

    The changes you wish to dected within the GUI must be listened to. Not neccesarily by the database. Changes to the database can be made by the listener that is registered on the GUI. What GUI changes are you trying to respond to?

  • How can I check if a function is or is not called from the event listener? in Flash CS4 (AS3)

    Hi,
    I came across a little problem.
    I put an event listener inside a for loop and the for loop inside a function.
    I want the for loop to end as soon as the event listener inside the for loop calls its function.
    Here is the general code for a better picture.
    Code:
    this.addEventListener(Event.ENTER_FRAME, function#1);
    function function#1(event:Event):void{
              if(something is true){
                        for(var i = 0; i < numOfmy_mcs; i++){
                                  this["my_mc_"+String(i)].addEventListener(MouseEvent.CLICK, function#2);
    function function#2(e:Event):void{
    //do something cool here
    Thank you for any help!

    kglad wrote:
    that for-loop (if it executes), defines listeners for interactive objects.  that will complete long before any object is clicked.
    Well yes but it does it again and again (frames per second times seconds = number of times it goes through the code if i'm not mistaken), because it is inside a function, and through testing i found out that it works like this:
    Example:
    there are 5 my_mc's in my project: (my_mc_0, my_mc_1, my_mc_2, my_mc_3, my_mc_4)
    if i click my_mc_0 function#2 is called and executed. BUT only after the loop finishes (i know this from tons of testing)...which is unnecessary since you cannot click two places at once. This might not be a problem in this example because i am only using 5 my_mc's buy if i use 500000000 my_mc's it would make a lot of difference.
    is there a way to stop the loop if the function is called?
    ...maybe there is a better way to write it, the only alternative i know that works is if i manually write every single listener and this also is logical in this example but as i said next to impossible if the numbers get bigger.
    -Note
    I didn't specify this earlier but function#2 makes the if statement false so it wont jump back into it.
    Thank you for the help I really appreciate it!
    3rd edit...don't know what's wrong with me

  • 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

  • Commmunication Between two Components

    Hi ,
    I am developing a project of having two components in it.  I want to communicate each component with other one. Both components should be communicating with each other.
    I am able to communicate from Component one to Component two . But !  unable to do the same from Component Two to Component one.  It shows the following error.
    Component ComponentOne: Cycle in component usage definitions: ComponentTwo
    Regards,
    Jyothi.

    Hallo Jyothi,
    Parent2Child-component-communication: apply interface method invocation (parent component with component usage relation to child component invokes interface controller method of child component --> IExternal-API)
    Child2Parent-component-communication: apply interface eventing (child component exposes interface controller event, child component defines NO cyclic component usage dependency to parent component, parent component subscribes own event handler to event of child component's interface controller, child component fires interface controller event at runtime and can also pass object references as event parameters).
    For data transfer across component borders apply interface-context-mapping
    1) exernal context mapping: data context in parent component, child component externally maps its interface context to it.
    2) interface context mapping: data context in child component, parent component maps own context to interface context of used child component.
    Regards, Bertram

  • All day events sync as two day events on iPhone (using MobileMe)

    After starting to use MobileMe to sync calendars and contacts, I've started to have an issue with events that are marked "all day". As far as I can tell, regular timed events seem to sync correctly, but my "all day" events get put on the iPhone as two day events. I thought it might be a DST issue, but when I look at the details of the event it looks as though it's actually changing it to a two day event.
    For example, someone's birthday in iCal desktop app will have the details:
    all day
    from: July 3
    to: July 3
    But on my iPhone it gets synced as:
    all day
    from: July 3
    to: July 4
    What makes this even more weird, is that when I log onto me.com, and look at the iCal web app, my "all day" events are all one day early. For the examply above, the event will appear on July 2.
    This has really got me puzzled...anyone have any ideas?
    Thanks,
    Kenton

    Same issue with me almost exactly...but the all-day events on MobileMe and on my laptop iCal are actually on the correct day rather than the day earlier as you describe. Only the iPhone is out of whack compared to MobileMe and iCal.
    I tried syncing with iTunes and when that didn't display my all-day events correctly, I sync'd over the air by turning on MobileMe Calendar push. Both ended up with many all-day events spanning 2 consecutive days. However, not all the all-day events were incorrect, but several were. I haven't been able to establish a pattern.
    I am using an iPhone 8G 3G, my G4 Powerbook 12" running 10.4.11, and a MobileMe account.
    I spent a hour or two on the Apple site speaking with tech support over live internet chat. I was told there were lots and lots of sync issues going on and the tech was unable to solve my issue. He mentioned casually that many of the sync problems were occurring on systems running 10.4.11.
    It would be encouraging to learn if this bug that puts all-day events across two consecutive days only on the iPhone (but not on MobileMe or iCal application) is happening to others out there.
    Any others out there?

  • Creating a singleton Event Listener class

    A typical singleton OO design pattern involved a protected (or private)
    no-arg
    constructor and a public instance() method that manages a private static
    variable
    referencing the single instance, internally invoking the no-arg constructor.
    A class designated in web.xml as a <listener> must have a public no-arg
    constructor.
    (from http://e-docs.bea.com/wls/docs61/webapp/app_events.html#178593)
    Anyone thoughts on how to accomplish both goals?
    What I want to do: I'd like to set up a singleton to listen for session
    events.
    Other code will query this one-and-only-one session event listener for
    various
    information. Some of this info I can currently get from the runtime via
    MBeans but
    some I can't, hence my investigation into session event listeners.
    TIA, matt.

    Hi Matt,
    This sounds like a case where you will need to have two classes -- your
    singleton class, and then your session event listener class, which would use
    the singleton class.
    Dennis Munsie
    Developer Relations Engineer
    BEA Support
    "Matt Hembree" <[email protected]> wrote in message
    news:[email protected]..
    A typical singleton OO design pattern involved a protected (or private)
    no-arg
    constructor and a public instance() method that manages a private static
    variable
    referencing the single instance, internally invoking the no-argconstructor.
    >
    A class designated in web.xml as a <listener> must have a public no-arg
    constructor.
    (from http://e-docs.bea.com/wls/docs61/webapp/app_events.html#178593)
    Anyone thoughts on how to accomplish both goals?

  • Removing a Button Event Listener on a Specific Frame and Reactivating it on Next Frame

    Hi , i am trying to develop a Slideshow where Next Button needs to behave in a certain way on a specific Frame , lets say a Specific Condition is met only then Next Button would work , I have been able to achieve that but problem is the Button Retains its Event Listener even on the next Frame , whereas  i have already included removeEventListener on the next frame with a new Function for the button , but its doesnt take it like that.
    Can anyone help please ?

    Hello Ned,
    I have fixed the issue with few Frame , but where we have the conditions to be met on two consecutive frames , I am not able to achieve that.
    here is the Code on my first Frame.
    FRAME1
    stop();
    slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
    mc_prog.width = 0;
    //LIBRARIES TO BE IMPORTED ///////////////////////////////////////////////////////////
    import flash.events.MouseEvent;
    //VARIALBLES INITIATED
    var score:Number = 0;
    var questions:Number = 0;
    var qtotal:Number = 11;
    var attempt:Number = 0;
    var indexframe:int;
    indexframe = this.totalFrames - 1;
    var notes:Array = new Array();
    var count:int;
    count = 0;
    var backcounter:int;
    backcounter = 0;
    var count2:int;
    count2 = 0;
    var backcounter2:int;
    backcounter2 = 0;
    var count3:int;
    count3 = 0;
    var backcounter3:int;
    backcounter3 = 0;
    // MOVIE CLIPS INITITATED ////////////////////////////////////////////////////////////////
    var volbutton1:volcontrol;//VOLUME BUTTON ROLLOVER MOVIE CLIP
    volbutton1 = new volcontrol();
    var clist:courselist;//VOLUME COURSE LIST ROLLOVER MOVIE CLIP
    clist = new courselist();
    var pop1:Mc_slide9 = new Mc_slide9;
    pop1 = new Mc_slide9;
    var pop2:Mc_slide13 = new Mc_slide13;
    pop2 = new Mc_slide13;
    var pop3:Mc_slide17 = new Mc_slide17;
    pop3 = new Mc_slide17;
    //BUTTONS INITIATED
    btn_nxt.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame);//NEXT SLIDE BUTTON
    btn_bck.addEventListener(MouseEvent.CLICK, backbtn);//BACK BUTTON
    btn_loc.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage); //LIST OF COURSES BUTTON
    btn_notice1.addEventListener(MouseEvent.CLICK, loadnotice1);
    pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
    btn_notice2.addEventListener(MouseEvent.CLICK, loadnotice2);
    pop2.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn2);
    btn_notice3.addEventListener(MouseEvent.CLICK, loadnotice3);
    pop3.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn3);
    //VOLUME BUTTON ROLL OVER FUNCTION EVENT LISTENERS ///////////////////////////////////////
    btn_vol.addEventListener(MouseEvent.ROLL_OVER,vol);
    btn_vol.addEventListener(MouseEvent.ROLL_OUT,volout);
    btn_loc.addEventListener(MouseEvent.ROLL_OVER,coursel);
    btn_loc.addEventListener(MouseEvent.ROLL_OUT,corlist);
    // FUNCTIONS INITIATED /////////////////////////////////////////////////////////////////
    function fl_ClickToGoToNextFrame(event: MouseEvent): void
      nextFrame();
    function backbtn(event:MouseEvent):void{
       prevFrame();
    function fl_ClickToGoToWebPage(event: MouseEvent): void {
      navigateToURL(new URLRequest("https://www.onlineinduction.com/fmgl/courselist.php?ist=2&type=Vendor Employee Inductions"), "_self");
    //VOLUME BUTTON ROLLOVER EFFECT FUNCTION
    function vol(e:MouseEvent):void
      addChild(volbutton1);
      //popup_instance.width = 675;
      //popup_instance.height = 300;
       if(this.currentFrame == 2)
        volbutton1.x = 150;
        volbutton1.y = 528;
       else{
        volbutton1.x = 278;
        volbutton1.y = 528;
      function volout (e:MouseEvent):void {
        removeChild(volbutton1);
       function coursel(e:MouseEvent):void {
       addChild(clist);
        if(this.currentFrame == 2)
         clist.x = 85;
         clist.y = 532;
        else if(this.currentFrame == 5){
         clist.x = 115;
         clist.y = 325;
        else{
         clist.x = 175;
         clist.y = 532;
      function corlist (e:MouseEvent):void {
        removeChild(clist);
    function loadnotice1(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
      if ( count == 1 && stage.contains(pop1))
       removeChild(pop1);
        if(count == 1)
         nextFrame();
        else
         addChild(pop1);
         pop1.x = 40;
         pop1.y = 120;
         count = 1;
      trace("Counter Value:" + count);
    function loadnotice2(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
      if ( count2 == 1 && stage.contains(pop2))
       removeChild(pop2);
        if(count == 2)
         nextFrame();
        else
         addChild(pop2);
         pop2.x = 40;
         pop2.y = 120;
         count2 = 1;
      trace("Counter Value:" + count);
    function loadnotice3(Event:MouseEvent):void//FRAME 9 FUNCTION FOR IMPORTANT NOTICE
      if ( count3 == 1 && stage.contains(pop3))
       removeChild(pop3);
        if(count == 3)
         nextFrame();
        else
         addChild(pop3);
         pop2.x = 40;
         pop2.y = 120;
         count2 = 1;
      trace("Counter Value:" + count);
    function nextframe9(event: MouseEvent): void
        if(count == 1 && stage.contains(pop1) )
           removeChild(pop1);
        if(count == 1)
         nextFrame();
        else
         addChild(pop1);
         pop1.x = 40;
         pop1.y = 120;
         count = 1;
    function nextframe13(event: MouseEvent): void
        if(count2 == 1 && stage.contains(pop2) )
           removeChild(pop2);
        if(count2 == 1)
         nextFrame();
        else
         addChild(pop2);
         pop2.x = 40;
         pop2.y = 120;
         count2 = 1;
    function nextframe17(event: MouseEvent): void
        if(count3 == 1 && stage.contains(pop3) )
           removeChild(pop3);
        if(count3 == 1)
         nextFrame();
        else
         addChild(pop3);
         pop3.x = 40;
         pop3.y = 120;
         count3 = 1;
    function backbtnscript1(event:MouseEvent):void
       if(stage.contains(pop1) )
          removeChild(pop1);
          backcounter = 1;
          trace("back" + backcounter);
          prevFrame();
    function unloadbtn1 (e:MouseEvent):void {
      removeChild(pop1);
    function backbtnscript2(event:MouseEvent):void
       if(stage.contains(pop2) )
          removeChild(pop2);
          backcounter2 = 1;
          trace("back" + backcounter2);
          prevFrame();
    function unloadbtn2 (e:MouseEvent):void {
      removeChild(pop2);
    function backbtnscript3(event:MouseEvent):void
       if(stage.contains(pop3) )
          removeChild(pop3);
          backcounter3 = 1;
          trace("back" + backcounter3);
          prevFrame();
    function unloadbtn3 (e:MouseEvent):void {
      removeChild(pop3);
    //SLIDE COUNTER
    and here is the Code on all the Frames where I need to call in specific Listeners
    FOR EXAMPLE ON FRAME 8,9,10,
    Here Is the Code ,
    FRAME 8
    stop();
    slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
    count = 0;
    backcounter = 0;
    btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
    btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
    btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
    btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
    pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
    //btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
    FRAME 9
    stop();
    slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
    //POPUP FUNCTION
    count = 0;
    btn_nxt.removeEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
    btn_bck.removeEventListener(MouseEvent.CLICK, backbtn);
    btn_bck.addEventListener(MouseEvent.CLICK , backbtnscript1);
    btn_nxt.addEventListener(MouseEvent.CLICK , nextframe9);
    btn_notice1.addEventListener(MouseEvent.CLICK , loadnotice1);
    FRAME 10
    stop();
    slidecounter.text = String(this.currentFrame - 1 + "/" + indexframe);
    count = 0;
    backcounter = 0;
    btn_nxt.addEventListener(MouseEvent.CLICK , fl_ClickToGoToNextFrame);
    btn_bck.addEventListener(MouseEvent.CLICK, backbtn);
    btn_bck.removeEventListener(MouseEvent.CLICK , backbtnscript1);
    btn_nxt.removeEventListener(MouseEvent.CLICK , nextframe9);
    pop1.closebtn.addEventListener(MouseEvent.CLICK, unloadbtn1);
    I am repeating this Pattern on each frame set where I need these Listeners ,
    Problem is with the next one where I have two consecutive frames have different conditions to meet, any ideas how would I disable and enable listeners respectively on these frames ?
    I hope I am not confusing this very much ?;(

  • Best design of event listener

    I'm working on a large project and having a problem about writing an event listener in my application. There are so many swing components and writing an event listener for each component is time consume. So I'm planning to write an adapter class for all or most of my swing components and I need suggestion.
    Is there anyone who use to do this before and how or there are an alternate way to solve this problem.
    I'm also using object manager. please see http://forum.java.sun.com/thread.jsp?forum=425&thread=373030&tstart=15&trange=15
    Thank in advance.

    There are so many swing components and writing an
    event listener for each component is time consume. So
    I'm planning to write an adapter class for all or most
    of my swing components and I need suggestion.Do you really need to handle events from all of your components? Do you do different things depending on the component?
    If yes, then you'll need to write code to do those different things, and wrapping that code in an ActionListener really isn't much more work. If you find that you're repeating a lot of code (for example, to retrieve state from the application before doing whatever the event does), then use abstract classes to handle the boilerplate.
    One approach that I use is to have a MenuHandler class, that contains abstract classes for boilerplate and a lot of static inner classes that do the actual work (or tie to an Operations class that does the actual work). This minimizes the number of sourcefiles, which is my big problem with separate listenerers (note that this doesn't change the number of class files, just the number of source files).

  • Event dispatching to swing components

    Hi,
    I'm implementing an extension of JTextPane, and I would like to make it as much reusable as possible.
    In order to do this, the class don't have to know about the external world (components)..
    The class should notify events (e.g. an event could be that a specific string has been typed..) to the other components just sending a message (or event), and all the components registered to that specific event implement their behavior to react to it.. quite simple..
    which is the simplest solution in Java to do this?
    thanks in advance..

    You should implement event dispatching based on the listener model, for consistency. Since you are extending JTextPane, a lot of the event dispatching code is written for you. Look up JTextPane in the javadocs and check out all the classes it is derived from. To take advantage of the already written listener code, simply call the appropriate fireWhateverEvent method whenever something happens. That will cause the event to be dispatched to all listeners registered with that component. If you want to define some new events that aren't covered by any of the listener methods in any of the classes your new class is derived from, here's the general way to do it:
    1) Define a new listener interface that implements the EventListener interface (which contains no methods).
    2) In your new listener interface, include methods for specific events, such as keyPressed, actionPerformed, textTyped, etc...
    3) Each of these methods should take a single parameter describing the event. This parameter should be a class that extends EventObject and that contains data relevant to your event. For example, you may define a TextEvent class that extends EventObject. The only methods EventObject has is getSource() and toString(). You won't really need to override these as long as you call the EventObject(Object) constructor from your TextEvent constructors.
    4) In your JTextPane derived class, define methods that can add, remove, and get a list of all registered event listeners for your event (ex: void addTextListener(TextListener t), void removeTextListener(TextListener t), TextListener[] getTextListeners()).
    5) add*Listener should add the listener to an internal list of listeners (a LinkedList or a Vector are good ways to store the registered listener lists). remove*Listener should remove the listener from the list, and get*Listeners should return the list in array form.
    6) For ease-of-use, define a fire method like fireTextListener(params), which creates a new TextEvent (assuming you're doing the TextListener thing) holding the specified event data and iterates through the internal list of listeners, calling the appropriate method in each one and passing your TextEvent to it.
    7) Call your fire*Event functions wherever appropriate to fire events.
    It's simpler than it sounds. Here's a small example:
    // TextListener.java
    public class TextListener implements EventListener {
        public void textInserted (TextEvent e);
        public void textDeleted  (TextEvent e);
    // TextEvent.java
    public class TextEvent extends EventObject {
        protected int    pos0;
        protected int    pos1;
        protected String text;
        public TextEvent (Object source, int pos0, int pos1, String text) {
            super(source);
            this.pos0 = pos0;
            this.pos1 = pos1;
            this.text = (text != null) ? text : "";
        public TextEvent (Object source, int pos0, int pos1) {
            this(source, pos0, pos1, null);
        public int getPos0 () {
            return pos0;
        public int getPos1 () {
            return pos1;
        public String getText () {
            return text;
    // MyTextPane.java
    public class MyTextPane extends JTextPane {
        LinkedList textListeners = new LinkedList();
        // This is just some method you defined, can be anything.
        public void someMethodThatInsertsText () {
            fireTextInserted(pos0, pos1, textInserted);
        // Same with this, this can be anything.
        public void someOtherMethodThatDeletesText () {
            fireTextDeleted(pos0, pos1);
        public void addTextListener (TextListener t) {
            textListeners.add(t);
        public void removeTextListener (TextListener t) {
            textListeners.remove(t);
        public TextListener[] getTextListeners () {
            TextListener ts = new TextListener[textListeners.size()];
            Iterator     i;
            int          j;
            // Don't think toArray works good because I'm 99% sure you'll
            // have trouble casting an Object[] to a TextListener[].
            for (j = 0, i = textListeners.iterator(); i.hasNext(); j ++)
                ts[j] = (TextListener)i.next();
        protected fireTextInserted (int pos0, int pos1, String text) {
            TextEvent e = new TextEvent(this, pos0, pos1, text);
            Iterator  i = textListeners.iterator();
            while (i.hasNext())
                ((TextListener)i.next()).textInserted(e);
        protected void fireTextDeleted (int pos0, int pos1) {
            TextEvent e = new TextEvent(this, pos0, pos1);
            Iterator  i = textListeners.iterator();
            while (i.hasNext())
                ((TextListener)i.next()).textDeleted(e);
    };There. I just typed that there, didn't test or compile it, but you get the gist of it. Then, like you do with any listener stuff, when you want to set up a listener and register it with a MyTextPane instance, just create some class that extends TextListener and overrides textInserted and textDeleted to do whatever your application needs to do.
    Hope that makes sense.
    Jason

  • Please Help, Event Listener Not Listening

        Hey, I am stuck trying to use some code I have used in the past to pass args through an event listener. I must find a way to do this
        This is what I am doing, using an inline function. I dont completely understand how it all works, but know that in one open FLA it works and in the other it does not. The error thrown is #1178: Attempted access of inaccessible property spotlightBox through a reference with static type..." SpotlightBox is the name of the function I'm trying to pass data to.
       The main difference in the two FLA's is that, in the broken one, it's constructed inside a for loop. But not sure how that is a problem. If you have some guidance I would greatly appreciate it. My work deadline is in tomorrow and I am stuck.
       This is being used inside a with block for each sprite:
    addEventListener(MouseEvent.ROLL_OVER, function onRoll_Over(e:Event) { spotlightBox(e, new Array("5"))});
         And here is the function:
    function spotlightBox(e:Event, arg:Array):void
       trace(arg[0]);

    use:
    addEventListener(MouseEvent.ROLL_OVER, function(e:Event) { spotlightBox(e, new Array("5"))});
    function spotlightBox(e:Event, arg:Array):void
       trace(arg[0]);
    but your main problem is using a with() statement to add listeners.  that's probably not going to work.

  • Actionscript 3 - Multiple variables for event listener.

    Ok, I have a question (of course that is the reason why I am here).  I have been focusing on PHP a lot lately and just had a client that requires an MP3 player playing multiple songs so I had to whip out my rusty actionscript skills.  I have the player completed and it is working as desired.  The down side is it has multiple songs.  I am using separate functions for each song and separate event listeners.  My main question is there a way to combine these funtions into one and just use the event listener to pass another variable to the functions?  Below is a sample of one of the code for Song1.  I would like to make it so anywhere there is Song1 in the code, I can make it a variable so I can put in for example (Song2, Song3, Song4, etc.)  This way, I can have one or two functions handle all the songs instead of having to copy, paste and then find and replace.
    Thanks for the help!
    // Song 1
    var Song1:Sound = new Sound();
    pbSong1.source = Song1;
    //pbSong1.visible = false;
    var Song1Loaded:Boolean = false;
    pbSong1.addEventListener(Event.COMPLETE, Song1LoadComplete);
    btnSong1Play.addEventListener(MouseEvent.CLICK, Song1Play);
    btnSong1Stop.addEventListener(MouseEvent.CLICK, Stop);
    function Song1Play(event:MouseEvent) {
         if (Song1Loaded == true) {
              sndchnlMain.stop();
              sndchnlMain = Song1.play();
         } else {
              pbSong1.visible = true;
              Song1.load(new URLRequest("media/music/Song1.mp3"));
    function Song1LoadComplete(event:Event) {
         trace("Size of file: " + Song1.bytesTotal);
         Song1.close();
         Song1Loaded = true;
         if(sndchnlMain) {
              sndchnlMain.stop();
         sndchnlMain = Song1.play();
         pbSong1.visible = false;

    But if I reset the bolean to false, if the visitor goes to replay that song, it will try to load the song again.  I did find away around having to the use the boolean value though and accomplish the same thing (I am loving this).  I am using:
    this["Song"+SongNum].bytesTotal
    If there are bytes, then the song is loaded OR loading.  In order to check if the song is completely loaded before it plays, I am using this:
    this["Song"+SongNum].bytesTotal == this["Song"+SongNum].bytesLoaded
    This elimates the need for the Boolean I was using.  Also instead of for each song defining:
    pbSong1.source = Song1;
    I am using the main function to do it for me:
    this["pbSong"+SongNum].source = this["Song"+SongNum];
    The reason why I asked about the Sound variable, I was currious if I could do the same with it as I did with the Progress Bar Source as shown above?  Instead of defining this first:
    var Song1:Sound = new Sound();
    Can I do this in the function:
    var this["Song"+SongNum]:Sound = new Sound();
    I tried it once but I got an error.
    Here is the new FULL updated code:
    import fl.controls.ProgressBar;
    import flash.events.ProgressEvent;
    import flash.events.IOErrorEvent;
    import flash.net.URLRequest;
    import flash.media.SoundChannel;
    import flash.media.Sound;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import flash.display.MovieClip;
    var sndchnlMain:SoundChannel;
    ClearNowPlaying();
      Song 1 Definitions
    var Song1:Sound = new Sound();
    pbSong1.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong1Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong1Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 2 Definitions
    var Song2:Sound = new Sound();
    pbSong2.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong2Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong2Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 3 Definitions
    var Song3:Sound = new Sound();
    pbSong3.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong3Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong3Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 4 Definitions
    var Song4:Sound = new Sound();
    pbSong4.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong4Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong4Stop.addEventListener(MouseEvent.CLICK, Stop);
      Song 5 Definitions
    var Song5:Sound = new Sound();
    pbSong5.addEventListener(Event.COMPLETE, LoadComplete);
    btnSong5Play.addEventListener(MouseEvent.CLICK, PlaySong);
    btnSong5Stop.addEventListener(MouseEvent.CLICK, Stop);
      Universal Functions
    function Stop(event:MouseEvent) {
         sndchnlMain.stop();
         ClearNowPlaying();
    function PlaySong(event:MouseEvent) {
         var SongNum:int = Number(event.currentTarget.name.split("btnSong").join("").split("Play").join(""));
         if (this["Song"+SongNum].bytesTotal) {
              if (this["Song"+SongNum].bytesTotal == this["Song"+SongNum].bytesLoaded) {
                   sndchnlMain.stop();
                   ClearNowPlaying();
                   this["NowPlayingSong"+SongNum].visible = true;
                   sndchnlMain = this["Song"+SongNum].play();
         } else {
              this["pbSong"+SongNum].source = this["Song"+SongNum];
              this["pbSong"+SongNum].visible = true;
              this["Song"+SongNum].load(new URLRequest("media/music/Song"+SongNum+".mp3"));
    function LoadComplete(event:Event) {
         var SongNum:int = Number(event.currentTarget.name.split("pbSong").join(""));
         trace("Size of file: " + this["Song"+SongNum].bytesTotal);
         this["Song"+SongNum].close();
         this["Song"+SongNum+"Loaded"] = true;
         if(sndchnlMain) {
              sndchnlMain.stop();
         ClearNowPlaying();
         this["NowPlayingSong"+SongNum].visible = true;
         sndchnlMain = this["Song"+SongNum].play();
         this["pbSong"+SongNum].visible = false;
    function ClearNowPlaying() {
         NowPlayingSong1.visible = false;
         NowPlayingSong2.visible = false;
         NowPlayingSong3.visible = false;
         NowPlayingSong4.visible = false;
         NowPlayingSong5.visible = false;

  • Invoking event listener

    I'm new to reflection api and would like to know whether it's possible or not using Method class to invoke event listener without using awt or swing? And if it's possible some sample code would be nice.

    I mean I don't want to use gui components. In fact
    I'm writing console program. I just want to use event
    listener to implement keyboard listener(pressing
    buttons).Oh. That won't work. To capture events from the console, you'll be needing to dabble with native code. AWT events are generated by AWT components, in response to events from the underlying windowing system

  • Deployoing two FE Servers in same Ent FE Pool across two datacenters

    Couple of questions around Enterprise FE Pool, hope to get feedback.
    1/Has any one had the experience of deploying two FE Servers in same Ent FE Pool across two datacenters?  Any experience you can share?
    2/What is the network requirements among FE Servers in the same FE Pool?  Such as LAN subnet, network latency, jitter, ...
    Thanks
    Albert
    Albert

    Albert,
    #1 - officially no for Lync Server 2013 core setup. Site level redundancy is achieved with a multi-server Enterprise Pool setup + SQL Mirroring backend (optionally SQL Witness) whereas Disaster Recovery depends on Pool Pairing of liked
    pools across disparate geographical locations. 
    Assuming that the 2 datacentres are part of the same campus connected with each other in a high speed LAN (low latency, delays, etc.), it is indeed possible to separate, say a 6 server Enterprise Edition pool, into 2 groups of 3 servers within
    the same IPv4 subnet. Depending on whether SQL Mirroring is deployed or not (and how), the reachability and availability of each "server group" may not meet the minimum number of servers required to keep the pool functional (see "Topologies
    and components for Front End Servers, instant messaging, and presence in Lync Server 2013"). Hence, it may still be better to consider having 2 separate paired Enterprise or Standard Edition pools located in the 2 datacentres.
    Please share with us if this helps.
    Thanks / rgds,
    TechNet/MSDN Forum Moderator - http://www.leedesmond.com

Maybe you are looking for

  • Having trouble connecting MBA to WIFI at many hotspots

    Having trouble coonecting. Everything ok at home and some cafes, but other places are proving more difficult.

  • How to convert MPEG-1 to .mov?

    I took a vid of my cousin's basketball game and I was going to put it together and make a movie out of it in Final Cut Pro X. Only issue is, the videos are in MPEG-1 format, so Final Cut Pro doesn't support them. How do you convert it to .mov for fre

  • Application Pool worker process is unresponsive

    A process serving application pool 'Portal' suffered a fatal communication error with the Windows Process Activation Service. The process id was '3472'. The data field contains the error number. How do I investigate this? I think its due to the appli

  • Resize a picture?

    Is there any way to resize a picture conrol during run time such that everything rescales accordingly. Kind of like a zoom, not even. Say there is a picture control on my display, then the user streches the display out to twice the size, is there any

  • How to Turn Your Mac into a FireWire Hard Drive

    I followed these instructions: http://www.ehow.com/how2160597hard-drive-quick-data-transfer.html and it worked great, I was able to use my macbook as a hard drive and quickly copies files to it. But I'm concerned that anyone with a firewire cable and