As3 Error 1137
Contents |
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 error 1137 incorrect number of arguments developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
Flash As3 Error
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 1137: Incorrect number of arguments. Expected no more than 0. statement copied from tutorial but not working up vote 0 down vote favorite I was following an adobe tutorial in which we make a text field and the text i update in it is from function sayHello() import flash.display.MovieClip import flash.display.MovieClip; import flash.display.Sprite; import flash.display.SimpleButton; import flash.events.MouseEvent; import flash.events.TextEvent; import flash.text.TextField; var myGreeter:Greeter = new Greeter(); mainText.text = myGreeter.sayHello("Bob"); This is written in first frame^^^^^ SayHello function is in the other actionscript file in same folder with the following code package { import flash.display.MovieClip; public class Greeter { public function sayHello():String { var greeting:String; greeting = "Hello World!"; return greeting; } } } Maybe some would ask that did you put a TextField on the stage and give it an instance name and the answer is yes i did. The tutorial i followed i don't know why after telling code told us correct errors if there are in it so there is a possibility that they wanted to train us maybe. i am a little confuse with greeter class myself as why we write sayHello("Bob") Why not sayHello() i say this because the variable only has string hellow world what it has to with that man Bob It would be kind of you if you can also explain me that, I am asking this too becuase i also need to have complete understanding of code. actionscript-3 flash-cs3 share|improve this question asked Sep 23 '13 at 15:36 Hamza Tatheer 429 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted I'm not sure, but you may have conflated two steps in the tutorial. You're right that with your definition of sayHello, you should call sayHello(); To have the function take an argument, you need to define the function to take an argument: public function sayHello(user:String):String { return "Hello, " + user + "!"; } You would then call: sayHello('Hamza'); and it would return "Hello, Hamza!" share|improve this answer edited Sep 23 '13 at 20:44 answered Sep 23 '13 at 15:50 Michael Brewer-Davis 10k
My first ActionScript 3.0 exercise - error 1137. Please help If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: My first ActionScript 3.0 exercise - error 1137. Please help Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 12-21-2009,06:02 AM #1 adifrank View Profile View Forum http://stackoverflow.com/questions/18963298/1137-incorrect-number-of-arguments-expected-no-more-than-0-statement-copied-f Posts Junior Member Join Date Jan 2006 Posts 11 My first ActionScript 3.0 exercise - error 1137. Please help Hi. As a Flash designer, I became somewhat familiar with basic ActionScript 2.0, but now I feel it's time to dive into some more complex coding and I've started to learn ActionScript 3.0 (using Flash CS4). I'm reading a pdf ebook by Adobe called "Programming ActionScript 3.0". It's written in a way that http://board.flashkit.com/board/showthread.php?807263-My-first-ActionScript-3-0-exercise-error-1137-Please-help is pretty easy to follow. Basically the first hands-on exercise in the book is a simple application called "HelloWorld". I've completed each of the steps in the exercise to the dot, yet I still get an error when trying to run the "HelloWorld" app I've created. I've went over it all several times and can't figure out what is wrong. The only thing I can think of is that the book is a bit outdated (2007) and is targeted for Flash CS3 rather than CS4. But it doesn't seem likely that the difference between CS3 and CS4 would have any effect on such a simple exercise. I've uploaded a .zip file containing: 1. a text file with the exercise copy/pasted from the pdf. 2. the .as file that I created according to the instructions in the exercise. 3. the .fla file that I created according to the instructions in the exercise. Here is the link: http://www.mediafire.com/?k4jbftjyewm By the way, The error I get when previewing the fla is: Location Scene 1, Layer 'actions', Frame 1, Line 2 Description 1137: Incorrect number of arguments. Expected no more than 0. If anyone here could take a couple of minutes and tell me what I did wrong, that would be great! Thanks. Reply With Quote 12-21-2009,08:20 AM #2 Ra
the function to the main time line public function creation() { [Code]... View 1 Replies Similar Posts: ActionScript 3.0 :: Error - 1137:Incorrect Number Of Arguments. Expected No More Than 0 Aug 22, 2011 I'm http://flash.bigresource.com/flash-error-1137-Incorrect-number-of-arguments-Expected-no-more-than-0-YUbkfAWCE.html just starting to learn AS3 and I'm trying to create a play button on a menu screen to start a game.I keep getting MMenu.as,Line20 1137:Incorrect number of arguments. Expected no more than 0. Every where I look http://primarypcsolutions.com/showthread.php?id=90125 the proper way to handle a dispatchEvent is as shown.[Code]... View 1 Replies ActionScript 3.0 :: 1137: Incorrect Number Of Arguments Expected No More Than 0? Jul 18, 2011 i have a small problem with the APEngine class.Everytime as3 error I try to run it, it gives me this errorPHP Code:1137: Incorrect number of arguments. Expected no more than 0. the line it refers is this one:PHP Code:force = new Vector(0,0); Whats going on?? I mean, I don't understand how it can be wrong, as the APEngine class imports a custom Vector class, but Flash thinks I'm using the original Adobe Vector class View 2 Replies Error 1137: Incorrection Number Of Arguments. Expected No More Than as3 error 1137 1 Aug 4, 2009 I want my navigation bar to open other pages in the same window. Currently, it's opening as if it's _blank (must be the defaut when nothing is coded).I thought I was coding correctly, but the error above popped up - so now I don't know what to do next.The code as it is with the error is as follows - the line with the error is highlighted in italics. function goHome(event:MouseEvent):void { var targetURL:URLRequest = new URLRequest("http://www.fairwoodcommunitynews.com/Alphatest/Home.html", "_parent"); navigateToURL (targetURL); }homeBtn.addEventListener(MouseEvent.CLICK, goHome); View 3 Replies Flash :: Error 1136 : Incorrect Number Of Arguments. Expected 1 Jan 18, 2012 //Handle game logicmcPlayer.update();//create questionmcMathQu.update(); the first "update" function of external as file works , but the instance i added in the 2nd external file, it gives me that error... (there is a 3rd one behind it which works too) note: the code itself is an external as file of a fla file. (and i checked, everything is linked properly to their individual external as file. this is the whole function code. (still doing in process.) public function update(evt:Event){//This is the game loop //Handle user input[Code]... View 1 Replies ActionScript 3.0 :: 1137: Incorrect Number Of Arguments? Nov 15, 2010 I have a project I created about a year ago. It's targeting Flash Player 9 and compiles perfectly.When I try to c
I appreciate the help, but I'm still getting '#error 1137 incorrect number of arguments'. How do I get this scroller to work? Thanks, //SCROLLING GALLERY addEventListener(Event.ENTER_FRAME, masterLoop); function masterLoop(e:Event){ var mouseMin:int = 0; var mouseMax:int = 0; var BUTTON:Array = new Array(); BUTTON[0] = z1; BUTTON[1] = z2; BUTTON[2] = z3; BUTTON[3] = z4; BUTTON[4] = z5; for(var i:int=0; i<5; i++){ var mouseX:int = 0; if (mouseX > -360 && mouseX < 360) { mouseX = Math.ceil(mouseX); }else{ mouseX = 20; } if (i<12){ var menuX:int = 0; var menuX2:int = 0; menuX = Math.ceil(BUTTON[i], x); //menuX2 = Math.ceil(BUTTON[i+1], x); }else{ //menuX2 = Math.ceil(BUTTON[0], x); } if (i < 12 && menuX2 > menuX){ BUTTON[i+1], x, menuX + 130; } if (mouseX < mouseMin && menuX < 1060) { diff = (mouseMin-mouseX)/20; BUTTON[i], x, (menuX+diff); }else if (mouseX <= mouseMin && menuX >= 1060) { diff = Math.ceil((mouseMin-mouseX)/15); diff = diff + (menuX - 1060); BUTTON[i], x, (-500 + diff); } if (mouseX > mouseMax && menuX > -500) { diff = (mouseX-mouseMax)/20; BUTTON[i], x, menuX-diff; } else if (mouseX >= mouseMax && menuX <= -500) { var diff:int = 0; diff = Math.ceil((mouseMin-mouseX)/15); diff = diff + (menuX + 500); BUTTON[i], x, (1060 + diff); } } } LatestJquery rotate pictures in a list - 3 years ago google's embedded player conflicts with jquery's fadein method on chrome - 3 years ago Works in Chrome but not in Internet Explorer - 3 years ago Given URL is not permitted by the application configuration Chrome - 3 years ago Select background white/transparent - Chrome OSx - 3 years ago Async Ajax call not working in chrome - 3 years ago Chrome Issue with Webfonts & @font-face icons crashing on pages using CAPTCHA - 3 years ago Chrome automatically opens SpreadsheetML in new tab as XML - 3 years ago Why performance WebGL of PhoneGap is differen