Actionscript Help for Simple Button Events

Hey everyone,
I'm pretty new to flash and I think this is a fairly simple animation, but I'm not quite sure how to write out the action script for it. I have a website that has very similiar animations to www.cookstreet.net. I have shapes and text that fly in from the bottom when a button is clicked, but I want to get them to fly back out of the top of the screen when any other button is clicked before any new content loads back in from the bottom. What should I add to the action script to tell flash to first check and see if there is content loaded on the screen when a button is clicked, and if there is, to go to the animation that flies that content out of the top and then return to the animation of the new content coming in from the bottom? What I currently have set up for my buttons is:
function handleClick( pEvent:MouseEvent):void
    if( pEvent.target == reel )
        gotoAndPlay("Reel");
    else if( pEvent.target == home)
        gotoAndPlay("Home");
    else if( pEvent.target == news)
        gotoAndPlay("News");
    else if( pEvent.target == film)
        gotoAndPlay("Film")
    else if( pEvent.target == about)
        gotoAndPlay("About")
    else if( pEvent.target == contact)
        gotoAndPlay("Contact")
reel. addEventListener(MouseEvent .CLICK, handleClick );
home. addEventListener(MouseEvent .CLICK, handleClick );
news. addEventListener(MouseEvent .CLICK, handleClick );
film. addEventListener(MouseEvent .CLICK, handleClick );
about. addEventListener(MouseEvent .CLICK, handleClick );
contact. addEventListener(MouseEvent .CLICK, handleClick );
Thanks for the help!
-Sofi

What you can probably do is have a variable that you use to keep track of who's present on the stage, starting it off as a null value.  That way when you click a button if the value is null is skips processing a moving out scenario and jumps to the moving in one.  So your event listeners would be calling a different handler function that first takes care of the moving out needs, if any, which in turn calls the moving in function after the moving out activity is done (or the timeline for moving out does... I don't know how you plan to implement the moving out stuff).  If it is a functiob to function process, the moving out function could pass the event.target to the moving in function so that wouldn't have to change at all, except to add in somewhere wha the new variable value should be.
If what I just offered is one big ball of confusion... take your time and inch your way thru it.

