As3 Error Call To A Possibly Undefined Method Addframescript
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3 - Error #1180: Call to a possibly undefined method kill. up vote 0 down vote favorite This one is driving me crazy for a couple hours. I try to call a method kill(); (in function takeDamage()) which is in the same class, yet it won't find it. package classes.ship { imports ... public class Ship extends MovieClip { var speed:Number; var shootLimiter:Number; public static var health:Number; public static var maxHealth:Number; public function initialize() { var stageReff:Stage = this.stage as Stage; stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown); stage.addEventListener(KeyboardEvent.KEY_UP, reportKeyUp); stage.addEventListener("enterFrame", move); } //code public static function takeDamage(d):void { health -= d; if(health <= 0) { health = 0; kill(); } Main.healthMeter.bar.scaleX = health/maxHealth; } public function kill():void { var boom = new Explosion(); stage.addChild(boom); boom.x = this.x; boom.y = this.y; this.visible = false; //Main.gameOver(); } //code } } Has it to do with var stageReff:Stage = this.stage as Stage; ? Thanks in advance. actionscript-3 share|improve this question asked Jan 3 '12 at 21:16 Robbe Van Winckel 1602514 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote kill() is an instance method, but takeDamage is a static class method. You can't call instance methods from a static class metho
ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 4 Replies Latest reply on Jan 1, 2012 5:13 AM by screeen 1180: Call to a possibly undefined method addFrameScript. arunpheo Aug 26, 2010 4:50 AM I have a fla file it has been linked with external pacakage file this a document classit http://stackoverflow.com/questions/8718729/as3-error-1180-call-to-a-possibly-undefined-method-kill has been called through property inspector. when i try to make a code in the first frame it showthis error [1180: Call to a possibly undefined method addFrameScript.];I should type the code in the time line what should i do?pls help me it is too urgentthanks in advance 9597Views Tags: none (add) This content has been marked as final. Show 4 replies 1. Re: 1180: Call to a possibly undefined method addFrameScript. kglad https://forums.adobe.com/thread/708471 Aug 26, 2010 7:06 AM (in response to arunpheo) you can't add any code (or even a blank line) to any timeline in a fla that has a sprite as the document class.either change your document class to MovieClip or remove code from timelines. Like Show 0 Likes(0) Actions 2. Re: 1180: Call to a possibly undefined method addFrameScript. arunpheo Aug 26, 2010 6:43 PM (in response to kglad) Thanks a lot Like Show 0 Likes(0) Actions 3. Re: 1180: Call to a possibly undefined method addFrameScript. kglad Aug 26, 2010 8:17 PM (in response to arunpheo) you're welcome.please mark this thread as answered, if you can. Like Show 0 Likes(0) Actions 4. Re: 1180: Call to a possibly undefined method addFrameScript. screeen Jan 1, 2012 5:13 AM (in response to kglad) thanks, i see your point. i had some commented out code in the timeline; this pertains to a thread i just started which your reply here resolves. thanks. Like Show 0 Likes(0) Actions Go to original post Actions More Like This Retrieving data ... Legend Correct Answers - 10 points © 2016 Adobe Systems Incorporated. All Rights Reserved. | Powered by Help | Terms of Use | Privacy Policy and Cookies (UPDATED) | Forum Help | Tips for AskingJive Software Version: 8.0.3.0 , revision: 20160218075410.6eafe9c.release_8.0.3.x
using your existing account on the new forums, check out this thread. Register Help Remember Me? Forum Today's Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links View Forum https://www.kirupa.com/forum/showthread.php?324515-1180-possibly-undefined-method Leaders What's New? Advanced Search Forum Flash Flash IDE 1180: possibly undefined method Results 1 to 5 of 5 Thread: 1180: possibly undefined method Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode April 14th, 2009,04:19 PM #1 mrwizzer View Profile View Forum Posts 66 posts Registered User 1180: possibly undefined method as3 error I'm trying to use the AS3 version of Adobe's new Flash Media Server 3.5 bandwidth detection, using their documentation, (flashmediaserver_dev_guide). The BW detection works fine (runs a bandwidth check and displays the bandwidth in a trace statement), but that only seems to work if the flash file that accompanies the .as file is left completely blank/empty. As soon as I try to put in even the simplest actionscript, as3 error call (stop() for example), I get an error message that says "1180: Call to a possibly undefined method addFrameScript." and a similar one for the stop() method. Do I need to, in the .as class file, extend a class other than the Sprite class that's listed in the documentation? Any light you can shed would be appreciated. Reply With Quote April 14th, 2009,05:29 PM #2 senocular View Profile View Forum Posts 18,736 posts Semi-present Those are MovieClip methods that it looks like you're trying to use on a Sprite. Make sure your class instance is a MovieClip or extends MovieClip Reply With Quote April 14th, 2009,06:01 PM #3 Krilnon View Profile View Forum Posts Visit Homepage 10,065 posts ≈ ≠ = off topic: ------------------------- Originally Posted by senocular Make sure your class instance is a MovieClip or extends MovieClip There is a lame joke (or something) that could be made here involving is and how you could have left off the last 3 words of your sentence. And yes, I realize that you were just being clear, etc. etc., but I was oddly compelled to make this post. Reply With Quote May 21st, 2010,04:18 AM #4 adBuryD View Profile View Forum Posts 181 posts Registe