Flash Error 1006 Is Not A Function
Contents |
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 value is not a function as3 Read Quick Links View Forum Leaders What's New? Advanced Search Forum Flash
As3 Error #1006 Is Not A Function
ActionScript 3 [Flash] TypeError: Error #1006: value is not a function. Please help Results 1 to 7 of 7
Typeerror: Error #1006: Value Is Not A Function.
Thread: TypeError: Error #1006: value is not a function. Please help Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode December 28th, 2011,08:11 AM #1 Availor View Profile View Forum Posts 7 posts Registered User TypeError: Error #1006: value is not a function. Please help Hello, I've tried to figure out why this didn't work. Please maybe someone can help me out. This is my code: I have 4 buttons that are named btn1, btn2, btn3, btn4. if I do only trace(my_btn) it returns btn1, btn2, btn3, btn4. But when I try to tell them to stop on frame, it returns TypeError: Error #1006: value is not a function. at project_fla::MainTimeline/frame1() This is my code for (var i:int = 1 ; i <= 4 ; i++ ) { var my_btn = "btn"+i; trace(my_btn); my_btn.gotoAndStop(i); } Thanks in advanced.. Reply With Quote December 28th, 2011,10:00 AM #2 TheVoid View Profile View Forum Posts 59 posts Registered User In your current code, my_btn is a string. and strings don't have a gotoAndStop() method. try accessing it like this: this[my_btn] instead of my_btn as that will be an object of the container. Reply With Quote December 28th, 2011,11:38 AM #3 MariusJP View Profile View Forum Posts Visit Homepage 1,054 posts Emba-chua What are you trying to do? Because the for loop looks kinda weird imo. Reply With Quote December 28th, 2011,03:32 PM #4 snickelfritz View Profile View Forum Posts 2,084 posts Registered User His buttons might be instances of a multiframe MovieClip, with each unique button graphic on a different frame. ie: the loop creates frame1 button, frame2 button, etc.
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 Error 1006: Not a function up vote https://www.kirupa.com/forum/showthread.php?370237-TypeError-Error-1006-value-is-not-a-function-Please-help 0 down vote favorite I am getting the error in the title when trying to access a method in another class. I have the main class, ZombieBots, which is linked to a movie clip of the same name. I then have 3 more movie clips which all get added to the ZombieBots clip during runtime, and each of these have their own classes. When I attempt to http://stackoverflow.com/questions/19610053/error-1006-not-a-function access a method within the ZombieBots class from one of the other 3 classes, I get error 1006. The function I am attempting to access in the ZombieBots class, that cannot be accessed: package { import flash.events.*; import flash.display.MovieClip; import flash.geom.Rectangle; public class ZombieBots extends MovieClip{ private var pLives:int; private var pScore:int; private var pSkill:int; private var pItems:int; private var characterMC:Character; private var cGameObjs:Array; public function ZombieBots() { /*cGameObjs = new Array(); addCharacter(); addItems(); addBots(); pLives = 5 - pSkill; pScore = 0; pItems = pSkill + 5;*/ resetGame(); } private function addCharacter():void{ trace("Adding the character"); if (!characterMC){ var myBorder:Rectangle = new Rectangle(35,35,600,480); var myXY:Array = [38, 400]; var myChar:int = Math.ceil(Math.random()*3); var myKeys:Array = [37,39,38,40]; var myDistance:int = myChar * 3; characterMC = new Character(myBorder, myXY, myKeys, myChar, myDistance); addChild(characterMC); } else{ characterMC.x = 38; characterMC.y = 510; characterMC.gotoAndStop(pSkill); } } private function addItems():void{ trace("yeah boi"); var mySkill:int = Math.ceil(Math.random() *3); var myMaxItems:int = mySkill + 5; trace(mySkill); trace(myMaxItems); trace(this); for (var i:int = 0; i < myMaxItems; i++){ var thisItem:Item = new Item(this, characterMC, mySkill); thisItem.name = "item" + i; cGameObjs.push(thisItem); addChild(thisItem); } pSkill = mySkill; updateScores(); } private function addBots():void{ trace("adding the bots bra"); var myBorder:Rec
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/675643 don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back https://www.kongregate.com/forums/4-game-programming/topics/240485-error-1006-value-is-not-a-function-as3 on and reload this page. Please enter a title. You can not post a blank message. Please type your message and try is not again. More discussions in ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 12 Replies Latest reply on Jul 7, 2010 3:16 PM by dmeN TypeError: Error #1006: value is not a function. Kyle517 Jul 7, 2010 2:02 PM I'm getting this error:TypeError: Error #1006: is not a value is not a function. at project_fla::MainTimeline/createMap() at project_fla::MainTimeline/frame1()heres the actionscript:[A]function createMap(target:Object, map:Array, tilesize:Number):void { for (var ix:Number=0; ix