Error message: 1021: Duplicate function definition.

Hi All,
First let me start by saying that I know next to nothing about Flash.  I have inherited a website maintenance project that has a Flash rotating image banner.  I have managed to get the images to fade-in and fade-out correctly, but now I need to make these images clickable - linking images to pages in the website.  I have read many posts here and have reviewed the video tutorials.  I have been able to get the first image clickable using this AS3 action:
mars_btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent) :void {
        navigateToURL(new URLRequest("http://somewebsite/mars.php"));
        trace("I'm clicked");
However, when I attempt to make another image clickable by using a different instance of a button I get the error message:
1021: Duplicate function definition.
I have a separate instance of a button with this AS3 action:
jupiter_btn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent) :void {
        navigateToURL(new URLRequest("http://somewebsite/jupiter.php"));
        trace("I'm clicked");
Obviously I'm not understanding how I'm supposed to do this so that I don't create a duplicate function definition.  Any help would be most appreciated.

excuse me , I have a question i hope that you help .. ( im new in here )
we were asked to create an interactive application on flash in two languages..
so i created two different fla files same exact codings ... i was wondering how can i combine them so the viewer can be able to choose the language from a button ?
when i try to combine them i get lots of errors of duplications in the actionscript
PS : MY MAIN PAGE INCLUDES A CAROUSEL with images ..
I was thinking of saving one of the fla  as a movie and then add it some how to the second fla and combine it with a button but i can't figure it how..
i hope i was clear enough.. but is there any possibility to help me please ?!
when i tend to change names or something it creates error.. ( IM NOT A PRO IN AS3 ) and when i dublicate the scenes it give duplication errors.. WHAT IS THE SOLUTION ??
this is the code of the actionscript in the main page.. ( the carousel's code i took from someone ) and i used it on my project
import com.ccanvas.carousel.*;
var centerX:Number = stage.stageWidth/4;
var centerY:Number = stage.stageHeight/4;
var carc:Carousel = new Carousel(centerX, centerY, 256, 75, "icons.xml");
carc.addTooltip(new tooltip); // use 'tooltip' movieclip for item tooltip
addChild(carc); // add carousel to stage
function down(event:MouseEvent):void {
trace(event.currentTarget.toolText); // simple click interaction
function destroyCarousel(event:MouseEvent):void {
carc.destroy(); // remove all item in carousel as well as tooltip
function removeNextItem(event:MouseEvent):void {
if(carc.numOfItems > 2) {
  carc.removeItem(2); // remove the item next to the remove item icon
create.addEventListener("mouseDown", createCarousel);
function createCarousel(event:MouseEvent):void {
if(carc.CREATED == false) {
  // recreate the carousel
  carc = new Carousel(centerX, centerY, 256, 75, "icons.xml");
  carc.addTooltip(new tooltip);
  addChild(carc);
}/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
Tools_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
function fl_ClickToGoToScene(event:MouseEvent):void
MovieClip(this.root).gotoAndPlay(1, "Toolse");
}/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
games_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToGames);
function fl_ClickToGoToGames(event:MouseEvent):void
MovieClip(this.root).gotoAndPlay(1, "Gamese");
}/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
Identity_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToIdentity);
function fl_ClickToGoToIdentity(event:MouseEvent):void
MovieClip(this.root).gotoAndPlay(1, "Identitye");
}/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
Reviews_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_13);
function fl_ClickToGoToScene_13(event:MouseEvent):void
MovieClip(this.root).gotoAndPlay(1, "Reviewse");
}/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
Facts_button.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_20);
function fl_ClickToGoToScene_20(event:MouseEvent):void
MovieClip(this.root).gotoAndPlay(1, "Factse");