Similar Messages

  • Want to create F1 Help for radio button in my report

    Hi All,
          I want to create F1 Help for radio button in my report program. Which function module should i call in <b>at selection screen on help-request</b>
          Also do I need to define the texts somewhere or I can pass it directly to the function module.

    Try DYN_FIELD_F1_HELP,
    ~Suresh
    that is only for Dic fields..
    Pl take alook at this<a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/79/34a243d9b511d1950e0000e8353423/frameset.htm">SAP Help</a>
    ~Suresh
    Message was edited by: Suresh Datti

  • How to add a custom PL/SQL code for a button event handler

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

    Hi All,
    I am a toddler in using Oracle Portal. So please forgive me for my ignorance.
    Q : How do I add a custom PL/SQL code for a button event handler?
    Basically, I would like to write MY PL/SQL function and call it. I could see that we can write "CUSTOM" code as "PL/SQL button event handler" in the form design window. But the question is that it expects only a "call" to procedure. But where do I define the procedure then? If I insert the procedure from the backend, it gets flushed the next time I compile my form.
    Hope I am able to explain my point.
    Thanks in advance,
    Abbas.

  • F1 help for radio buttons

    Hello All,
       I am getting F1 help when the radio buttons are in display mode but i am not getting F1 help when the buttons are in input mode. what cud be the problem?
    can anyone please help me. required urgerntly
    Thanks & Regards
    Amarender Reddy B

    Hi,
        use  event
       at selection-screen on  HELP-REQUEST FOR 
       rb_radio                                                                               
    As with the addition ON VALUE-REQUEST the field psel_low_high  
    is either the name of a report parameter or of the form sel-LOW
    or sel-HIGH, where sel is the name of a selection criterion.   
    When the user presses F1 on the relevant field, the subsequent 
    processing block is executed. You can thus implement a         
    self-programmed help for the input/output fields of the        
    selection screen. If the program contains such an event and the
    user presses F1, the system processes this rather than         
    displaying the documentation of the Dictionary field - even if 
    the report parameter or the selection option with LIKE or FOR  
    points to a Dictionary field.                                  
    Regards
    amole

  • Flash help for replay button

    I have a simple movie that consists of 1 scene with some
    layers. Each layer
    contains a movie clip and there's an actions layer with a
    stop action. All
    the clips play at once. The clip that contains the ending
    sequence contains
    a replay button. The actionscript is as follows:
    on (release) {
    gotoAndPlay("Scene 1", 1);
    With simple buttons enabled within flash, it does what is
    expected, but when
    I save as a .swf, it goes back to the first frame of the
    movie clip it's
    contained in, not the movie itself. How do I add a replay
    button to a movie
    set up the way I have it?
    Thanks
    -mark

    Thanks for that. I got it to work by simply having the button
    reload the
    movie. I got to thinking that since all the clips play
    through and then stop
    at their respective endings. Going back to the first frame of
    the root may
    not work as the root only has 1 frame and the clips have
    already played
    through. Figured I should reload the movie.
    But I'll try your solution and see if it also works.
    -mark
    > on(release){
    > _root.gotoAndPlay(1);
    > }
    >
    > You don't need to specify a scene name unless you are
    moving outside of the
    > scene.
    >
    > The _root sends the action to the root timeline, so if
    this is inside of a
    > movie clip, the action will happen at the root level.
    >

  • Need emergency help for simple actionscript commands.

    I havent touched flash for awhile and am now using flash professional to try and create a simple visual prop.
    I used to be able to have the movieclip stop on the first frame and then use the keyboard (anykey) to advance frame by frame in the timeline. Now I cant seem to do it and it just keeps playing through and loops in the publish preview.
    As this is now actionscript 3, Im not familiar with how this is being controlled.
    Help would be greatly appreciated as I have to get this out the door tomorrow.
    JM

    See the following posting: I'D LIKE TO CHANGE MY CODE FROM USING THE LEFT KEY=PREVIOUS FRAME/ RIGHT KEY= NEXT FRAME TO  ANY KEY=NEXT FRAME. HERE IS MY CODE.
    The difference with yours would be that instead of using nextFrame(); inside the function, yours would just use play();

  • Getting addActionEvent listener to work for Simple Button Applet

    Hi, im trying to get some simple code running in this little button applet but im having a hard time trying to get NetBeans to allow me to do it. The Code is as follows:
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class Clickers extends Applet
    TextField text1;
    Button button1, button2;
    public void init()
    text1 = new TextField(20);
    add(text1);
    button1 = new Button("Welcome To");
    add(button1);
    button1.addActionListener(this);
    button2 = new Button("Java");
    add(button2);
    button2.addActionListener(this);
    public void actionPerformed(ActionEvent e)
    if (e.getSource() == button1)
    text1.setText("Welcome To");
    if (e.getSource() == button2)
    text1.setText("Java");
    upon compiling i get the error:
    addActionListener(java.awt.event.ActionListener) in java.awt.Button cannot be applied to (Clickers)
    for both the buttons.
    can someone explain why???
    Thanks
    Richard.

    Its ok just realised didnt implement ActionListener

  • Help for Control Level Events

    Dear Friends
    i had an internal Table Itab_emp
    before saving from belowcode i want to check for a particular field
    i had itab_otime which had value as time format for particular ids
    so i want to add them for a id and check condition
    output of itab_emp is
    PERID Date OTIME 
    1      01.10.2007 013000
    1      03.10.2007 001000
    2      04.10.2007 000030
    2      05.10.2007 001000
    i want to add values for perid 1 and 2 and see the sum of that in a field in itab only so that i can apply condition
    Hope u got my problem
    Reflect changes in below code
    i think control level events will help but How i dont know
    SORT ITAB_EMP BY PERID.
      LOOP AT ITAB_EMP WHERE MARK = 'X' .
        IF SY-SUBRC = 0.
    MOVE-CORRESPONDING ITAB_EMP TO ITAB_OTAPP .
          ITAB_OTAPP-OBJID = 1.
          ITAB_OTAPP-TODTE = ZHR_PR_M_OTAPP-TODTE.
          ITAB_OTAPP-FRDTE = ZHR_PR_M_OTAPP-FRDTE.
          ITAB_OTAPP-IMMHD = ZHR_PR_M_OTAPP-IMMHD.
          ITAB_OTAPP-CRETM = SY-UZEIT.
          ITAB_OTAPP-CREON = SY-DATUM.
          ITAB_OTAPP-CREBY = SY-UNAME.
          APPEND ITAB_OTAPP.
        ENDIF.
      ENDLOOP.
      LOOP AT ITAB_OTAPP INTO WA_ITAB_OTAPP.
        MODIFY ZHR_PR_M_OTAPP FROM WA_ITAB_OTAPP.
      ENDLOOP.
    Hope will get answer as soon as possible
    Please Help Out Genius
    With Best Regards
    Ruby

    Dear Friends
    i had an internal Table Itab_emp
    before saving from belowcode i want to check for a particular field
    i had itab_otime which had value as time format for particular ids
    so i want to add them for a id and check condition
    output of itab_emp is
    PERID Date OTIME 
    1      01.10.2007 013000
    1      03.10.2007 001000
    2      04.10.2007 000030
    2      05.10.2007 001000
    i want to add values for perid 1 and 2 and see the sum of that in a field in itab only so that i can apply condition
    Hope u got my problem
    Reflect changes in below code
    i think control level events will help but How i dont know
    SORT ITAB_EMP BY PERID.
      LOOP AT ITAB_EMP WHERE MARK = 'X' .
        IF SY-SUBRC = 0.
    MOVE-CORRESPONDING ITAB_EMP TO ITAB_OTAPP .
          ITAB_OTAPP-OBJID = 1.
          ITAB_OTAPP-TODTE = ZHR_PR_M_OTAPP-TODTE.
          ITAB_OTAPP-FRDTE = ZHR_PR_M_OTAPP-FRDTE.
          ITAB_OTAPP-IMMHD = ZHR_PR_M_OTAPP-IMMHD.
          ITAB_OTAPP-CRETM = SY-UZEIT.
          ITAB_OTAPP-CREON = SY-DATUM.
          ITAB_OTAPP-CREBY = SY-UNAME.
          APPEND ITAB_OTAPP.
        ENDIF.
      ENDLOOP.
      LOOP AT ITAB_OTAPP INTO WA_ITAB_OTAPP.
        MODIFY ZHR_PR_M_OTAPP FROM WA_ITAB_OTAPP.
      ENDLOOP.
    Hope will get answer as soon as possible
    Please Help Out Genius
    With Best Regards
    Ruby

  • Request help for Simple Itinerary (tricky one)

    Hi
    I am trying various scenarios for itineraries. I am stuck in simple itinerary solution where i have  my schema exposed as (request and reponse) web service and one itineray service to transform it and finally send it back to the WS response.
    I  tried including Offramp but i guess i will not be able to include the servicename, state, type properties. Can someone help me how i can create itineraries for such instances.
    I could able successfully complete the scenario where my schema exposed as web service and then transform and invoke another web service and finally the response of the second web service for sent back my original web service. But the above simple scenario
    i am totally baffled.
    ram

    There are samples inside the ESB Toolkit that show exactly how to invoke a service  using the ESB Toolkit. You can find the specific
    sample here: C:\Program Files\Microsoft BizTalk ESB Toolkit 2.0\ESBSource\Source\Samples\MultipleWebServices. You will have to first unzip the ESBSource.zip file that comes with the default ESB toolkit installation.
    There are also How-to's which are step by step instructions on how to do this inside the ESB documentation.  You can get the documenation here:
    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bc86cf1e-ef29-4b19-95f7-388f64555090 
    Inside the Documentaion under Development Activities there are How-to's which provide step by step instructions on how to Route messages to a Service. (Even though this how to is based off of ASMX, the same principal applies.)
    You can also look into earlier MSDN Post in below link
    Consume Web Service from ESB Toolkit 2.1
    Thanks
    Abhishek

  • Little help for simple gallery

    Hi, i use a very simple spry gallery. the xml format is this
    <photos>
    <photo pathtn="..." path="..." description="..." />
    <photo......
    <photo......
    </photos>
    Then on the thumbnails div i've got a spry:repeat and a
    spry:setrow to set the content of the spry:detailregion which shows
    the large image and the description. The gallery works very well,
    but what i'd like to do is to change the aspect of the active
    thumbnail...Nothing too complicated..just a thicker border ...how
    could i do this?
    thanks!

    I don't know if this is best way to do it, but I wrapped my
    thumbnails section in a div called "thumbnails" to which i applied
    the spry:region="dsPhotos dsGalleries dsGallery".
    From here, I entered my spry div:
    <div spry:repeat="dsPhotos"
    onclick="HandleThumbnailClick('{ds_RowID}');"
    onmouseover="Spry.Effect.AppearFade('tn{ds_RowID}',
    {duration:1000,from:100,to:20,toggle:true})"> <img
    id="tn{ds_RowID}" alt=""
    src="galleries/{dsGalleries::@base}{dsGallery::thumbnail/@base}{@thumbpath}"
    width="24" height="24" /></div>
    Then I closed the thumbnails div.
    From here, I simply created a #thumbnails rule in my css
    file, and changed my border like so:
    #thumbnails img {
    padding: 1px;
    clear: none;
    float: left;
    height: 24px;
    width: 24px;
    margin-top: 5px;
    margin-right: 5px;
    margin-bottom: 0px;
    margin-left: 0px;
    border: 2px solid #CCCCCC;
    Hope this helps!

  • Help for simple java question

    May i know how to set the image .jpg or gif into the label ?
    how to get the time in this format::Monday 12th Jan 2004
    thanks

    Hi,
    If i want click the button then the image of the JLabel will be change.. how to write in syntax?
    i know the c1 = new JLabel(new ImageIcon("sysImage/Send.gif"));
    but i want another image after click command button.
    is it c1.setImageIcon("abc.gif"); ? i try,but error..
    how to apply the date fill into syntax? i not really know read the API
    thanks

  • Not able to capture button event in extended controller

    Hi Gurus,
    I am not able to capture the button event (of seeded controller) in extended controller.
    I have written code in extended controller like below:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
        String str = pageContext.getParameter("event"); // copied from seeded controller for the button event //
          if ("editLines".equals(str)) {
            //cutom validation
      super.processFormRequest(pageContext, webBean);
    Please help me in resolving the issue.
    Thanks,
    Srinivas
        ///my cutom validateion

    Hi Bm,
    Thanks for your response.
    I have tried the same but no luck.
    Please help in getting this resolved.
    Thanks,
    Srinivas

  • Help with creating multiple events for a single button

    I have a basic gui that is used to view a query. There is a JTextArea where the infromation from the query displays. Now i also have JTextAFields that correspond to each column from the table that i am querying from. I have an edit button that will take the current query (which i have a reference to) and put in each JTextField the correct information (it re exectutes the query given the id of the current result in the query, and sets the text in each field).
    All this works fine.. Now the text fields have been filled in, and the user can change them accordingly. I set the text of the edit button to say update, and i add an action listener within the current listener for that button.. When the update button is pressed, everything is fine.. However, after that, the listener has changed and i get exceptions everytime i press edit.. Below i have made it so that i create a new action when the edit button (named update that after they press it, it then displays update.. and the insert button changes to insert.. now an insert query is different than an update so i can't just enable only insert or anything like that).
    is there any way to have 1 button that can do different things depending on the context? I can't figure out how to do it..
    here is what i have as far as listeners for my buttons
              ButtonHandler buttonHandler = new ButtonHandler();
             exit.addActionListener(buttonHandler);
             first.addActionListener(buttonHandler);
             prev.addActionListener(buttonHandler);
             next.addActionListener(buttonHandler);
             last.addActionListener(buttonHandler);
              insert.addActionListener(new insertButtonAction());
              delete.addActionListener(new deleteButtonAction());
              update.addActionListener(new editButtonAction());
              rollback.addActionListener(new rollbackButtonAction());
              commit.addActionListener(new commitButtonAction());
              sendQuery.addActionListener(new sendQueryButtonAction());
         class ButtonHandler implements ActionListener {  // this is a Controller class
           public void actionPerformed (ActionEvent e) {
              JButton b = (JButton)e.getSource();
              try {
                 if (b==first) {
                    if (result.first())
                       updateText();
                 else if (b==prev) {
                    if (result.previous())
                       updateText();
                    else
                       prev.setEnabled(false);
                 else if (b==next) {
                    if (result.next())
                          updateText();
                    else
                       next.setEnabled(false);
                  else if (b==last) {
                     if (result.last())
                        updateText();
                  else if (b==exit) {
                     db.close();
                     f.dispose();
                     System.exit(0);
               catch(SQLException ex) {
                     System.out.println("Could not perform operation()\n" +  ex.getMessage());
         private class insertButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   feedback = insertEntry();     
         private class editButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   try {
                        int ID = result.getInt(1);
                        update.setText("update");
                        insert.setText("cancel");
                        delete.setEnabled(false);
                        rollback.setEnabled(false);
                        sendQuery.setEnabled(false);
                        Statement qStatement = conn.createStatement();
                        String qs = "select EMPNO, ENAME, JOB, MGR, HIREDATE, " +
                             "     SAL, COMM, emp.DEPTNO " +
                           "from emp WHERE empno = " + ID;
                      ResultSet rs = qStatement.executeQuery(qs);
                        rs.next();               
                       enoField.setText(rs.getString(1));
                        enameField.setText(rs.getString(2));
                        jobField.setText(rs.getString(3));
                        mgrField.setText(rs.getString(4));
                        hdateField.setText(rs.getString(5));
                        salField.setText(rs.getString(6));
                        commField.setText(rs.getString(7));
                        dnoField.setText(rs.getString(8));
                   } catch (SQLException ex) {
                       area.setText("Could not fetch row because of " + ex.getMessage());
                   update.addActionListener(new updateButtonAction());
                   insert.addActionListener(new cancelButtonAction());
                   /*Although this compiles and works the first time, after i've
                    it no longer works after that */
              class updateButtonAction implements ActionListener {
                   public void actionPerformed( ActionEvent e ) {
                        feedback = updateQuery();
                        area.setText(feedback);
                        resetButtons();
                        clearFields();
                        update.setEnabled(false);
              class cancelButtonAction implements ActionListener {
                   public void actionPerformed( ActionEvent e ) {
                        resetButtons();
                        area.setText("Operation Canceled");
                        clearFields();
                        update.removeActionListener(e);
         private class deleteButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   try {
                        feedback = deleteEntry(result.getInt(1));
                        area.setText(feedback);
                   } catch (SQLException ex) {
                      area.setText("Could not fetch row because of " + ex.getMessage());
         private class rollbackButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   try {
                        Statement rstmt = conn.createStatement();
                        rstmt.executeQuery("rollback");
                        area.setText("Rollback Successfull.");
                   } catch (SQLException ex) {
                        area.setText("Could not rollback.");
         private class commitButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   try {
                        Statement rstmt = conn.createStatement();
                        rstmt.executeQuery("commit");
                   } catch (SQLException ex) {
                        area.setText("Could not commit changes.");
         private class sendQueryButtonAction implements ActionListener {
              public void actionPerformed( ActionEvent e ) {
                   query(db, selectQ);
        void resetButtons(){
             insert.setText("Insert");
             update.setText("Edit");
             delete.setEnabled(true);
             rollback.setEnabled(true);
             sendQuery.setEnabled(true);
       any suggested would be appreciated

    App message delivery is not retried in B2B, rather failed messages are delivered to the IP_IN_QUEUE. Please enable the logging for B2B engine in TRACE 32 mode and run a test to reproduce the behaviour. Post the log here or mail across to my id (in my profile).
    Regards,
    Anuj

  • Simple button help needed!

    I want to make a simple round button that glows when you
    mouse over it and depresses when you click it.
    Apparently to do this I need to use Filters to make the glow
    and bevels. But Filtersonly work on movie clips, buttons and text.
    So I make a circle and convert it into a button symbol
    (Btn1). Then I make another button symbol (Btn2) and use the first
    button symbol (Btn 1) on the Up Over and Down frames of Btn 2.
    Assorted Filters are applied to Btn 1 on the Up Over and Down
    frames to get the effects I want.
    I test the button (Btn2) using Enable Simple Buttons. It
    works perfectly - glows on mouse over and depresses on click. Then
    I try Test Movie -- and the button doesn't work!!!
    Not does it work when exported as a SWF file!!!
    I watched a tutorial video that came with my Flash Pro 8
    Hands-On-Training (HOT) book and he used pretty much the same
    technique -- except he only tested his button with Enable Simple
    Buttons. I'll bet my house his didn't work with Test Movie either!
    The stupid thing, is I was just able to achieve exactly what
    I wanted very quickly using LiveMotion 2!
    What is wrong here? Why is it so impossible to create a glow
    button in Flash? Why has it been easy in Live Motion for years?
    All help appreciated!
    Thanks
    craig

    I thought the nesting button situation might be the problem
    BUT there is no other way to apply Filters to Up, Down, etc. Also,
    a freaking tutorial book described that as a valid method, but
    obviously it ain't.
    I tried using movieclips as well but basically had the same
    problem.
    I mentioned LiveMotion 2 because that ancient program can do
    easily what Flash Pro 8 seems incapable of.
    What is the logic behind not allowing Filters to be applied
    to simple graphics? It's absurd!
    There's got to be a way...

  • How to add a new button in IC tool bar and handle the event for the button?

    Hi,
        I am working on CRM 2007 Interaction center. To add a new button to IC toolbar, customizing is available to define a new button and then assign in to the profile.
    In SPRO->CRM->IC webclient->Customer Specifc System Modifications->Define Toolbar Buttons, I defined one new button with ID ZSTART.
    Now in SPRO->CRM->IC webclient->Basic Functions->Communication Channels->Define Toolbar Profiles , I selected Default profileid and in Generic Layout Buttons Tab, I added the new button ZSTART in Position 3.
         So after completing the customizing when the user logs in using role IC_AGENT,  the button (with ID:ZSTART) gets displayed in the IC toolbar too.
          Now on click of this button, I need to create an object.
    To do so, I have to catch the event which is raised by this new button.
           Please let me how to implement the event handler for this new button. What will be the event name for this button click event and how I can subscribe for it ?
         Please let me know if anyone of you have already worked on similar requirements.
    Regards,
    Manas.
    Edited by: manas sahoo on Jul 22, 2008 7:49 PM

    Hello Manas,
    There are a couple of threads in the community that might help you out (if you haven't already found them):
    Re: IC Web Client Toolbar
    /message/3621917#3621917 [original link is broken]
    Regards,
    Renee Wilhelm
    Edited by: Renee Wilhelm on Nov 6, 2008 7:46 PM

Maybe you are looking for