Query to calculate TV Events ( Agregate function?)

Dear All,
I have a table of scheduled TV Events. In my case it is legal to broadcast some event again and again during 48 hours since it was aired first time, without paying extra fees.
I need to count across all the broacasting days how many times the Event was aired to be able to know what fees I shall pay.
A quick example:
Case 1
Programme "Lost" Episode 1 was aired first on Jan/1/2008 at 8:00am. I can broadcast it as many times as I want until Jan/3/2008, 07:59am and it will be counted as one Event only.
Case 2
Programme "Lost" Episode 1 was aired first on Jan/1/2008 at 8:00am and the same Episode 1 was aired a second time on Jan/3/2008 at 10:00am. Here I must pay fees as it was aired twice. I need to count it as 2
Many thanks in advance!

Hi,
Assuming 10g with OLAP option installed.
My test data structure:
Event_Id - a program, i.e "Lost", etc
Event_DT - a date and time when program was aired
SQL> WITH Test_Data AS (
  2    SELECT 1 AS Event_Id, TO_DATE('01.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  3    SELECT 1 AS Event_Id, TO_DATE('01.01.2008 09:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  4    SELECT 1 AS Event_Id, TO_DATE('02.01.2008 18:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  5    SELECT 1 AS Event_Id, TO_DATE('03.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  6    SELECT 1 AS Event_Id, TO_DATE('04.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  7    SELECT 1 AS Event_Id, TO_DATE('05.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  8    SELECT 2 AS Event_Id, TO_DATE('01.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
  9    SELECT 2 AS Event_Id, TO_DATE('01.01.2008 09:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
10    SELECT 2 AS Event_Id, TO_DATE('02.01.2008 18:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
11    SELECT 2 AS Event_Id, TO_DATE('03.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
12    SELECT 3 AS Event_Id, TO_DATE('04.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual UNION ALL
13    SELECT 3 AS Event_Id, TO_DATE('05.01.2008 08:00:00', 'DD.MM.YYYY HH24:MI:SS') AS Event_DT FROM Dual
14  ),
15  RNs AS (
16    SELECT Test_Data.*,
17      ROW_NUMBER() OVER (PARTITION BY Event_Id ORDER BY Event_DT) AS RN
18    FROM Test_Data
19  ),
20  Event_Starts AS (
21    SELECT Event_Id, Event_DT, RN, Event_Start
22    FROM RNs
23    MODEL
24      PARTITION BY (Event_Id)
25      DIMENSION BY (RN)
26      MEASURES (Event_DT, Event_DT Event_Start)
27      RULES (
28        Event_Start[ANY ] ORDER BY RN = CASE
29                                          WHEN Event_Start[CV() - 1] IS PRESENT
30                                            AND Event_Start[CV()] - Event_Start[CV() - 1] < 2
31                                            THEN Event_Start[CV() - 1]
32                                          ELSE
33                                            Event_DT[CV()]
34                                        END
35      )
36  )
37  SELECT Event_Id, COUNT(DISTINCT Event_Start) Event_Count
38  FROM Event_Starts
39  GROUP BY Event_Id
40  ;
  EVENT_ID EVENT_COUNT
         1           3
         2           2
         3           1Regards,
Dima

Similar Messages

  • Do we have any Event Driven functionality in Biztalk

    Hi,
    Do we have any in-build event driven functionality in Biztalk? time-bound like.
    Few scenarios:
    1. If orchestration is running more then 5 mints then it should be alerted to admin.
    2. Alert need to be raised if bulk of messages are suspended.
    Thanks

    Hi Narasaiah,
    If you don't have resource to go for SCOM/BizTalk360, then
    You can consider using some operation scripts using WMI/Operations DL/SQL query which can be executed periodically using a schedule task (or as service).
    This script can check for the condition as you have specified and send a notification.
    Following scripts can give you some idea. Note: These scripts are just to give you an idea and get started, they are not tested.
    WMI for an orchestration which is Active state for 5 minutes:
    strComputer = "."
    Dim dtCurretTime, dt5Mins
    dtCurretTime = Now ()
    dt5Mins = DateAdd("h",-5,dtCurretTime)
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\MicrosoftBizTalkServer")
    Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM MSBTS_ServiceInstance WHERE ServiceStatus = 4 AND ActivationTime >= dt5Mins",,48)
    If colItems.Count >0
    Wscript.Echo "Instance" & colItems.ServiceName" has been in Active state"
    End If
    Here the "MSBTS_ServiceInstance" would give you the details about the orchestration
    And SQL query to get the count of suspended message:
    SELECT
    count(InstancesSuspended.)uidInstanceID
    FROM InstancesSuspended
    LEFT OUTER JOIN [Services]
    on InstancesSuspended.uidServiceID = [Services].uidServiceID
    LEFT OUTER JOIN Modules
    on Modules.nModuleID = [Services].nModuleID
    LEFT OUTER JOIN Instances
    on Instances.uidInstanceId = InstancesSuspended.uidInstanceID
    WHERE InstancesSuspended.DtCreated between DATEADD(dd,-7,GETUTCDATE()) and GETUTCDATE()
    and InstancesSuspended.nErrorCategory=0
    Instances.nState = 4 or Instances.nState = 32
    //Instances.nState as State -- 4 = Suspended (resumable), 32 = Suspended (not resumable)
    ORDER BY InstancesSuspended.dtCreated desc
    As mentioned, fine-tune these scripts, run them in periodically and send notification if the condition matches.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Any plans to enhance the Event Booking functionality?

    Hi,
    At the moment the Event Booking functionality is very limited.
    Are there any plans in the near future to enhance how it works to include things like:
    An end date for an event - at the moment it is impossible to indicate that an event goes for more than 1 day.
    Easy payment for bookings - while you can currently take payments for books it is near impossible for customers to easily book more than 1 event at a time or book for multiple people (you either need to use custom javascript to calculate the cost) or reply on the customer to calculate the cost.
    Use vouchers for bookings. Event bookings should really use the same checkout as the shop so customers can use vouchers and discount codes. The way I see it is bookings are just a unique type of product.
    Thanks
    Madeleine

    As Mike says, it actually works rather well. 
    The only possibly confusing bit is that there is a "To:" box and "CC" and "Bcc" buttons along with a button for a LR Address book.  Once you know to ignore these it works just fine with Thunderbird and presumably other email clients.

  • How to run recordset SQL query in FORM DATA event

    How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?

    Hi Slamet,
    When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
    With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
    There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
    <i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
    Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
    Hope it helps
    Trinidad.

  • Passing a query with a variable to a function

    I have a procedure that builds a query and passes it to a function to dump the results to a csv file. I now need to add a parameter to the procedure to allow the number of days in the past to be passed in and used as a variable in the query (it was previously hardcoded to "sysdate-7" and worked fine). So I have added the parameter "p_days_back", but as soon as I put "sysdate - p_days_back" in the query, it fails with "Invalid Query". I'm hoping there's someway to format this parameter to be acceptable to this quoted query string. Procedure snippet below:
    CREATE OR REPLACE PROCEDURE EXTRACT_PS_EMPS
    (p_days_back IN NUMBER DEFAULT 7)
    AS
    v_query VARCHAR2(4000);
    v_separator VARCHAR2(1) := ',';
    v_dir VARCHAR2(500) := '/export/home/oracle';
    v_filename VARCHAR2(100) := 'emp_data.csv';
    l_rows NUMBER(4) := 0;
    BEGIN
    v_query :=
    'SELECT user_access_id,
    jobcode,
    orig_hire_dt,
    empl_status,
    company
    FROM ps_empl_view
    WHERE company in (''TP'',''SS'',''UE'',''UG'')
    AND orig_hire_dt <= sysdate
         AND (empl_status in (''P'',''A'',''L'',''S'')
    or (empl_status NOT in (''P'',''A'',''L'',''S'') AND effdt >= sysdate - p_days_back))
    ORDER BY user_access_id';
    l_rows := uns_pf_dump_csv(v_query, v_separator, v_dir, v_filename);
    dbms_output.put_line('Rows created: ' || l_rows);
    IF l_rows < 0 THEN
    IF l_rows = -1 THEN
    dbms_output.put_line('File Open Error');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'File Open Error';
    ELSIF l_rows = -2 THEN
    dbms_output.put_line('Query Error');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Query Error';
    ELSIF l_rows = -3 THEN
    dbms_output.put_line('Invalid Path');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Invalid Path';
    ELSIF l_rows = -4 THEN
    dbms_output.put_line('Invalid Mode');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Invalid Mode';
    ELSIF l_rows = -5 THEN
    dbms_output.put_line('Invalid Filehandle');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Invalid Filehandle';
    ELSIF l_rows = -6 THEN
    dbms_output.put_line('Invalid Operation');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Invalid Operation';
    ELSIF l_rows = -7 THEN
    dbms_output.put_line('Write Error');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Write Error';
    ELSIF l_rows = -8 THEN
    dbms_output.put_line('Internal Error');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Internal Error';
    ELSIF l_rows = -9 THEN
    dbms_output.put_line('Other Error');
    v_text := 'Error from EXTRACT_PS_EMPS: ' || l_rows || ' = ' || 'Other Error';
    END IF;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Proc Error from EXTRACT_PS_EMPS: ' || SQLERRM);
    END;
    Thanks in advance for your help.

    In the future please post the following:
    1. Oracle version (example: 10.2.0.4)
    2. Post any code in fixed format using \ tags.
    One question, do you have the ability to modify your function that dumps data to CSV?                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I can't remove event handler functions

    Hi guys!
    Please help to remove event handler functions of a
    FLVPlaback. I add some functions for an FLVPlaback instance and
    that's why doesn't work the control panel (play button, pause
    button and so on) Here is a link:
    http://sexaid.fw.hu/vg/vg.html
    to understand simply the problem. thx every ideas!

    I would prefer not to announce the URL to the world on this forum, but I can say the old website still starts with the standard .Mac URL http://web.mac.com/username/iWeb and the new one until I set up to use my own domain was the same I believe.
    Empty the Cache has no effect I can still go to the URL and explore the various pages.
    I do not think that the .Mac websites are hosted from the iDisk location as I have defiantly deleted them from my iDisk and I have rechecked every file in the iDisk for any sign of them also my new iWeb '08 website never appeared in the iDisk. I would presume that the .Mac websites are hosted from a particular location on the Apple servers and I need to some how pull them off separately because publishing another new site with iWeb '08 has just left me with two sites and the old one remains and does not exist in iWeb '08 so I can unpublish it.

  • Passing data to event handler function

    I am trying to pass value to the event handler function but I
    am getting the following error. Can someone please tell me what I
    am doing wrong?
    1067: Implicit coercion of a value of type void to an
    unrelated type function
    here is the code
    private function myClickListener(myid:int):void{
    Alert.show("The button was clicked");
    public function handleStringResult(event:ResultEvent):void{
    catInfo = event.result as ArrayCollection;
    for each(var o:Object in catInfo){
    var b:Button = new Button();
    b.label = o.FILLCOLOR;
    b.id=o.CATID;
    b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
    b.setStyle("color","#FFFFFF");
    b.setStyle("fontFamily","Arial");
    b.setStyle("fontSize",8);
    b.setStyle("textRollOverColor", "red");
    b.addEventListener(MouseEvent.CLICK,
    myClickListener(o.CATID));
    myvbox.addChild(b);
    ]]>

    "Merlyn MM" <[email protected]> wrote in
    message
    news:[email protected]...
    > Sure, Here is the code. I am very new to flex and if my
    code doesn't make
    > sense
    > then please let me know the correct way to do this. I
    really appreciate
    > you
    > taking time!
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > layout="absolute"
    > backgroundColor="#FFFFFF"
    > initialize="myService.getcategories.send()">
    > <mx:WebService id="myService"
    > useProxy="false"
    > wsdl="
    http://devsite/rc/category.cfc?wsdl"
    > showBusyCursor="true">
    > <mx:operation name="getcategories"
    > result="handleStringResult(event)"
    > fault="Alert.show(event.fault.message)"/>
    > <mx:operation name="getsubcounties"
    result="handleStringResult(event)"
    > fault="Alert.show(event.fault.message)"/>
    > <mx:request>CATID</mx:request> //need to
    pass category ID here
    > </mx:operation>
    > </mx:WebService>
    >
    > <mx:Script>
    > <![CDATA[
    > import mx.collections.ArrayCollection;
    > import mx.rpc.events.ResultEvent;
    > import mx.rpc.events.FaultEvent;
    > import mx.controls.Alert;
    > import mx.controls.Button;
    >
    > [Bindable]
    > private var catInfo:ArrayCollection;
    >
    > private function myClickListener(myId:String):void{
    >
    > myService.getcounties.send() // I need to send catid
    here to the
    > webservice
    > }
    >
    >
    > public function
    handleStringResult(event:ResultEvent):void{
    > catInfo = event.result as ArrayCollection;
    > for each(var o:Object in catInfo){
    > var b:Button = new Button();
    > b.label = o.FILLCOLOR;
    > b.id='btn'+o.CATID;
    >
    >
    b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
    > b.setStyle("color","#FFFFFF");
    > b.setStyle("fontFamily","Arial");
    > b.setStyle("fontSize",8);
    > b.setStyle("textRollOverColor", "red");
    > b.addEventListener("click", myClickListener);
    > myvbox.addChild(b);
    > }
    > }
    > ]]>
    > </mx:Script>
    I'd change it to this:
    private function myClickListener(e:Event):void{
    //I don't see where you're using the ID, but to get it,
    //use this code:
    var myID = e.currentTarget.data;
    myService.getcounties.send() // I need to send catid here to
    the
    webservice
    public function handleStringResult(event:ResultEvent):void{
    catInfo = event.result as ArrayCollection;
    for each(var o:Object in catInfo){
    var b:Button = new Button();
    b.label = o.FILLCOLOR;
    //note that you couldn't have used your ID
    //as a "handle" to anything, so I replaced
    //that logic with something you _could_ use
    b.data=o.CATID;
    b.setStyle("fillColors",['#'+o.FILLCOLOR,'#'+o.FILLCOLOR]);
    b.setStyle("color","#FFFFFF");
    b.setStyle("fontFamily","Arial");
    b.setStyle("fontSize",8);
    b.setStyle("textRollOverColor", "red");
    b.addEventListener("click", myClickListener);
    myvbox.addChild(b);
    You could also use a Repeater and set this up in MXML.
    HTH;
    Amy

  • Passing parameters to event triggered functions

    hi all,
    i have created a button and added EventListener.
    as mybutton.addEventListener(MouseEvent.CLICK,clickSt art);
    when i implement the clickStart (event:MouseEvent) function i
    want to pass
    an array ,a String to this function as parameters .how can i
    do this.
    is it possible or not.
    thanx.

    Well, not in that way.
    The function automatically receives a parameter when you
    create a callback with that function by "addEventListener", such
    parameter is datatyped as the event type you defined in the
    callback, in your case "MouseEvent". If you want to pass more data
    when the function is called then you have to create your own event
    class because almost all events just inform when something has
    happened and send limited information. You can check the
    documentation about creating a custom event class, there is a lot
    of info about the topic.

  • Query to calculate time

    hi all,
    i have 2 udf field of type 'Time', StartTime and EndTime in order to catch the info of some process time.
    again 2 fields of date in order to catch the range of days for the process goes.
    like the following
    Startdate | Enddate | Starttime | Endtime
    15/04/09--| 16/04/09| 9:30- | ---14:00
    Now i need a query to calculate the time differences in hrs. like the process runs thro 4 n half hrs a day and totally as per the table value the total run process time is 9 hrs.
    How to bring out in query any one plz help...
    Thank you so much,

    Hi Yatsea, sorry tis time too its not reteiving correct answer, the values i gave over here is jus for example. but in real there may be many different values. So will be useful in case of providing the query taking in the field names plz.
    i hav a work around working on . will write here, plz guide me to correct the query to get me correct answer.
    in order to find the specific hrs between start and end time for 2 days,
    1. can find first total days within start and end date (EndDate-StartDate) + 1 = 2
    2. 2nd find the hrs between start and end time (EndTime-StartTime) = 4.30 hrs
    3. after tht should multply the 2 values 2 * 4.30 = 8.60 which should round as 9 hrs
    Select (datediff(day,enddate,startdate)+1) * (endtime-starttime)
    will it help..? its not giving correct answer. may gone wrong wit time format. but this concept will give correct anawer i hope...
    PLz...help me getting solution.
    Edited by: New  User on Apr 16, 2009 3:52 PM

  • What will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports

    what will be the peoplesoft query to calculate voluntary termination count and involuntary termination count? I am working on OBIA HR analytics workforce deployment reports and need to validate the reports. I also want to know the tables involved

    Hi Andrew,
    Part A:
    I've done some restating of the question, and distributed the calculations among several fields, not all of which need to be included on the visible layout. Other than formatting the Date fields and moving the 'Completed Date' field and its label, I've left this in the default "Layout 1" produced by AppleWorks.
    Field List:
    Priority: Popup menu with six items: 00, J, D, 1, 2, 3  Defaults to 00
    TL (time limit in months): Calculation:  CHOOSE('Priority',0,1,3,4,6,12)
    Received: Date. Option: Automatically insert today's date (ie. Date Record created) (may be edited)
    Target Date: Calculation:
    DATE(YEAR('Received')+INT(MONTH('Received')+'TL')/12,MOD(MONTH('Received')+'TL', 12),DAY('Received'))
    Remaining (Days): Calculation: INT('Target Date'+1-NOW())  (see revision below)
    Completed: Checkbox. Set default value to Unchecked.
    Completed Date: Date: Entered manually
    OnTarget: Calculation: IF('Completed',IF('Completed Date'<'Target Date',"On Target","Over"),IF(INT(NOW())>'Target Date',"Over","On Target"))
    The On Target field shows the current status of the case while still open, and the state on the closing date when it was closed.
    Having done that, I was unhappy with the Remaining field continuing to calculate an ever larger negative number after the case had been closed. Hence this revision below:
    Remaining: Calculation: IF('Completed','Target Date'-'Completed Date',INT('Target Date'+1-NOW()))
    Shows the number of days remaining while the case is open, the days remaining at completion if the case has been marked Completed and the completion date entered.
    Rsults (and some further formatting of the Layout) below.
    Part B:
    You will need Subsummary parts when sorted on Completed and on On Target. Fields can appear on  a Layout only once, so each subsummary part will need a separate Summary type field for each field to be summarized.
    Regards,
    Barry

  • Need  the query to calculate the time taken to excute it.

    hi all,
    i need the query to calculate the time taken to excute it.
    for ex:
    select * from emp;
    how much time it will take to give o/p
    Thanks in advance
    satya

    Just to add to what was said - the execution can each time be DIFFERENT as the factors that governs performance are NOT CONSTANT.
    If Oracle has no idea how long the query is going to take before executing it, then how can you and your code know?
    Oracle's CBO estimates the cost (expense) of the query. This is an indication of how expensive a query is - and the more expensive the query, the more resources need to be used, the longer the query will take. The less expensive the query, the fewer resources it need, the faster it will take.
    And that is it. How fast or how slow? Oracle does not know. How much faster a query with a cost of 10,000 versus a query with a cost of 1? Oracle does not know.
    Why? Because the platform is not constant. Just what data is at this exact moment in the db buffer cache? Just how much CPU capacity is available for the new few seconds? Just what will the sustained throughput be of the I/O subsystem and channels for the next minute? Just how many memory pages need to be swapped between cache and memory? Etc. etc.
    All these factors change every single second. So forget about attempting to accurately calculate up-front the time it will take for a query. IT IS NOT POSSIBLE.

  • SQL Query to Calculate Total PO Amount

    Hi,
    I'm trying to create a Purchase Order view that includes Total Po Amount. Has anyone done this before and can provide me with the SQL? Or advice on how to write the query to calculate the po_line amounts for each po number?
    I've looked in the POXPOEPO.fmb form for the calculation(code) and looked at several APPS views(ie. PO_Headers_Inq_V) without any success.
    Any help would be appreciated.
    Thanks
    Tony

    Tony, I think this will help you:
    select sum(pl.unit_price * pl.quantity)
    from po_lines_all pl
    , po_headers_all ph
    where ph.segment1 = 1004257 -- po_number
    and ph.po_header_id = pl.po_header_id
    Regards,
    Ricardo Cabral

  • Query to clear raised events in CPS

    Hi,
    Is there a query to clear raised events in Redwood ?
    Our CPS did not restart properly this WE and all the Event File Definition wich was started are now going in a pending status. The problem is that the raised ones are not visible in the monitoring (I cannot clear them !) and auto-submit jobs are not running anymore as new event file are pending !
    How can I clear them (as they'aren't in the monitoring) ?
    I solved my problem by creating a new file Event Definition for one of the job and it ran but I cannot do that (itu2019s not a solution) for all the jobs which were running correctly before.
    We restart Redwood but event are still going in a pending status, I donu2019t see any operator message.
    So, this problem is not similar with the one I opened a few days ago.
    If someone can help, Iu2019ll really appreciate it.
    Clement.

    Hi Preethish,
    Yes, I'm able to submit the Job Chains manually and I already Clear all Pending events. But no way, still going in pending status.
    What I did to workaround my problem, I create new event definitions for those job chains but I don't want to correct the problem that way if this happens again; It's not a solution as I've too many jobs.
    Regards
    Clement.

  • Test Script for Event driven function

    Hi,
    i m new to this product. i have one doubt , is it possible to write test scripts for event driven functions ?
    if possible, could you please share some samples.?
    Thnk you.
    Bala.

    Yes.
    At the simplest, you could have a test like this:
    [Test]
    public function shouldThrowEvent():void {
      var eventCalled:Boolean = false;
      var someEventDispatcher:SomeEventDispatcher = new SomeEventDispatcher();
      someEventDispatcher.addEventListener( "someEvent",
              function ( event:Event ) {
                   eventCalled = true;
      assertTrue( eventCalled );
    I would recommend looking at docs.flexunit.org for more information.
    Mike

  • Event Listening Function Return

    I don't know if it is possible, but is there any way that you
    can have a event listening function return a value? Thanks for any
    suggestions!

    Substitute this NSLog for yours and post back result.
    NSLog(@"Description is: %@", [myresult description]);

Maybe you are looking for