How do you cancel Events?

Here's what I am trying to do:
I have a set of .mxml components comprising various "views"
for my application. These views are a subclass of a template view.
Each view has a "goBack" event which is dispatched via an
outside Event managing utility (I have to do it this way because of
the project's design specs... I can't just dispatch the event from
within the component... ALL events, no matter how simple and
straightforward have to go through the Event managing utility).
Here's the structure:
All these view components are inside a viewstack and their
listener is set to a function on the application level:
<mx:Application ..>
__<mx:Script>
____private function goBack(e:Event):void {
______//a function that manages the ViewStack's selectedChild
__</mx:Script>
__<mx:ViewStack>
____<CC:MainMenu />
____<CC:View1 goBack="goBack(event)" />
____<CC:View2 goBack="goBack(event)" />
etc.
now, the custom Event utility class does something like this:
public static fuction handleEvent(ecode:String):void {
 //currentView being whatever the selectedChild of my
Application's main ViewStack is
  if (ecode ==
"SOME_DOCUMENTED_CODE_NUMBER12345") {
   currentView.dispatchEvent(new
Event("goBack"));
but! on one particular view, I want to intercept the "goBack"
event and instead of immediately calling the goBack listener on the
application level, I want to open a confirmation dialog in the
component. If the user confirms, then I want the application
listener to fire and proceed as normal.
The prolem is that no matter what I do, the event listener on
the Application level always seems to fire before the listener on
the component. I have tried setting bubbles, and cancelable in
the constructor, tried making the event a MouseEvent, but to no
avail. How can I set up my event so that it is detected by the
component that originates the event and gets cancelled within the
component.
I realize there are other ways to do this, but I am forced to
comply with strict specifications and must keep everything as
compartmentalized as possible (thus no "confirm" event or if
statements in the Applications goBack() method).
If anyone can offer any adivce, I would greatly appreciate
it.

Ok, it doesn't say that explicitly in the docs, but here's
what it does say:
quote:
Second, you register that function or class method with a
display list object by using the addEventListener() method, as the
following example shows:
myButton.addEventListener(MouseEvent.CLICK, myEventListener);
Most Flex controls simplify listener registration by letting
you specify the listener inside the MXML tag. For example, instead
of using the addEventListener() method to specify a listener
function for the Button control's click event, you specify it in
the click attribute of the <mx:Button> tag:
<mx:Button id="b1" label="Click Me"
click="myEventListener()"/>
This is equivalent to the addEventListener() method in the
previous code example. However, it is best practice to use the
addEventListener() method. This method gives you greater control
over the event by letting you configure the priority and capturing
settings, and use event constants. In addition, if you use
addEventListener() to add a listener, you can use
removeEventListener() to remove the listener when you no longer
need it. If you add an event listener inline, you cannot call
removeEventListener() on that listener.
This is in:
Flex 2 Developer's Guide > Using Flex Programming
Languages > Using Events > Using events
if <mc:Comp myEvent="blah(event)"> is the same as:
addEventListener("myEvent", blah), then it follows that setting the
listener in the mxml tag sets up only for capturing.

Similar Messages

  • How do you cancel BT Sports?

    I'm currently on Sky HD but I'm cancelling it as the majority of programmes I watch are on freeview.
    I signed up online for BT Sports back in May but I've changed my mind & don't wish to go ahead with it anymore.
    How do you cancel this before the season starts?

    OneManTagTeam wrote:
    Just a follow up. I rang up & cancelled & got my £15 refunded to me. I also got another bill for around £5 a few days after I cancelled but that gas been cancelled too.
    I really see no reason for the high activation fee & bills before the service has even started
    BT have to pay Sky when the card is activated to receive then channels. It makes sense that they'd charge you at the same time. 

  • What happens if I need to cancel my subscription before the year is up? Also, how do you cancel?

    How do you cancel subscription before the year is up? How do you cancel

    See http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    "Cancel an annual membership (individual or team)
    If you cancel within the first month, you receive a full refund. Otherwise, you are billed 50% of your remaining contract obligation.
    To cancel your membership at any time, contact us.
    To cancel your membership in the last month (month 12), follow the steps in the "Cancel a month-to-month membership" section below. (If you cancel an annual membership in the last month you don't need assistance from customer support.)"

  • If you accidentally click on date "pop down", how do you cancel it?

    If you accidentally click on date "pop down" in a document or email, how do you cancel the window that pops up?
    A calendar entry pops up, but has no Cancel button, no close box, and does not respond to ESC key.

    Barney-15E wrote: Click somewhere else. Esc works for all the other data detectors, but not calendar entries, it appears.
    Clicking elsewhere does not work, either.
    I had to close the document to get rid of the window. Even scrolling does not move the window. Bad design, Apple.

  • How do you cancel storage

    i can't cancel my storage on icloud and it is going to charge me for another year.  I tried to downgrade it but it will not allow my to click the done button once i click on the 5g free storage.  How do you cancel, is there a number to call or an email.  I have tried this on every device and the computer.  it will not let me cancel and i don't have time to continue to try and fix it

    Call the Apple online store for your country.

  • TS1702 how do you cancel an app download

    how do you cancel app download iphone 4

    Hello Chainring
    hold down on the app, it should start to shake, when it does you should see an (X) just tap the (X) and it should stop...
    Good Luck
    Dustin

  • How do you cancel a "credit card" (incoming payment, deposit)

    Hi
    How do you cancel a credit card payment
    customer cancelled the deposit than the credit card summary, went to cancel incoming payment and it will not "no records found in credit card management"
    how do we do it and if the above incorrect how do we fix it

    Hi,
    Check the following thread :
    [Cancel Incoming payment|Re: Cannot cancel incoming payment]
    Regards,
    Jitin

  • How do you cancel a erase pending from icloud to an ipod5?

    So i lost my ipod5 a month ago, and waited 2 weeks and then decided to send a erase. Now i found it at my friends house, and its still offline. I haven't on it yet because i dont want the stuff to be erase. i havent backed it up in a long time and i dont want to lose anything. how do you cancel a erase pending from icloud to an ipod5? PLEASE HELP

    Hello adv1234,
    Welcome to the Apple Support Communities!
    I realize that you have found your iPod that you previously thought to be lost and had initiated an erase from iCloud. Once set to erase, the process cannot stop, but you can restore from any previous iCloud or iTunes backups that you may have for the device.
    iCloud: Erase your device
    If you erase then find your iOS device, you can restore the information on the device using iCloud Backup (if backup was turned on before you erased it) or iTunes. For more information, see iCloud storage and backup overview, or the Safety, Handling & Support section of the iOS 8 user guide for your iPhone, iPad, or iPod touch. If your device has iOS 7 or earlier, get the user guide from the Apple Support website.
    Best regards,
    Joe

  • TS3376 How do you cancel a full erase

    Found lost phone set up for full erase...how do you cancel erase

    You don't. That's a security feature implemented by the former owner to prevent the loss of any information to whomever has it. It will restore to iOS 7.0.6 after which it becomes a paper weight.

  • How can you cancel sounds registered during the lessons?

    How can you cancel sounds registered during the lessons?

    In applications, drag the install OSX 10.10.1 to trash. The download will not install unless you tell it to. You can download it without it installing, so trash it if you have decided you don't want it or simply don't tell it to install.
    Cheers
    Pete

  • How do you cancel your creative cloud subscription?!

    I signed up for a student account, paying $19.99 per month. When I checked my credit card statement, I noticed that I am being charged over $30 per month for Creative Cloud services. When I log onto my account it says that I have a "Free Creative Cloud Membership" and there aren't any credit card options available to cancel or manage.  I'm not given an option to cancel or delete my account.
    I have gone through the steps that Adobe provides on their website, but this has not resolved the problem (as there is no option to cancel or manage my account or credit cards).
    I am very frustrated by the lack of support coming from Adobe to fix this problem, so I'm reaching out to you guys. Has anyone had a similar problem, and if so, how did you resolve this?

    This is an open forum, not Adobe support... You need Adobe support to cancel a subscription
    -start here https://forums.adobe.com/thread/1703848
    -or by telephone http://helpx.adobe.com/x-productkb/global/phone-support-orders.html
    --and two links which may provide more details, if the above links don't help you
    -http://helpx.adobe.com/x-productkb/policy-pricing/return-cancel-or-change-order.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html

  • How do you move events and projects between Libraries in iMove 10

    I am running OSX 10.9.5 (Mavericks) & iMovie 10.0.5.
    I am trying to free up space on my internal 1TB hard drive and want to archive events and completed projects onto an external hard drive, which has a second iMove v10 Library on.  Under V9 of iMovie this function was easy, but I am struggling under V10.
    What is the correct way to move events between libraries in iMovie. 
    When I attach the external drive containing my second iMovie Library, open it I can see all existing events stored (by move) under version 9 of iMovie.
    Reading the Help (extract below) for this function it implies highlight the Event to move & then drag & drop into the second Library.
    Shift+CMD with drag and drop onto the second library at the library name level will move Events that are not tied to a project, but for completed projects (Finalized under V9 or shared for example with iTunes in V10) it seems these can not be moved, the above function only copies them to the second library.
    I have tried all different combinations of the Fn, Ctrl, Option CMD keys etc with and without SHIFT and the ones that work for this function only copy the event. I can not seem to get an event moved once attached to a project. File - Move Event will also move Events not tied to a completed project.
    I have also tried copy to a second Library & then to delete the original events.  Again it appears you can not delete events tied to a Project.
    What I have also not been able to find is how to move a finalised Project to another Library and then see if events attached to that project would then move.
    I have been able to move Events not tied to a Project to the second Library, then create a new project within this Library.  This helps with all new projects & future import of Events. But does not help me free up current space by archiving.
    Extract from help
    Copy or move projects, events, or clips between libraries or storage devices
             Connect a storage device that contains the target library to your Mac, or copy the target library to your Mac.
             Choose File > Open Library, and choose an option from the submenu.You can choose from recently opened libraries, locate an existing library on your Mac, or create a new library.The selected library is opened in the Libraries list, with the first event selected and its contents displayed in the browser.
             In the Libraries list, select the event that contains the item you want to move or copy.
             In the browser, select the item you want to move or copy.Tip:  To select multiple clips or projects in the same library, hold down the Command key as you click the items you want to select, or drag a selection rectangle around the items.
             Do one of the following:
    To move items between events or libraries: Drag the clip or project to another event or library.
    To copy items between events or libraries: Option-drag the clip or project to another event or library by first starting to drag and then holding down the Option key as you drag.
    Would appreciate any help on this matter.
    Thanks
    Colroy

    Further to my original post below; I have done further analysis and it seams that if you have events tied to a project (mine are all finalised) you can not move events between Libraries.  However, events that are not tied to a project can be moved. Either by Shift CMD or by using File- Move event.
    What I have not been able to find is how to move a finalised Project to another Library and then see if events attached to that project would then move.
    Copy works for events attached to a project. I have also tried copy to a second Library & then to delete the original events.  Again it appears you can not delete events tied to a Project.
    Does anyone know how to archive (move) Projects and/or events in iMovie 10.0.05 under Mavericks 10.9.5 to a second library on an external drive.
    Thanks
    Colroy

  • How do "you" monitor event logs in SCOM 2012? Need opinions.

    Fairly new to SCOM. Do you monitor all event logs? Just warnings and critical? How do you filter out things you don't want to see?
    Looking for opinions here not just a "how-to".
    Thanks,

    Steps in creating a Event based Alerting Rule.
    1. Open the Operations Manager Console. 
    2. Go to Authoring. 
    3. Under Authoring - Management Pack Objects - Select Rules 
    4. Right click on Rules and select - Create a new rule 
    5. Select Alert Generating Rules - Event Based - NT Event Log (Alert) 
    6. On the same screen select your destination management pack and click Next 
    7. Give a name to your Rule and optionally give it a Description. 
    8. Rule Category can be anything you like. 
    9. Select the Rule Target as the class of your choice, normally it can be Windows Computer. 
    10. Make sure the Rule is Enabled and select Next. 
    11. Select the Event log name from where event will be monitored and click Next.  (for example Application or System
    or Security) 
    12. Build the Expression to filter the events with the below details: 
         a. Parameter Name = Event ID, Operator = Equals and Value = (any event id of your choice) 
         b. Parameter Name = Event Source, Operator = Equals and Value = (any source of your choice) (you
    may delete this filter if you want) 
         c. Click on Insert button at Top and it will put the cursor at Parameter Name, click square button
    with 3 dots [...] and it will popup another screen. 
         d. In that box, select the 3rd radio button named 'Use parameter name not specified above' and there
    manually type 'EventDescription' (without quotes) and click OK. 
         e. Then come back to filter screen, now here you will see Parameter Name = EventDescription, and
    for Operator select Contains and then for Value you can type any word you want to key on from the Event description. 
    13. After building the desired Expression, click Next. 
    14. Configure Alerts as you like and click the Create button.
    To get the Alerting event details. Go to Start menu and in Run window type eventvwr.
    And put the details on the wizard as per the below screenshot.
    Refer: http://blogs.technet.com/b/operationsmgr/archive/2008/11/12/opsmgr-2007-how-to-create-an-alert-rule-based-on-an-event-description.aspx
    Gautam.75801

  • How do you cancel a download in iPhone4?

    I inadvertently clicked on a tune I had already downloaded. How do I cancel?
    thanks,
    bobbi

    Bobbi Headder wrote:
    How do I cancel?
    you can't.
    send an e-mail to the iTS customer service using this form and ask the folks there to remove the items from your download queue.
    JGG

  • How do you cancel skype premium????

    The process to cancel skype premium does not seem to work.  I have tried it online, on a Mac and on a Windows computer.  When you go to group video and click the "change my account settings" link, it says I don't have an internet connection.  How do you think I was on the page to be able to even click the button?  I find it interesting that you can sign up for it very easily but cancelling does not work.  I also find it interesting that there is apparently no way to contact anyone at skype to report this as a problem or cancel it.  HOW DO I CANCEL SKYPE PREMIUM?????

    maharoberts wrote:
     HOW DO I CANCEL SKYPE PREMIUM?????
    Please file with Customer Support who will do it for you.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

Maybe you are looking for

  • Cannot Send Email From iMac

    I cannot send email from any of my accounts via any of the asssociated servers, however I can receive mail through any of my accounts and servers. I haven't touched any of the preference setttings for any of the accounts so am really in the dark as t

  • Driving me nuts.. I viewed it great in firefox and chrome but not in internet explorer!! =(

    this is my website.. tcareshop.com It looks awesome in all browsers except for internet explorer.. how can i fix this? pls help!! =(

  • Drag & Drop & Copy and Paste

    Before intalling Leopard I was able to drag jpegs out of safari and onto my desktop or find album artwork and drag it into itunes this feature seems to no longer work. Is there a setting somewhere I can change? Also can no longer copy a URL and paste

  • Is nokia c3-01 supports ovi unlimited music?

    Hi, Two days back i bought Nokia c3-01 mobile. I wanted to download songs from ovi music store. But it asked to activate the subscription, but i didn't receive any voucher code to activate it. ovi unlimited music service is free service or paid  one?

  • [solved] mesa-dri: /etc/drirc exists in filesystem

    EDIT: The following problem was solved by upgrading the system using `pacman -Suy` instead of `yaourt -Suy` The problem was: I'm trying to install mesa-dri, because my system refuses to upgrade. However, it gives me this error. (1/1) checking for fil