Error 1061 Actionscript
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Call To A Possibly Undefined Method Addeventlistener Through A Reference With Static Type Class
and policies of this site About Us Learn more about Stack call to a possibly undefined method play through a reference with static type class. 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 1061 Reference with Static Type up vote 0 down vote favorite I'm new to AS3, and trying to create a draggable element. However, I keep getting error 1061, and I don't know why, because I'm pretty sure I don't have any spelling errors or the like. Can someone please tell me what I'm doing wrong? Here is my code: package { import flash.display.*; import flash.events.*; import flash.geom.Rectangle; public class Script extends MovieClip{ public var value:Number; private var max:Number; private var min:Number; public function Draggable(){ min = erhu_mc.y; max = erhu_mc.height - Erhu_H3_btn.height; Erhu_H3_btn.addEventListener(MouseEvent.MOUSE_DOWN, dragHandle); } function dragHandle(event:MouseEvent):void { Erhu_H3_btn.startDrag(new Rectangle, false,(0,min,0,max)); stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging); } function stopDragging(event:MouseEvent):void { Erhu_H3_btn.stopDrag(); stage.removeEventListener(MouseEvent.MOUSE_UP, stopDragging); } } } actionscript-3 function flash share|improve this question asked Oct 9 '14 at 0:35 Anne 31 1 It's because Erhu_H3_btn is the name of a class, not an instance name of an object on the stage. –Marty Oct 9 '14 at 4:01 I don't understand...'Erhu_H3_btn' is the name of my button, which is on my stage...so why is it a class and not an instance name? –Anne Oct 9 '14 at 9:19 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted There are 2 issues with your current class. Erhu_H3_btn.startDrag(new Rectangle, false,(0,min,0,max)); needs to be: Erhu_H3_btn.startDrag(false,new Rectangle(0,min,0,max)); You can't directly reference objects from the timeline from a clas
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 1061: Call to a possibly undefined http://stackoverflow.com/questions/26268568/as3-error-1061-reference-with-static-type method gotoAndStop through a reference with static type Class up vote 0 down vote favorite I've been using Adobe Flash CS4 for a couple of days. I've drawn a worm, with eyes and a mouth and these pieces are all MovieClip symbols. I have exported them to actionscript with the class name being the same as what they are (ie. the mouth MovieClip is exported as http://stackoverflow.com/questions/4416621/1061-call-to-a-possibly-undefined-method-gotoandstop-through-a-reference-with-s mouth). The mouth has 2 frames, one smiling and one frowning. I need to mouth to stay smiling at first, so in Frame 1 actions I wrote: mouth.gotoAndStop(1); But I get this compiler error: 1061: Call to a possibly undefined method gotoAndStop through a reference with static type Class. Why is this occuring? Thanks. actionscript-3 class flash-cs4 movieclip share|improve this question asked Dec 11 '10 at 12:09 Greg Treleaven 1,90171927 It depends where you placed your code. If you paced it inside the mouth symbol, simply calling gotoAndStop(1) or stop() should do the trick. –George Profenza Dec 11 '10 at 13:20 It worked, I knew it would be something really obvious. Is that the only way I can access the MovieClip in AS3 or can I access it through the main timeline's actions somehow? I got this working a long time ago when I had the trial of Flash I think, but I can't remember. –Greg Treleaven Dec 11 '10 at 13:46 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted You need to give your Movieclip an instance name in order to reference it by
Du kan ändra inställningen nedan. Learn more You're viewing YouTube in Swedish. You can change this preference below. Stäng Ja, behåll den Ångra Stäng Det här videoklippet är inte tillgängligt. https://www.youtube.com/watch?v=PKijMtmBx7Y VisningsköKöVisningsköKö Ta bort allaKoppla från Läser in ... Visningskö Kö __count__/__total__ Ta reda på varförStäng Flash AS3 Error Code 1061 Undefined Method Flashthingy PrenumereraPrenumerantSäg upp2 0702 tn Läser in ... Läser in ... Arbetar ... Lägg till i Vill du titta på det här igen senare? Logga in om du vill lägga till videoklippet i en spellista. Logga in Dela Mer Rapportera Vill du rapportera videoklippet? Logga in om call to du vill rapportera olämpligt innehåll. Logga in Statistik 405 visningar 2 Gillar du videoklippet? Logga in och gör din röst hörd. Logga in 3 1 Gillar du inte videoklippet? Logga in och gör din röst hörd. Logga in 2 Läser in ... Läser in ... Läser in ... Rankning kan göras när videoklippet har hyrts. Funktionen är inte tillgänglig just nu. Försök igen senare. Publicerades den 25 nov. call to a 2014This is video show a very simple way to rectify that 1061 error code undefined method. This is not the solution for all 1061 error codes. Kategori Instruktioner och stil Licens Standardlicens för YouTube Visa mer Visa mindre Läser in ... Annons Automatisk uppspelning När automatisk uppspelning är aktiverad spelas ett föreslaget videoklipp upp automatiskt. Kommer härnäst How To Resolve Error 1061 in Windows 8 Without Using Any Software/Tool -BY NEEL CHAUDHARI - Längd: 1:53. Neel Chaudhari # NL-TECHNO 3 231 visningar 1:53 4. Operadores Matemáticos: Jerarquía y Abreviación | Hacer Juegos en Flash AS3 - Längd: 14:51. FlashWizard 573 visningar 14:51 Creating Linked Text Fields Using AS3 in Flash CS5 - Längd: 10:59. flashandmath 20 100 visningar 10:59 Windows 7 Internet Connection Sharing (ICS) - Längd: 5:18. Chris Walker 436 772 visningar 5:18 How To - Fix Problems With Your Internet Connection - Längd: 6:35. LiteCastStudios 1 016 284 visningar 6:35 How to fix windows firewall & windows could not setup internet connection sharing (ICS) - Längd: 3:43. WellMadGuy 89 946 visningar 3:43 PHP Error Undefined Index - Längd: 9:08. Miszkoxxx 17 874 visningar 9:08 Flash AS3 Error Code 1009 Simplified - Längd: 3:28. Flashthingy 1 733 visningar 3:28 Ошибка 651 Windows 8: Как исправить - Lä