Symbol 'LoseMessage', Layer 'Reset_btn', Frame 1, Line 15     1061: Call to a possibly undefined method

Hi I have a game set up, when you deplete your lives it takes you to a lose screen (Symbol), on that screen I have a button called Reset Game.
The button name is "Reset_btn"
The button instance is "resetbtn"
I have the code in the symbol and I am getting this error:
Symbol 'LoseMessage', Layer 'Reset_btn', Frame 1, Line 15    1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
Here is my code:
//Reset Button Code
resetbtn.addEventListener(MouseEvent.CLICK, Reset_btn);
function Reset_btn(event:Event):void
        gotoAndStop(1);
I have given my button and instance name and a name for the button, why am i still getting this error, can anyone help?
Casey

Ok.. so
This is on a separate timeline, its a movieclip which has a timeline inside it.
on frame 1 of that timeline inside the movieclip I have my button inside the movieclip.
The movieclip is activated when it meets a certain condition.
In this case when lives have been depleted to 0 from 3 a gameover screen appears.
A button is on that gameover screen which should take me back to the main menu or Frame 1 of the actual game in this case.
Here is the code for the condition for when game over screen appears:
if(cursor.hitTestObject(enemyAppear2))
                        enemyAppear2.parent.removeChild(enemyAppear2);
                        stage.removeEventListener(MouseEvent.CLICK, clickEnemy2);
                        life--
                        messageDisplay2.text = String(life);
                        if(life == 0)
                            enemyTimer2.stop();
                            var loseText:LoseMessage = new LoseMessage();
                            loseText.x = 0;
                            loseText.y = 0;
                            parent.addChild(loseText);
                            Mouse.show();
This code is in my main gaming code timeline.
The code im trying to show is inside the movieclip which i have set up.
Is this a clear enough explanation?

