Error 1067 Flash As3
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 1067 (implicit coercion) when trying to addEventListener up vote 0 down vote favorite So I'm developing a sorting game for a game jam, and my AS3 skills are still a bit unrefined. I have an InputManager.as that determines whether the device is touch-capable or not, and then in the classes that need it, grabbing that info. Problem I'm having is: C:\GameDev\Progressive Bytes\Dan\Scripts\Screens\Buttons.as, Line 55 1067: Implicit coercion of a value of type String to an unrelated type Function. Here's where the problem is: if(InputManager.isTouch){ this.addEventListener(TouchEvent.TOUCH_BEGIN, TouchEventHandler); } else { this.addEventListener(MouseEvent.MOUSE_OVER, over); } This is in the Button's constructor. I've done a bit of searching around, but I can't seem to find any answers about a 1067 on an event listener that are relevant to this problem. But, as I said, kind of a noob with AS3. Thanks!! actionscript-3 addeventlistener share|improve this question asked May 5 '13 at 14:01 DanTheMan 350215 Could you mark which line exactly is causing the error? Thanks –phisch May 5 '13 at 14:19 Got it. Turns out the addEventListener thought the over function was a string, because (though I haven't located it yet), a public var over:String was declared somewhere else. I just changed the name of the function to Over() and it works now. –DanTheMan May 5 '13 at 14:49 Naming conventions for handlers keep code straightforward, such as: onTouchBegin or touchBeginHandler and onMouseOver or mouseOverHandler. –Jason Sturges May 5 '13 at 22:20 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted This is the line with the error: this.addEventListener(TouchEvent.TOUCH_BEGIN, TouchEventHandler); You have to understand that the first parameter is a string with the
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 http://stackoverflow.com/questions/16385288/as3-error-1067-implicit-coercion-when-trying-to-addeventlistener programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3 #1067 Implict Coercion of a value of type flash.utils.timer to an unrelated type Function up vote 0 down vote favorite I've been getting this error and I have no clue how to fix it, it works in another http://stackoverflow.com/questions/15031109/as3-1067-implict-coercion-of-a-value-of-type-flash-utils-timer-to-an-unrelated class so it should work here, right? (I moved it from that class to this one) The only difference is that this class extends 'Game' and the other class extends 'MovieClip' 1067: Implicit coercion of a value of type flash.utils:Timer to an unrelated type Function. public static var timeLeft; public function GamePlay() { // Start timer var timeCounter:Timer = new Timer(1000, timeLeft) timeCounter.addEventListener(TimerEvent.TIMER, timeCounter); timeCounter.start(); } // Handle time counter public function timeCounter(e:TimerEvent):void { timeLeft--; trace(timeLeft); } actionscript-3 flash timer flashdevelop share|improve this question edited Feb 22 '13 at 19:06 asked Feb 22 '13 at 18:47 Snakybo 1441313 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted Your function and your Timer are both called timeCounter, so it thinks you're trying to pass the Timer as a function (hence the error). You should rename one of the two, here I've renamed the function: public static var timeLeft; // Start timer var timeCounter:Timer = new Timer(1000, timeLeft) timeCounter.addEventListen
ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the expertsLearn our productsConnect with your peersError: You https://forums.adobe.com/thread/1049224 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. error 1067 More discussions in ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 2 Replies Latest reply on Aug 14, 2012 4:19 PM by KTK1975 Error 1067: Can anyone point me to the problem? KTK1975 Aug 14, 2012 3:33 AM I'm trying to write some AS error 1067 flash to take text that a user inputs and then show it in another placeI currently haveimport flash.text.TextField; import flash.events.TextEvent; stop(); // stop frame from progressing // This AS sourced and adapted from Adobe ActionScript 3.0 Help Files - Capturing Text Input // http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d8b.html // setting variables for Players Name var playersNameInput:TextField = new TextField(); var playersNameOutput:TextField = new TextField(); // Capture the text input by user function CaptureUserInput() { captureText(); } function captureText():void { playersNameInput.type = TextFieldType.INPUT; addChild(playersNameInput); playersNameInput.addEventListener(TextEvent.TEXT_INPUT, textInputCapture); } function textInputCapture(event:TextEvent):void { var playersNameOutput:String = playersNameInput.text; } // register the Enter Key as being pressed so the game can continue // intentionally blank at this time // output the text entered by the user addChild(playersNameOutput); playersNameOutput.text = playersNameOutput; When I run it, I'm getting the error code