As3 Error Code 1046
Contents |
here for a quick overview of the site Help Center Detailed answers to as3 error 1009 any questions you might have Meta Discuss the workings and
As3 Error 1010
policies of this site About Us Learn more about Stack Overflow the company Business Learn
As3 Error 1119
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
As3 Error 1120
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 1046: Type was not found or was not a compile-time constant: Stage and TextField up vote 0 down vote favorite So, I'm making a as3 error 1067 game and when I test my class into a file I get four errors of the same type '1046: Type was not found or was not a compile-time constant: Stage and TextField'. I've imported everything, please take a look: Game.as package { import flash.display.Stage.*; import flash.filter.GlowFilter.*; import flash.text.TextField.*; import flash.net.URLLoader.*; import flash.net.URLRequest.*; import flash.net.URLRequestMethod.*; import flash.net.URLLoaderDataFormat.*; import flash.net.URLVariables.*; public class Game { public static const STATUS_MENU:int = 1; public static const STATUS_SURVIVAL:int = 2; public static const STATUS_MULTIPLAYER:int = 3; public static const GAME_RUN:int = 1; public static const GAME_PAUSE:int = 2; public static var palco:Stage; public static var profileName:Array; //Name, status, pass public function Game():void { trace("Class Game is online."); } public function transStage(sender:Stage):Stage { palco = sender; palco.align = StageAlign.BOTTOM_LEFT; palco.scaleMode = StageScaleMode.EXACT_FIT; palco.displayState = StageDisplayState.FULL_SCREEN; return(palco); } public function makeGlow(txt:TextField):void { var glow:GlowFilter = new GlowFilter(); glow.color = 0xFFFFFF; glow.alpha = 1; glow.blurX = 4.5; glow.blurY =
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 as3 error 1034 Us Learn more about Stack Overflow the company Business Learn more about hiring as3 error 2032 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join as3 error 1061 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 Errors 1046 type not http://stackoverflow.com/questions/7960561/as3-error-1046-type-was-not-found-or-was-not-a-compile-time-constant-stage-an found if I specify a document class up vote 0 down vote favorite In my as3 code using Flash cs3, everything works fine without any document class. I can use event handlers and they work. But, once I attach a document class, I start to get this error: 1046: Type was not found or was not a compile-time constant: KeyboardEvent. Could somebody explain why this occurs? http://stackoverflow.com/questions/2129925/as3-errors-1046-type-not-found-if-i-specify-a-document-class This is what my document class looks like: package { import flash.display.Sprite; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; import flash.display.MovieClip; import flash.geom.Point; import flash.geom.Matrix import flash.ui.Keyboard; import flash.Event.KeyboardEvent; import flash.Event.MouseEvent; import flash.events.KeyboardEvent; import flash.events.MouseEvent; public class myCoolClass extends MovieClip { } } But then, I start to get more errors. I get: 1180: Call to a possibly undefined method SoundTransform.. Do I have to keep adding more import's in order to have it run properly? Thanks actionscript-3 import package document-class share|improve this question asked Jan 25 '10 at 2:42 ambiguousmouse 91011225 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote accepted Yes - you need to import all of the classes that are used. A bunch of classes are implicitly imported when you write code on the timeline in flash but when you use classes you need to explicitly import all referenced classes. A good IDE should do this for you automatically (e.g. press Ctrl+Shift+I in FDT - I'm pretty sure Flash Builder, Flex Builder and Flash Develop also have this sort of functionality) share|improve this answer answered Jan 25 '10 at 2:47 vitch 2,68721423 add a comment| Your A
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 https://forums.adobe.com/thread/1311069 JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and http://www.newgrounds.com/bbs/topic/1287789 reload this page. Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in as3 error ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 6 Replies Latest reply on Oct 9, 2013 9:29 AM by Amy Blankenship ActionScript 3 Error: 1046: Type was not found or.... Mandy Root-Thompson Oct 7, 2013 8:21 PM Hi,I am completely new to Flas and AS3. I as3 error code am trying to create an opacity slider using the slider component. I foudn a similar tutorial and tried to alter it to fit my opacity needs. In line 8 (function opacityChange (event:SliderEvent):void{) I get the error message 1046. When I test it in Flash the slider flickers on and off very rapidly too. Though I have searched, I am clueless as to what the problem is.Any help will be appreciated.Thanks!!importfl.events.SliderEvent;percent_txt.text = "Opacity %:0";slider.value = 0;slider.addEventListener(SliderEvent.CHANGE,opacityChange);function opacityChange (event:SliderEvent):void{ percent_txt.text = "Opacity %: " + event.target.value; logo.alpha = event.target.value;} 3313Views Tags: none (add) as3Content tagged with as3, 1046Content tagged with 1046 This content has been marked as final. Show 6 replies 1. Re: ActionScript 3 Error: 1046: Type was not found or.... kglad Oct 7, 2013 8:51 PM (in response to Mandy Root-Thompson) that should be:import fl.events.SliderEvent(and you need a sl
Forum Submit Yours! Team Up! Art Latest Greatest Popular Art Forum Submit Yours! Team Up! Portal Community Forums Chat Calendar Artist News Rankings Downloads Wiki Feeds About Feeds Wall Artist Login / Sign Up Upload Your Creations! Forums Everything Games Movies Audio Art Forums Search Latest News: Creep Jam & Summer Jam Winners! | #Inktober Error 1046: AS3 1,384 Views 3 Replies New Topic Respond to this Topic « Return to Game Development Forum Forum Index ElectroKitty ElectroKitty Member since: Oct. 2, 2011 Offline. Send Private Message Browse All Posts (13) Block Forum Stats Member Level 03 Melancholy Error 1046: AS3 2012-01-02 16:24:10 Reply It's my first time using AS3, and I'm having a bit of trouble migrating from AS2. I've found some guides that have got me by so far, but I've got a weird error I can't seem to fix. It says "1046: Type was not found or was not a compile-time constant: TimerEvent." and this is the piece of code it is referring too: var loadTimer:Timer=new Timer(5000); loadTimer.addEventListener(TimerEvent.TIMER, timerListener); function timerListener(e:TimerEvent):void { Strange thing is, it works in a new flash document, but not the one I'm working on (with external AS files and that), but there's no reused variables/mismatches or anything like that, so I don't see what the problem is. Another one is trying to get a loaded image to centre, In AS2 I could just use something like: _root.image._x=((stagewidth-image._width)/2) but AS3 doesn't like it (with the new property names of course). I think it's because I had to create a bunch of different variables and objects to load the image. Tracing image.width just returns 0, I think because it's just a placeholder for the actual image. I tried creating another variable to get the image width from the server where the image is hosted, but it didn't work out too well. Any help would be great. ProfessorFlash ProfessorFlash Member since: Oct. 6, 2007 Offline. Send Private Mes