Similar Messages

  • Line 41     1061: Call to a possibly undefined method hitTestObject through a reference with static type

    Im trying to use the hit test built into flash, but its failing. I have used this many time before! but this time flash is crying at me.
    I Think i know why but im not sure how to fix it.
    Here is my hit test code:
    stage.addEventListener( Event.ENTER_FRAME, handleCollision);          
    private function handleCollision( e:Event ):void
                   if (MissleMc.hitTestObject(Enemy))
                        trace("HIT");
                   else
                        trace("MISS");
    I have tried multiple things,  Changing instances, location of the code. I currently have 4 classes, Main, Missile, Enemy and House. House has nothing it in really. Missile make a missile, Enemy Makes a enemy. And main deals with adding it all to the stage, and making it randomly appear ect.

    Yes you are correct, MissleMc is a class, thats the name its exported to. But i have tryed various things.
    Well i completely cahnged it now. Cleaned up my code a little created a new Bullet class, that i am currently using.
    Here is the function that fire's the bullet
    private function fireBullet():void
    var newBullet:Bullet = new Bullet;
    stage.addChild(newBullet);
    newBullet.x = house.x;
    newBullet.y = house.y;
    aBulletArray.push(newBullet);
    trace(aBulletArray.length);
    So im making the instance bullet, yet still when i use the hit test it does not wotk.

  • MouseEventExample.as, Line 1     1180: Call to a possibly undefined method addFrameScript

    Hi. I have a question about a Flash Help example which outputs an error, here - http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/MouseEvent .html?filter_flash=cs5.5&filter_flashplayer=10.3&filter_air=2.6#MOUSE_DOWN
    and the code is at the bottom of the page, in the Examples section, the MouseEventExample class.
    I have created an AS doc named MouseEventExample.as, put in a folder, the same as the one with the Flash pro file, have given the Flash pro file a document class name of MouseEventExample, but when i test movie, i get this error - 1180 addFrameScript, presumably on line 1 of the AS file, but there's no addFrameScript there at all.
    thanks for any help:)

    I just saw the answer to this - by kglad
    at
    http://forums.adobe.com/message/3085064#3085064
    i had some commented code in the timeline, which was the issue outputting this error.
    if u reply kglad, i can CorrectAnswer u/thanks again.

  • **Error** Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax error: extra characters found after end of program.

    Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax
    error: extra characters found after end of program.
    I am new to importing classes and I have been practicing
    making a photo gallery. I am stuck and I want to know if someone
    can help me with the error I am getting.
    If it is convenient, you can download and test my .zip at
    www.dhtmlguy.freeservers.com
    Thanks in advance!

    thanks...the small stuff gets me every time.

  • Scene 1, Layer 'Actions', Frame 1, Line 27     1084: Syntax error: expecting rightbrace before _01_010.

    I need help with this code PLEASE!!!!
    Stop_btn.addEventListener(MouseEvent.CLICK, fl_ClickToPauseVideo_3);
    function fl_ClickToPauseVideo_3(event:MouseEvent):void
        assets/01_01_010.fla.pause();
    Play_Btn.addEventListener(MouseEvent.CLICK, fl_ClickToPlayVideo_3);
    function fl_ClickToPlayVideo_3(event:MouseEvent):void
        assets/01_01_010.fla.play();
    Restart_btn.addEventListener(MouseEvent.CLICK, fl_ClickToPauseVideo);
    function fl_ClickToPauseVideo(event:MouseEvent):void
            assets/01_01_010.fla.seek(0);
    Tranz_Btn.addEventListener(MouseEvent.CLICK, fl_ClickToPosition_3);
    var fl_TF_3:TextField;
    var fl_TextToDisplay_3:String = "FEMA’s mission is to support our citizens and first responders to ensure that as a nation we work together to build, sustain, and improve our capability to prepare for, protect against, respond to, recover from, and mitigate all hazards.
    FEMA Hazard Mitigation efforts to reduce the risks associated with potential hazard events are ongoing. This course focuses on FEMA Hazard Mitigation Joint Field Office operations, which are established after a Major Disaster declaration to focus on mitigating the effects of future hazards in the state affected by the disaster..";
    function fl_ClickToPosition_3(event:MouseEvent):void
        fl_TF_3 = new TextField();
        fl_TF_3.autoSize = TextFieldAutoSize.LEFT;
        fl_TF_3.background = true;
        fl_TF_3.border = true;
        fl_TF_3.x = 200;
        fl_TF_3.y = 100;
        fl_TF_3.text = fl_TextToDisplay_3;
        addChild(fl_TF_3);

    every line with a forward slash has a problem.
    1.  any file paths/names should be in quotes.
    2.  i can't think of any reason you would reference an fla in actionscript
    3.  you certainly could not apply actionscript methods like play(),pause() and seek() to a fla.
    bottomline:  you almost certainly have incorrect references to what appears to be an flvplayback component instance.

  • Scene 1, Layer 'Layer 1', Frame 1, Line 1     1172: Definition fl.data:DataProvider could not be found.

    How do I correct this error - is it because I by accident has deleted the default library path and how do I put it back to the default value?

    How are you trying to implement it in your code?  Do you import the DataProvider class?

  • Problem printing frames and lines

    Hi,
    I have problems when printing frames and lines. As far as I know in reports created by WRITE statement. Frame characters aren't printed at all, I mean not even spaces and so all layout of page is corrupted. It changes even with format types what I don't understand.
    Could you tell me basic concept of printing frames?
    I think some of box_drawings_* characters are used.
    I tried to change characters in character set used by device type of chosen output device. But I probably haven't done it right, because in comparing character sets it still compares values before my change.
    What is proper way of changing character set?
    Thank you for every reply.
    Dasa

    What format are you using for your output?
    Try using something other then HTML, Try HTMLCSS or PDF or RTF insead.
    Simply set the DESFORMAT parameter to one of these values.

  • The outer layer of the power line was broken

    The outer layer of the power line was broken and it does not work now

    A broken power adapter is not safe to use. Discard it and buy a new one from Apple.
    http://store.apple.com/us/mac/mac-accessories/power

  • Why do I keep getting Error 519: Server interface error" - Server interface error "no component returned from creativewidget' Line: 479 - var test = parent.add('statictext', undefined, text)  when I try to use pattern fill/scripted patterns.  I have unin

    Why do I keep getting Error 519: Server interface error" - Server interface error "no component returned from creativewidget' Line: 479 -> var test = parent.add('statictext', undefined, text)  when I try to use pattern fill/scripted patterns.  I have uninstalled and re-installed PS CC.  I have opened holding down shift to disable third party plug-ins.  I have moved 3rd party plugins to a temp location outside of ps and it still doesn't help.  It worked once, and only once and now won't work at all.

    Unless your Photoshop question has to do with a download/install error, you should ask in Photoshop General Discussion
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • How to pass command line parameters in calling ant file

    Hi All, I m using a Build file which calls another build file.
    That build file is run from the command prompt by give ant -lib <path of jars it needs for executing>.
    Now i m calling this file from main build file but it does not work as i m not able to set <b>-lib </b>.
    Pls can anybody let me know how to set such command line parameters to call the build file in ant script.
    Thanks in Advance.
    Ketan.B.Parekh

    Create the control file dynamically (and fill one of the columns with the file name as a constant) before you start SQL*Loader
    Another option is to use external tables
    Re: Data Loading
    Message was edited by:
    Jens Petersen

  • Internet Explorer 11: Script Error - An error has occurred in the script on this page? Line: 9, Char: 6, Error: 'animationScript' is undefined ...

    Using Internet Explorer 11:
    Suddenly, about two days ago, I started getting a Script Error message from almost every page I visit on Internet Explorer 11 and now it has affected my printing while in my Outlook/Hotmail account?  What is an absolute fix for this irritating
    Script Error message? I have to use Firefox to get by this problem which I do not much care for. What can I do to resolve this problem ASAP?
    Here is one full Script Error Message
    "An error has occurred in the script on this page.
    Line:     9
    Char:    6
    Error:  'animationScript' is undefined
    URL:   
    https://sc.imp.live.com/content/dam/imp/surfaces/mail_signin/3/mai/EN-CA
    Do you want to continue running scripts on this page?
               Yes    No
    Can someone please, please help me.  I have tried many things - doing a Restore, running Microsoft Safety Scanner.  Checking my Tools>Internet Options.  Running FixMeStick.  Nothing works to fix this problem.  Please what is the
    correct answer to this problem.  I have had to switch temporarily to Firefox to get by this Script Error Message.
    - thanks - needhelpnowbfm

    Windows version is...?
    What pages are giving you problems? [post links to same]
    Are you getting the script errors only when attempting to print or...?
    Has your printer's manufacturer confirmed that your currently installed printer software is IE11-compatible (yet)?
    ~Robear Dyer (PA Bear) MS MVP-Windows Client since 2002 Disclaimer: MS MVPs neither represent nor work for Microsoft

  • Scripting Error: Line 25 Object doesnot support this property or method

    Hi,
    Environment :
    BS Version: 11i(11.5.9)
    Component: Web ADI
    Descripiton: When trying to upload journals through Web ADI we are getting the below error.
    "Scripting Error: Line 25 Object doesnot support this property or method"
    Please help on this issue.
    Thanks,
    Arun Babu R

    Hi hsawwan,
    Thanks for your reply.Actually after working on it we found that is the browser issue. The issue was resolved.
    ThanQ,
    Arun Babu R

  • Create symbol from layer PageItems

    I'm having trouble figuring out how to create a single symbol from all the objects within a single layer.
    Despite what the reference docs say, it doesn't seem that PageItems is a valid argument to pass into Symbols.add()...
    Anyone have any insight or maybe some example code?
    Thanks in advance!

    Hmm..  Creating a group seems to be troublesome as well...
    The following code gives me
    undefined is not an object
    on line
    var group = doc.groups.add(itemArray);
    var doc =app.activeDocument;
    var layer = doc.activeLayer;
    layer.hasSelectedArtwork = true;
    var itemArray = new Array;
    for (var i in selection)
        itemArray.push(i);
    var group = doc.groups.add(itemArray);
    Symbols.Add(group);
    My goal is simply to take all the objects on a given layer and create a symbol from them...  Sounded simple when I set out to figure it out.   Turning out not to be so simple...

  • Help with "layer options" + frame fitting

    I don't really understand how layer options work in conjunction with frame fitting options. Sometimes I will have a number of illustrations embedded within the same illustrator file and rejig the layer visibilities in order to separate each one but I find that the image shifts within the frame, partly I suppose because the bounding box may have changed. Can anyone refer me to a document that explains how this works - and if there's a way to keep the position locked so that layer vix changes don't have an effect on positioning?

    Or make a rectangle around all the art on it's own layer and give it no fill or stroke. As long as that layer remains visible, I don't believe you will see any shifting (In this case I'd choose "art" as the crop).

  • Remove symbol # for long text in document line item

    Dear Experts,
    I enter some information in the long text field in document line item. For the area that I use "Tab" button, system will display as # symbol. Therefore when we print the information, the output will include the #### symbol which is not correct.
    Please help.
    Thanks.
    -Syaban-

    Dear Gaurav Aggarwal,
    Thanks for the reply, can you guide me the step to perform the suggested solutions? currently, we are using ECC6.
    Thanks.
    syaban

Maybe you are looking for

  • Open directory and Active directory

    Hello everyone. I am from a school in london. We currently have 8 servers (7 running Server 2003 and a recently installed Mac server running os x server 10.5) We have recently installed new macs into our media room and need them to be set up to work

  • Scanning a bar code

    I have a curve 9300 and I am unable to scan a bar code and 9 times out of 10 it causes my phone to freeze and I have to remove the battery is it a problem with the software or with the phone its self

  • Grant permission to all packages in another schema

    Is there a way I can grant access to all the packages in another user's schema? Please guide me. Thanks!

  • How to use a path (mask) as a guidance path for an object?

    Hello, I want to use a path / mask as a guidance line for an object. I know i can draw a mask, then cut the path parimeter and paste it into the the position, but that seems to come with all kinds of restrictions. For example; when i use that method,

  • Why does my phone say it has no service?

    I am getting voice mails but no calls...and I can't listen to them due too no service. Bill is paid!