Similar Messages

  • 1021: Duplicate function definition I am lost... please advise

    I am obviously new to as3... So I have 3 buttons (all in the same scene) that each need to go to a different scene. I put the script's on the same frame. Here is the script's:
    btn_pg.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);function mouseDownHandler(event:MouseEvent):void {
    gotoAndStop(1, "photo_gallery");
    btn_vg.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);function mouseDownHandler(event:MouseEvent):void {
    gotoAndStop(1, "photo_gallery");
    This is the error message it gives me:
    home_1, Layer 'actions', Frame 1, Line 8 1021: Duplicate function definition.
    What do you have to do to use the same function for different buttons to get to different scenes?
    Thank you for any consideration and help,
    Thomas

    I tried to ad another button to that same code and it does not give an error but when i publish it doesn't do anything...
    This is the code after I added:
    btn_pg.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    btn_vg.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void
    var nameOfButton:String = event.currentTarget.name;
    if (nameOfButton == "btn_pg")
      gotoAndStop(1, "photo_gallery");
    else if (nameOfButton=="btn_vg")
      gotoAndStop(1, "video_gallery");
    else if (nameOfButton=="btn_b")
      gotoAndStop(1, "blog");
    Can you not have an infinite amount of buttons with this code?
    Thanks again
    Thomas

  • Duplicate function definition error on buttons

    Hi there!
    Ok first I'm a complete beginner when it comes to Flash so please bare with me.
    What I'm looking to do is create a banner that transitions between different photos while there are small square buttons on the side that when the user clicks on them, it jumps to the corrosponding frame where a new photo begins showing. I've seen it a bunch of times on other websites.
    After following the advice found here: http://forums.adobe.com/thread/781826?tstart=0
    Everything was going well until I hit a snag. When trying to preview my movie I got the following error:
    1021: Duplicate function definition
    Now, I know there is a very obvious error here in my button scripts, but as I said, I have no idea what I'm doing. Can someone look at my code and tell me what's wrong and what I should change? I'll post all five scripts.
    The instance names by the way are "sidebutton1" thru "sidebutton5" if that's any help.
    Here's my codes for each of the five buttons (one of these code bits per button):
    sidebutton1.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event):void{
    gotoAndPlay(1);
    sidebutton2.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event):void{
    gotoAndPlay(100);
    sidebutton3.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event):void{
    gotoAndPlay(200);
    sidebutton4.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event):void{
    gotoAndPlay(300);
    sidebutton5.addEventListener(MouseEvent.CLICK,f);
    function f(e:Event):void{
    gotoAndPlay(500);

    sidebutton2.addEventListener(MouseEvent.CLICK,f2);
    function f2(e:Event):void{
    gotoAndPlay(100);
    sidebutton3.addEventListener(MouseEvent.CLICK,f3);
    function f3(e:Event):void{
    gotoAndPlay(200);
    Each function must have a special name...

  • OBA5 : Error Message for duplicate entry

    Hi
    In Tcode OBA5 - i enter F5 as Apllication area and i select new entries - i Enter 117 - and i Enter E before i save.
    but when i go to MIRO to check if there is an error message for duplicate entry, i find just a Warning Message !
    Please did i forget any thing ? please advise.
    Thank You,

    Hello,
    OBA5 should be enough, but you must remenber that the following fields must be identical for duplicate invoice check:
         Company code                           (BUKRS)         
         Vendor number                           (LIFNR)         
         Currency                                    (WAERS)         
         Reference number                       (XBLNR)         
         Amount in document currency      (WRBTR)         
         Document date                           (BLDAT)         
    Note 305201 is also helpful.
    Cheers

  • Customizing error message of duplicate record

    HI All,
    I need to customize an error message of duplicate record inserting in a field of unique-constraint. I want to show the message in an alert. How can i do this?
    Arif

    Hi,
    you can use ON-MESSAGE trigger and check the error code then display your custom error message
    Regards,

  • Error message "A duplicate file name was specified"

    Every time I open iTunes or attempt to make a purchase, I get the error message "A duplicate file name was specificed. There was an error in the iTunes Stores. Please try again later."
    It started when I tried to download a book a few days ago.
    I do not have any plugins installed, so there are none to remove/disable. I'm running the most recent version of iTunes (11.0.5) for Windows 7 (64-bit). I tried clearing the iTunes cache to no avail.

    Try and unchecking Manually manage music and videos on the summary page in iTunes. To get there, just go to ____'s iPod, scroll down, and it should be there. You can then check any other boxes (or uncheck) that you think might help you. That box might have automatically checked itself after the update. Also, make sure you have the latest version of iTunes by going to the apple in the top left hand corner, and clicking software update.

  • After shutting down Firefox 3.68, an error message reading "Incorrect Function" pops up.

    I upgraded to Firefox 3.68 about four days ago. After shutting down Firefox 3.68, an error message reading "Incorrect Function" pops up. I click "OK." Nothing seems to happen, either good or bad.
    I installed Comodo Internet Security a few days before I upgraded to Firefox 3.68.
    == This happened ==
    Every time Firefox opened
    == After I upgraded to Firefox 3.68.

    I am the original poster. The problem seems to have nothing to do with my upgrade to Firefox 3.6.8 but with a configuration change I made to System Mechanic after I switched to Comodo Internet Security.

  • Error message in planning function

    Hi,
    I have implemented a plausibility check for values in a planning function:
    IF { Z6SLSPRIC } = 0 AND NOT {Z6SLSQTY}  IS INITIAL.
         MESSAGE E000(ZOP1) .
         MESSAGE E001(ZOP1).
         MESSAGE I003(ZOP1).
    ENDIF.
    With raising an error message the data will not be saved. Unfortunately the function sends the message '...ended with errors'. I think this is the cas because of raising an error message. How is it possible to raise an error message without getting the function standard message?
    Regards
    Andreas

    Hi,
    I think the syntax is correct. The function works and give the implemented messages without saving the data.
    After that I get the following message: "Planning function Z6OPF4 ( Z6OPF4 ) ended with errors".
    How is it possible to suppress such system messages?
    I think the function is working fine. The message mentioned above is the result of raising an error message in my code...
    Regards
    Andreas

  • Error message when using function module HRIQ_TESTRESULTS_CREATE

    Hi,
    I need your help, I'm trying to use function module HRIQ_TESTRESULTS_CREATE to create external test results, I've used this function before without subscores, now I need to create subscores, but I get the message: "Grading scale UBID applies".
    The test type EXAM_UB_ING has assigned the UBID academic scale, which has a range from 1 to 677. Test type EXAM_UB_ING has 3 subtests (grammar, listening and reading) which also have the UBID academic scale assigned.
    I think this isn't a customizing problem because I can create test results with subscores using the PIQST00 transaction, the error message happens just when using the function module.
    I'm using this import parameters:
    STUDENT:
    PL:           01
    OT:          ST
    OBJID:     Student ID
    TESTRESULTS_HEADER:
    ISSUEDATE                      08.02.2010
    VALIDDATE                      30.04.2010
    TEST_GUID
    TESTEO                         50000269
    TRANSEO                        00000000
    TESTTYPE                       EXAM_UB_ING
    SESSIONID                      T1
    SESSIONYEAR                    2010
    ENTRYDATE                      08.02.2010
    TESTPASSFAIL
    TESTTOTRES                     458
    TESTSCALE_ID
    TOTALPERCENT1                   0,00
    TOTALPERCENT2                   0,00
    ENTRYMODE
    SUBTY
    Table TESTRESULTS_SUBSCORES:
    SUBTESTID            GRAMMAR
    SUBTESTTRES      GRAMMAR
    SUBT                     203
    SUBTESTID            READING
    SUBTESTTRES      READING
    SUBT                     120
    Does anybody know which could be the error? Or any other function module which I can use? (with HRIQ_TESTRESULTS_PROCESS_DATA I get the same error message).
    Thanks in advance!
    Araceli

    Araceli,
      I just noticed. You are populating SUBTESTSCALE_ID in subtest result structure.That's the reason it's throwing this error. it is trying to match Scale ID from test with value in sub test result scale ID.
    Prabhat Singh

  • Catching error message from standard function module to internal table.

    Hi,
    i am calling a FM in my custom prog.
    After execution of the FM some auto generated errors is getting displayed.
    I want to pass this error to an internal table.
    Please tell me how to do this?
        CALL FUNCTION 'FORMAT_CHECK'
          EXPORTING
            i_checkrule   = t005-prbkn
            i_checkfield  = it_ven-bankn
            i_checklength = t005-lnbkn
            i_checkmask   = space
            i_fname       = fname
          EXCEPTIONS
            not_valid     = 1
            OTHERS        = 2.
      IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    I want to catch this particular error message in the itab.
    Thanks,
    SAM.

    Even we can create an internal table  nad move the messages to it.
    DATA : BEGIN OF L_ERR OCCURS 0,
            SNO LIKE SY-tabix,                                  "serial no
            MSGTY LIKE SY-MSGTY,                         "message type
            MSGNO LIKE SY-MSGNO,                        "message no
            ERR_TEXT LIKE T100-TEXT,                     "message text
           END OF L_ERR. 
       IF SY-SUBRC <> 0.
              L_ERR-SNO      = SY-TABIX.
              L_ERR-MSGTY    = SY-MSGTY.
              L_ERR-MSGNO    = SY-MSGNO.
              L_ERR-ERR_TEXT = TEXT-015.                        "Problem encounterd in uploading data.
              APPEND L_ERR.
              clear L_ERR.
         ENDIF.

  • How to capture error message from standard function module

    Dear friends
    when i  execute standard function module in finance , i am getting error message , pls check the below screen shot,
    how to capture the below error message so that i have display in my webdynpro component
    Thanks
    Vijaya

    Hello Vijaya,
    Incase of BAPI's they have a return table parameter T_RETURN. Just read that return table to get the error message.
    Incase of normal function modules, there will be exceptions raised for the message used inside the function module. Just read the sy-subrc after the FM and based on the sy-subrc value find the respective exception raised.
    May be you can try like this, whenever the message is raised it will be stored in the system variable.
    CALL FM.
    check for the system variables.
    sy-msgid = Message ID of the latest message raised.
    sy-msgno = message number of the latest message raised.
    sy-msgty = message type of the latest message raised.
    sy-msgv1 = variable1 of the latest message raised.
    sy-msgv2 = variable2 of the latest message raised.
    sy-msgv3 = variable3 of the latest message raised.
    sy-msgv4 = variable4 of the latest message raised.
    Regards,
    TP

  • Is it possible to circumvent error message within a function module?

    Hello friends,
    Is it possible to circumvent error message generation from within a function module? My program calls a FM (namely FKK_S_CADOCUMENT_WRITEOFF) to do some updates. However, in certain cases this FM throws error messages and terminates the whole process. I cannot control the aftermath because it never gets back to the calling program.It stops at the FM level and not at my program level.
    In essence, what I would like to do is to let the FM do its thing, generate some kind of exception (but no error message), come back to the calling program, and then I can capture the status in my program and do what is necessary from then on.
    Your help is greatly appreciated

    Hi,
    Do not use Excerption Tab.
    Instead declare a variable or Structure at export parameter.
    Which will return you error Description or Status of the FM.
    For Example.
    Goto Se37 ---> key in FM name of yours.
    Go to Table tab
    At Parameter Name Column key in RETURN, Type as LIKE and Associate type as BAPIRET2.
    ThankS & regards,
    ShreeMohan
    Edited by: ShreeMohan Pugalia on Aug 10, 2009 12:31 PM

  • Error Message: Assign partner functions to 0010

    Hello All,
    When i confirm the BP in IC WebClient I get the following error message
    Customizing settings missing. assign partner functions to 0010
    Please suggest me how to solve this error message.
    Cheers Raj.

    Hi Raj
    Did u managed to fix this?
    Jogi

  • How to eliminate error messages that some functions produce?

    ?

    Hi,
    In order for the error messages not to appear, you can comment them out. Please look at the example below:
    CALL FUNCTION 'HRCA_PLANT_GET_COMPANYCODE'
               EXPORTING
                    plant                 = wa_equz2-iwerk
               IMPORTING
                    companycode           = lv_bukrs
               EXCEPTIONS
                    no_company_code_found = 1
                    plant_not_found       = 2
                    OTHERS                = 3.
         IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ENDIF.
    Or you can just leave them out.
    Hope this helps...
    P.S. Please award points for useful answers.

  • How to raise an error message when duplicate value is entered in a tabular field column? Basically not allow duplicate value at the form level.

    Hi all,
    I have created a form with one data block MATURED_FD_DTL which looks like below:
    ACCT_FD_NO
    CUST_CODE
    FD_AMT
    FD_INT_BAL
    TDS
    CHQ_NO
    ADD_FD_AMT
    P_SAP_CODE
    P_TYPE
    CREATE TABLE MATURED_FD_DTL
      ACCT_FD_NO    VARCHAR2(17 BYTE)               NOT NULL,
      CUST_CODE     NUMBER(9),
      FD_AMT        NUMBER(15),
      FD_INT_BAL    NUMBER(15),
      TDS           NUMBER(15),
      CHQ_NO        NUMBER(10),
      ADD_FD_AMT    NUMBER(15),
      P_SAP_CODE    NUMBER(10),
      P_TYPE        VARCHAR2(1 BYTE)
    For MATURED_FD_DT.ACCT_FD_NO, Trigger: KEY_NEXT_ITEM, I have written the following code:
    DECLARE
    V1 NUMBER;
    V2 NUMBER;
    BEGIN
    V1:=:MATURED_FD_DTL.ACCT_FD_NO;
    MESSAGE('V1:'||V1);
    MESSAGE(' ');
    END;
         GO_ITEM('MATURED_FD_DTL.CUST_CODE');
    This is just a dummy code.
    When ever i enter the value in the field of ACCT_FD_NO, it pops up a message saying "V1:Value of ACCT_FD_NO",
    So i want to store that value .
    Compare them & if it is egual, it should pop up a message saying duplicate value is entered and must not allow to enter, at form_level.
    So how can I compare the ACCT_FD_NO value between FIRST_RECORD and NEXT_RECORD ??
    Help Me .
    Thank You.
    Oracle Forms 6i.
    Oracle 9i.

    Thank You HamidHelal.
    Actually before posting the code, I went through the first link you have mentioned. I tried also, it is quite tedious procedure, however i dint get the proper result, may be i have done some mistake. Anyways , can you tell me how do i check in database table, if a value exists OR IF VALUE FOUND & then message and raise form trigger failure; something like below.
    IF :MATURED_FD_DTL.ACCT_FD_NO EXISTS
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    OR
    IF :MATURED_FD_DTL.ACCT_FD_NO FOUND
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    Is there any equivalent in the form in oracle forms 6i?? Please let me know how do i do this??

Maybe you are looking for

  • A little white box appears in my browser window, and I am unable to do ANYTHING in Firefox, I can't even close the window.

    I am using Mac OSX 10.6.8, so I know that Firefox should be working. The very first time I downloaded Firefox, I was able to use it for about 20 minutes, and then I kept getting some kind of white box (just small) that would pop-up over top of the se

  • Div shifting down page in live view

    I'm trying to create a website for a project I'm doing.I'm having a problem in live view where I the div with the id "imageholder" keeps shifting down the page. It looks fine in the editor but the browser and live view not so much. I want it to line

  • The preview display is Incorrect in pdf for Disclosure management

    I am trying to create a report with formatting in disclosure management. I have created the chapters and gave the content type as word document. When i create overall report from DM interface and look at the preview in word and pdf, word is displayin

  • Duplicate and orphelin Report engine "rweng"

    Hi All, I have a report server 10g (9.0.4) on HP-UX using three engine rweng-0,rweng-1,rweng-2 here is my conf : <engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1" maxEngine="3" minEngine="1" engLife="50" maxIdle="10" callback

  • Add 1 factory week to result

    Hi, I need to add one factory calendar week to the date. Below isn't working. DATA: DATE type scal-date. DATA: WEEK type scal-week. CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE' EXPORTING CORRECT_OPTION = '+' DATE = COMM_STRUCTURE-REQ_DATE FACTORY_CALE