Easiest way to send an event from a custom component

Hello
I have a custom login form, and I would like to create an event that is raised when the authentication returns true from the server. Right now I have a result event in the component to handle the Boolean condition of webservice. I tried simply instantiating a new event (public var auth:Event = new Event () ;) inside the element and the distribution of this event of the logic of the Manager resultEvent. But, outside the element, not no symbol bit next to the auth event lightning bolt as appropriate to call an event from the mxml.

I want to be able to instantiate this event since the mxml listener and manage the event from outside the custom component. Should which model I use to encapsulate the event?

Thank you
JED

Amy Blankenship was very helpful with his post to:
http://flexdiary.blogspot.com/2007/08/dispatching-events.html

Handycam was also OK, but missed me the key I needed.

And would work on the idea of Greg, but I wanted to encapsulate the event so that the handler in myComponent.parent could be instantiated in this component.

Here's what I ended up doing:

in the mxml component


[Event (name = "authenticated", type = "flash.events.Event")]

The logic of management in the method

private void testValidation(event:ResultEvent):void
{if(event.result == true) dispatchEvent (new Event ("authenticated")) ;}}

in the main application

When you use the meaning of code in Flex Builder, "authenticated" came as a selection of events valid.

Thanks again everyone,
JED

Tags: Flex

Similar Questions

  • Changing the State of the application from a custom component

    Hello, I have several custom components that are included in the original application.

    When I try to change the State of a custom component, I get an error saying "undefined state: name of the State." How can I change the State of the application from a custom component? All States are defined in the original application.

    @linrsvp,.

    If you are using Flex3 try Application.application.currentState = "somestate;

    If you use Flex4 try FlexGlobas.topLevelApplication.currentState = "somestate;

    Don't forget to import the namespaces corresponding to the above.

    Thank you

    Jean Claude

  • The easiest way to send photos now of Hotmail.

    I don't want to use the photo gallery or new features of Windows Live has put out., I just click on join go to my photo program and click on the folder of photos I want to send. That's what I was doing. Now I can not do more. It's so frustrating. Why not WindowsLive/Microsoft/Hotmail leave things alone when they work perfectly well for their users and are easy to use. Forget about Skydrive! KISS (keep it simple, stupid) is always a very good way to venture IT innovators. Lilac.

    I don't want to use the photo gallery or new features of Windows Live has put out., I just click on join go to my photo program and click on the folder of photos I want to send. That's what I was doing. Now I can not do more. It's so frustrating. Why not WindowsLive/Microsoft/Hotmail leave things alone when they work perfectly well for their users and are easy to use. Forget about Skydrive! KISS (keep it simple, stupid) is always a very good way to venture IT innovators. Lilac.

    I can always send attachments (up to a size... I think it is a little less than 25 MB) using a hotmail account, I had... Well, that 'long '.

    The trick is to stay under the limit of size - including every email service provider I know.

    Now - as far as I know the * page web interface * for hotmail/windows live mail allowed never you just select a "folder" - you were always select individual files... but if I knew a whole folder was less than 25MB - CTRL + A, after clicking on the attachments and necessary to the folder navigation works very well for me.

  • Send an event from one class to another

    I have been racking my head hit the walls on every corner on this issue. Heh, if I had hair on my head that it would have been all ripped off hours, not days ago! Good, hours. =)

    The problem:

    I have two classes of documents. The main document class creates an empty clip and adds to the scene in which classes of second published swf is loaded in. The second document class has a button for the scene in which once clicked fair traces "Hello" in the output window.

    What I want to do, is when you click on this button, an event is dispatched to the second class of document, to the main document class. Now, I googled all this world known and attempted to implement the examples without result. I am really at a loss at this moment yet stubbornly, I intend to keep hitting my head against the problem.

    Below, I glued the two classes of documents less examples I tried to implement so far.

    Any contributions to this number will be most graciously appreciated!

    ~ e

    And as an alternative, you can leave the bubble of the button event... (the second parameter of the event set to true)

  • Custom component AS3 / the event for MXML Tag definition


    Custom component AS3 / the event for MXML Tag definition
    Expose a custom in the custom MXML tag event.



    I made a custom AS3 component named "CustomListComponent".
    Is a list type component which extends UIComponent.

    When an element is selected (selected) I generate a custom event named, 'selChange '.

    I want the user to be able to use this tag, set a handler on the MXML tag.
    I tried to use metadata as [vent ("selChange")] in the file of AS3 components with no luck.

    Any help / examples to expose a custom event from a custom component AS3 for the MXML tag for the developer/end user would help considerably.

    Anyone? Thank you.

    To send the event in an AS3 component, try the following. The click event is simply to show you the idea. The event generated by the interaction of the user (or programming) could be anything.

    TS

  • Satellite C655 - easiest way to burn a DVD

    Hello
    I've never had a laptop before. Also new to windows 7. Try to find the easiest way to burn a DVD from another DVD on this new laptop computer. I know I put the info from the DVD on the laptop. And then burn it to a blank DVD. I can put the DVD in the drive. It's a great start! I'm looking for the easiest way to "rip" and burn. Even if you need to download burning software (I hope it's free).

    On my desktop CD burner, it was quite easy to burn to a CD to another CD. 2 trays and software to burn. I know that it is more complex. I'm a little computer in question, btw. Thanks :)

    Hi lili60,

    Most of the DVDs and CDs you can buy is copy protected so I doubt you will be able to copy them. Usually, you can copy only the records of friends private photos, music, etc. but regular discs are protected against copying.

    To burn discs, you can use the freeware CD Burner XP tool. This s really nice tool that provide all the functions necessary to burn discs. You can download the tool here:
    http://CDBurnerXP.se/

    On the same page you can also find assistance online, how the program works.

    If you have any other questions, please let us know! :)

  • Distribution of events from a PopUp.

    Can someone tell me how to send an event from a PopUp at the initial request?

    When in doubt, I use the system root "dispatchEvent addEventListener/removeEventListener and.» Not cool perhaps, but...

    Here is an example:

    SystemManager.getSWFRoot (THIS) .dispatchEvent (new CustomEvent (CustomEvent.XML_DATA_ARRIVAL));

    ... with...

    SystemManager.getSWFRoot (THIS) .addEventListener (CustomEvent.XML_DATA_ARRIVAL, onXMLDataArrival, false, int. MAX_VALUE);

    ... and...

    SystemManager.getSWFRoot (THIS) .removeEventListener (CustomEvent.XML_DATA_ARRIVAL, onXMLDataArrival);

  • listening in the main application for event from custom component

    I have a component that custom im using an identifier.  I watch videos and tutorials on how to pass variables between applications and custom components. the problem im having is that tutorials or explanation you put the event on the custom component and then it refers to a function in the main application.

    Is a fair way to listen on the main application at the event begins? Ive been tempting for hours and I know there must be something im missing may not be so difficult. any help, I would be really grateful.

    Thank you

    Miguel

    Hello

    The following example has been done as a simple demonstration of States, but the connection (state1) component, is a simple custom event which is sent by the ok button on the connection, the event could be extended to transfer the information to connect to the main application, in this case because the login screen is always public vars or fields of the box would be available for the main application anyway.

    http://gumbo.flashhub.NET/Wizard/ source included

    David.

  • Sending events from instances of the class

    Hello
    I have problems with dispatching events from instances of class.
    In a simple MXML application, I added an event listener for a custom event.
    In accordance with the rules of good practice MVC, I have a template with a single instance (singleton pattern) class. This instance has no reference to my MXML component. When my model receives the data from the server, I want to send an event of this forum (which isn't in the displayList!). I could solve that problem with a model of the observer, but there is no way to any shipment of the event?
    Help much appreciated!
    Dany

    Hello Cesare,

    It works indeed! Thanks a lot for your help here!

    Dany

  • Easiest way to transfer photos from iMac iPad

    Bcause I find iTunes so very complicated, and not at all easy to use, including at - it another way to transfer my photos from my iMac to my iPad?  If there is no other way how to deal with iTunes?

    Thank you.

    I'm not sure other methods, but to put the photos from the computer to the iPhone, we use iTunes to sync the photos. See this support document for further instructions. Keep your photos safely stored and updated on all your devices - Apple Support

  • I use the browser firefox and gmail. Is there a (fairly easy) way to send photos other tha

    is repeat, a relatively easy way to send photos of zombrowser other than outlook express?

    Would be relatively easy to export the images to a folder and then attach them to your message from Gmail.

    ZoomBrowser wants an e-mail client; It will not work with web-based e-mail programs.

  • BlackBerry® Smartphones sending E-mail from a PC to BBM?

    Is there a simple way to send someone a BBM message by e-mail from a PC or something else? I think perhaps using an e-mail address with the identification number of the user followed by a domain name, something like "[email protected]" or something like that?

    No, this is not possible.

  • Is anyway to send a message from one computer to another homegroup?

    Is anyway to send a message from one computer to another homegroup?

    Hi westreg,
     
    Welcome to the Microsoft Windows answers Forum community!
     
    What message do you send?
     
    Here is a link to 'How to use Homegroup?': http://windows.microsoft.com/en-us/windows7/help/home-sweet-homegroup-networking-the-easy-way

    I hope this helps!
     
    Thank you, and in what concerns:
    Aziz Nadeem - Microsoft technical support.
    Visit our http://social.answers.microsoft.com/Forums/en-US/answersfeedback/threads/ Microsoft answers feedback Forum and let us know what you think.

  • When you try to send a file from a Web site, I get a message that doesn't say "none created a profile. Use mail icon in Control Panel.

    When you try to send a file from a Web site, I get a message that doesn't say "none created a profile. Use mail icon in Control Panel.  I searched and can't find this icon.  Can you give me way better?

    You must set up your default email program to send on a Web site.  Go to control panel | Default programs and set your default e-mail program there.  If your e-mail program is web-based, then you probably can't use this feature (sends the Web site file), then you may need to copy the site, and then paste it into a new message and then send it.

    Steve

  • Send an object from client to server always a button

    What I need is to send an object from client to server, but I need server wait for another object is sent. What I have, it's the JFrame where you put the name and surname, then you create a user with these details object and you press the button send this object on the server. Just, I can't keep the connection because when I send the first object, the server does not wait for another button click and survey EOFexception. Creating the while loop is useful both because it continues to send the same object again and again. The code is here
    public class ClientFrame extends JFrame {
    
        private JButton btnSend;
        private JTextField txfName;
        private JTextField txfSurname;
    
        public ClientFrame() {
            this.setTitle(".. ");
    
            Container con = this.getContentPane();
            con.setLayout(new BorderLayout());
    
            txfName = new JTextField("name");
            txfSurname = new JTextField("surname");
    
            btnSend = new JButton(new AbstractAction() {
    
                @Override
                public void actionPerformed(ActionEvent e) {
                    SSLSocketFactory f =
                            (SSLSocketFactory) SSLSocketFactory.getDefault();
                    try {
                        SSLSocket c =
                                (SSLSocket) f.createSocket("localhost", 8888);
    
                        c.startHandshake();
    
                        OutputStream os = c.getOutputStream();
                        ObjectOutputStream oos = new ObjectOutputStream(os);
                        InputStream is = c.getInputStream();
                        ObjectInputStream ois = new ObjectInputStream(is);
    
                        
                        boolean done = false;
                        while (!done) {
                            String first = txfName.getText();
                            String last = txfSurname.getText();
                            User u = new User();
    
                            u.setFirstName(first);
                            u.setLastName(last);
                            oos.reset();
                            oos.writeObject(u);
    
                            String str = (String) ois.readObject();
                            if (str.equals("rcvdOK")) {
                                System.out.println("received on the server side");
                            } else if (str.equals("ERROR")) {
                                System.out.println("ERROR");
                            }
                        }
    
    
    
    
                        //oos.writeObject(confirmString);
    
                        oos.close();
                        os.close();
                        c.close();
    
                    } catch (ClassNotFoundException ex) {
                        Logger.getLogger(ClientFrame.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (IOException ex) {
                        System.err.println(ex.toString());
                    }
                }
            });
            btnSend.setText("send object");
            con.add(btnSend, BorderLayout.PAGE_START);
            con.add(txfName, BorderLayout.CENTER);
            con.add(txfSurname, BorderLayout.PAGE_END);
            this.pack();
            setSize(200, 150);
            setVisible(true);
        }
    }
    
    public class TestServer {
    
        public static void main(String[] args) {
            
            try {
                KeyStore ks = KeyStore.getInstance("JKS");
                ks.load(new FileInputStream(ksName), ksPass);
                KeyManagerFactory kmf =
                        KeyManagerFactory.getInstance("SunX509");
                kmf.init(ks, ctPass);
                SSLContext sc = SSLContext.getInstance("TLS");
                sc.init(kmf.getKeyManagers(), null, null);
                SSLServerSocketFactory ssf = sc.getServerSocketFactory();
                SSLServerSocket s = (SSLServerSocket) ssf.createServerSocket(8888);
                printServerSocketInfo(s);
                SSLSocket c = (SSLSocket) s.accept();
     
    
                InputStream is = c.getInputStream();
                ObjectInputStream ois = new ObjectInputStream(is);
                OutputStream os = c.getOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(os);
                boolean done = false;
                User u;
                
                  while(!done){
                      
                    
                    u = (User) ois.readObject();
                    String confirmString = "rcvdOK";
                    String errorString = "ERROR";
                    if (u != null) {
                        System.out.println(u.getFirstName() + " " + u.getLastName());
                        oos.writeObject(confirmString);
                    } else if (u == null) {
                        oos.writeObject(errorString);
                    }
                    
                    
                
                }
    
                is.close();
                s.close();
                c.close();
    
            } catch (Exception e) {
                
                    System.err.println(e.toString());
                
                
            }
        }
    
       
    }
    Thanks for any help, btw, it does not need to be over ssl, the problem would be the same as using the http protocol. Please someone help me :)

    Published by: Vencicek on 7.5.2012 02:19

    Published by: EJP 05/07/2012 19:53

    Published by: Vencicek on 7.5.2012 03:36

    I responded to that. Do not call the methods of networking in the thread of events, or in a constructor.

Maybe you are looking for

  • download problem

    After that I have updated my firefox 32 beta stock of trial download to the end and not finished downloading

  • How to fix the freezing Safari bug?

    Message came on screen something called macalarmsystem (I think) saying Safari crashed, please contact such or such a number. The screen was frozen, could do nothing. I force quit and I didn't call. But whenever I click on Safari this bug keeps poppi

  • Skype crashing after connecting a call.

    Hi, I called my friend one day and it went off normally but after a few seconds, my Skype comes from crushed, which I suppose was trying to pick up. I tried several times over again, and even with the test call but it sounds and when it should be lin

  • Memory & housing SIM of bike g 3rd gen

    Hello I have a few basic queries on my new phone Moto G 3rd Gen a. MotoG 3rd Gen in India has 2 slots SIM, but the 3rd Gen MotoG in the United States has a SIM card slot. All the answers on this? b. also, I bought this phone in version 16 GB and 2 GB

  • V560 missing link on the tab search product

    Hello I noticed this lack of link V560 when we are looking for prodcut pilots. Please refer to the below captured image.