Can you dispatch events from a custom component skin?

If so, how?
Thanks~Benny

I'm curious to know if this is possible as well (or really the question should be, is there a non-hackish way to get a reference to the skin instance)?
When I've needed to do something like this, I've always just dispatched an event off a skin part from within my skin. IE.
this.contentGroup.dispatchEvent(...)
Then I would just listen for the event on the skin part.
This is a bit hackish, so it would be nice if someone could share a better solution. I've been meaning to look into it, just never have been able to justify the time looking for a better solution.

Similar Messages

  • Can't receive events with a custom component

    I am using the MDIPanel created by Christophe Coenraets in
    the Sales Builder demo code in Flex 2. However, this custom
    component (MDIPanel) doesn't seem to receive regular events other
    than the custom events. The MDI Panel source code is included as
    entails. Since it extends Panel, I assume that it would get all
    regular events coming in but it is not. For example, I can't use
    resource bundle to change the label text or I can't seem to get
    dataprovider to work within a datagrid inside the MDIPanel. Any
    ideas on what's happening here?
    package
    import mx.core.UIComponent;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import mx.controls.Button;
    import mx.events.ResizeEvent;
    import flash.display.Graphics;
    import mx.managers.CursorManager;
    import mx.containers.Panel;
    import mx.controls.Image;
    import mx.controls.Label;
    import mx.states.SetStyle;
    public class MDIPanel extends Panel
    // Constants for MDI panel event names
    public static var MINIMIZE:String = "minimize";
    public static var MAXIMIZE:String = "maximize";
    public static var CLOSE:String = "close";
    public static var RESTORE:String = "restore";

    I'm curious to know if this is possible as well (or really the question should be, is there a non-hackish way to get a reference to the skin instance)?
    When I've needed to do something like this, I've always just dispatched an event off a skin part from within my skin. IE.
    this.contentGroup.dispatchEvent(...)
    Then I would just listen for the event on the skin part.
    This is a bit hackish, so it would be nice if someone could share a better solution. I've been meaning to look into it, just never have been able to justify the time looking for a better solution.

  • Can you move events from one drive to another easily?

    I've just bought an external firewire drive to dedicate to my Sony HD camcorder material.
    I've only imported 30 mins or so of stuff onto the Mac's internal drive with iMovie '08, and would like to know if anyone's managed to easily copy 'events' from one drive to another to merge/split content.
    Is it just a case of copying event folders from the iMovie Events folder to the external drive, but if so do you have to specify a particular path?
    Similarly, can you just move the individual 'Projects' or archive to DVD etc as they will invariably take up lots of space for longer footage? Does the projects file just hold references to the assembled clips, in which case moving events would scupper things as I seem to have several movie files in there already though these may just be things I uploaded to .Mac to test out.
    This may all be a bit of trial and error. Hopefully clips are only references unlike the pretty huge but self-contained iMovie 6 HD project packages. This also raises issues about how to easily backup all your 'events'.
    AC

    Observation:
    Just imported 15mins of video from the Sony.
    When you click import you are asked which drive to save to.
    As well as the Mac's internal drive, all my attached USB drives which are formatted as Mac OS Extended (journaled) appear as targets to save to as well as teh Firewire drive.
    I selected the Firewire drive and don't recall an option to create a sub-folder. After import a new top level folder of iMovie Events was created, but no others.
    Presumably iMovie Projects/Shared folders only exist on the boot drive.
    I'm assuming that this structure will allow you to share movie Events between Macs using external drives.
    Again, an assumption but I suspect iMovie scans all available suitable hard drives and checks what content is available in top level iMovie Events folders for non-boot drives as well as this folder in the user's Movies folder.
    Rambling observations over for now.
    AC

  • Can you pass parameters from one application component to another?

    I want to have a page of portlets showing applications components (small forms, reports etc) with co-ordinated information.
    That is, I want the user to enter a single criterion in a portlet and then I want all the portlets to respond by querying the results for that single criterion.
    I'm building an interface for a system based on normalized tables with many-to-many relationships and therefore intersecting-entities.
    (I looked at master-detail forms under webdb, so I don't think they'll do the job. I have data from about 6 tables that I want co-ordinated.)
    Links also don't seem to be what I want, because I don't want extra clicks or one portlet to be replaced by another.
    I've seen the Parameter Passing example, and that is the sort of coordination I'd like. In fact that's what gave me the idea. But that is based on custom database portlets, whereas I really want to use Portal forms and reports.
    Is this possible?
    null

    The general Oracle9iAS Portal forum is your best bet for this question.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Creating a button that leads back into the main Pages/States from a custom component

    Hello Y'all! isnt F.C. awesome!
    BUT... just cant get a button that leads from a custom component ive made back into the main bulk of pages and states ive created to work.
    it runs a bit like this:
    Main title page...
                            Photography...
                                                 Nature (on which theres a Custom Component which when clicked leads to...)
                                                            20 different custom component states each with different pics, linked via buttons
    from each of which id love a button that led back to Photography, exiting the custom component
    ive tried the basics:      Add interaction.. when clicked.. play transition to.. state: Photography
    but to no avail
    any ideas? im at a loss!
    thanks in advance,
    Tom

    Cross component communications are an issue in Flash Catalyst 1.0. Thankfully, in Flash Catalyst 5.5 the team addressed some of those issues.
    The only idea I have for remove the 'return' button from within the component, then it should be able to get you back to the home state.
    Or, you might be able to wait a few weeks for the new version of Flash Catalyst to ship (or you can play with the older preview release on labs.adobe.com)
    Chris

  • Change base view state from a custom component

    I'm pretty new to flex and I'm having a small issue in change the view state from a component.
    My Application have 2 custom components called userlogin and main menu. In the main application page I have userlogin component in one state and the main menu component in another. I'm trying to change the state if the login in successful from user login to main menu. I have the following function written inside the login component.
    private function IsUserLoggedIn(evt:ResultEvent):void
                    if (evt.result.islogin.toString() == "true")
                        currentState = "MainMenu";
                    else
                        Alert.show("Login failed, please try again.", "Login Failed");
    This code worked when I had all the controls in the main page. But then I created components and included them in to components and now when the login is success, its giving the following error.
    ArgumentError: Undefined state 'MainMenu'.
        at mx.core::UIComponent/getState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UI Component.as:9908]
        at mx.core::UIComponent/findCommonBaseState()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9928]
        at mx.core::UIComponent/commitCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:9750]
        at mx.core::UIComponent/setCurrentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\ core\UIComponent.as:9701]
        at mx.core::UIComponent/set currentState()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:6087 ]
        at components::UserLoginForm/__btnSubmit_click()[C:\Projects\WarrantyAutomation\src\componen ts\UserLoginForm.mxml:60]
    I'm sure this has something to do with accessing the states from a custom component, but I do not know how to change the state to the main menu. Please help me with this. Any help is greatly appriciated.

    Hi dasun1981,
    private function IsUserLoggedIn(evt:ResultEvent):void
                    if (evt.result.islogin.toString() == "true")
                        currentState = "MainMenu";
                    else
                        Alert.show("Login failed, please try again.", "Login Failed");
    If I am right the above function is in your userlogin component and the two components "userlogincomponent" and "maincomponent" are in main application file and the states were also defined in main application file.
    But in the function above the currentState refers to the state of the userlogin component and not the main application ...but the states are defined in main application file...that's the reason why the exception was thrown...
    Instead you replace the line in the above function with the below line:
    Application.application.currentState = "MainMenu";
    Please mark it as answer if it helped you.
    Thanks,
    Bhasker Chari

  • Handling Event of a custom component

    Hi,
    I created a TwoStateButton from an AbstractButton. As long as it has two states, There's a repaint() occuring when the user clicks on it and it is written within the component.
    I want to also handle the click event from outside the component (actionPerformed, something like that), how can I do this?
    I am relatively new to Java but for God's sake don't answer "Use a JtoggleButton instead". My main goal is to understand the component creation and event handling in Java.
    Thanks,
    Vince D.

    Forget about it, I discovered it myself... Sorry for interrupting
    Vince D.

  • Can you import video from dvcam using a dsr 2000 into final cut pro 10?

    Can you bring video from a DVCam tape using a DSR 2000 into Final Cut Pro?

    Should work OK with the iLink (a.k.a. Firewire a.k.a. IEE1394a) interface, but you may have to capture using iMovie, then ( in FCX) running File > Import > iMovie Events.)

  • Can you transfer photos from iphoto to iphone

    can you transfer photos from iphoto to iphone

    Yes.
    Plug your iPhone into your computer.
    In iTunes, click on your iPhone under Devices in the left panel.
    Click on the Photos tab in the main iTunes screen.
    Check Sync Photos from and select iPhoto from the drop-down menu.
    Choose which albums, events, or faces you want to sync.
    Hope that helps.

  • Can you sync attachments from an iPhone to a Windows PC with Outlook 2007?

    Can you sync attachments from an iPhone to a Windows PC with Outlook 2007? I would like to receive email on the iphone with attachments and then sync the attachments to a Windows XP PC with Outlook 2007 without Outlook 2007 having to connect to the mail server itself and having to separely download the attachment. Is this possible?
    I have only tried one pdf file which downloaded wonderfully to the iPhone. I synced to the PC without the PC being connected to the email account. This also worked except that when I tried to open the attachment on the PC I got a message that the mail wasn't fully downloaded. When I went on=line on the PC, it downloaded the attachment. I would love to have this option because I can't access some email accounts from my corporate computer.

    Can you sync attachments from an iPhone to a Windows PC with Outlook 2007? I would like to receive email on the iphone with attachments and then sync the attachments to a Windows XP PC with Outlook 2007 without Outlook 2007 having to connect to the mail server itself and having to separely download the attachment. Is this possible?
    No it is not. The only information synced regarding email accounts is the email account information only and this is in one direction only - from your computer to the iPhone via iTunes.

  • Can you transfer music from one ipad to another

    can you transfer music from one ipad to another??

    Are you trying to share music with a friend or are you putting music from an old ipad to a new one?

  • Can you move photos from one album to another on IPAD3

    can you move photos from one album to another on an IPAD 3

    These links may be helpful.
    How To Create Photo Albums http://tinyurl.com/cxm4eoq
    How to Add New Albums in the Photos App on the iPad & Add Photos to the Album
    http://tinyurl.com/7qep7fs
     Cheers, Tom

  • How can you transfer data from one ipod to another ?

    How can you transfer data from one ipod to another ipod ?

    The geniusbar told me what to do, I understood but there is still a problem for me >:/ It's not showing up though. Like "device."  Nothing is happening, and I tried as soon as I got home. Then after half an hour, then an hour, then 3 hours. My problem is that it's not showing up! It's stuck in recovery mode! There's still like 25% battery. So I have no idea why.

  • How can you transfer photos from one phone to another

    How can you transfer photos from phone to phone

    If you are trying to get all the photos from an old phone to your new phone, you could sync the old phone which would create a backup containing your Camera Roll. Then connect the new phone and follow the prompts to register and name your new phone. You will then be given the choice of restoring data to your new phone from a backup of the old phone. This will replace any existing data on the new phone with the data from the backup so it's really the best option if the other phone is new.
    Another option would be to connect the phone to your computer and import your photos to iPhoto or the My Pictures folder. Then you could sync the other phone and under the Photos tab in iTunes you could choose the folders/albums of pictures you want on the phone. They will not be in the Camera Roll, but they will be on the phone.
    I hope this helps.

Maybe you are looking for