Error 1037 Packages Cannot Be Nested
Contents |
here for a quick overview of the site Help Center Detailed answers to any package cannot be nested as3 questions you might have Meta Discuss the workings and policies packages cannot be nested flash of this site About Us Learn more about Stack Overflow the company Business Learn more about
Package Cannot Be Nested In Actionscript 3
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
As3 Packages
Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ActionScript 3 Error 1037: Packages cannot be nested up vote 0 down vote favorite I am new to AS3. When learning AS3, I get the below code from an Adobe example and trying to run it gives an error like "1037: Packages cannot be nested." What does this mean? Please tell me how to execute? or any problem in this code? package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; public class TextField_alwaysShowSelection extends Sprite { public function TextField_alwaysShowSelection() { var label1:TextField = createTextField(0, 20, 200, 20); label1.text = "This text is selected."; label1.setSelection(0, 9); label1.alwaysShowSelection = true; var label2:TextField = createTextField(0, 50, 200, 20); label2.text = "Drag to select some of this text."; } private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField { var result:TextField = new TextField(); result.x = x; result.y = y; result.width = width; result.height = height; addChild(result); return result; } } } actionscript-3 share|improve this question edited Jul 11 '11 at 2:40 phwd 17.8k43664 asked Feb 13 '09 at 8:04 naveen 53151224 add a comment| 5 Answers 5 active oldest votes up vote 1 down vote accepted Your code should
Frames Image Optimizer FavIcon Generator FavIcon Editor new Animated Gif Email Riddler .htaccess Password .htaccess Banning Gradient Image Button Maker Ribbon Rules List Scrubber Tool DD Whois Service Register Help Remember Me? Advanced Search DD Home Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New? Blogs Forum General Coding Flash packages cannot be nested error (1037) If this is your first visit, be sure to http://stackoverflow.com/questions/545124/actionscript-3-error-1037-packages-cannot-be-nested 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: packages cannot be nested error (1037) Thread Tools Show http://www.dynamicdrive.com/forums/showthread.php?30769-packages-cannot-be-nested-error-(1037) Printable Version Subscribe to this Thread… Search Thread Advanced Search 03-25-2008,05:14 AM #1 evan View Profile View Forum Posts Private Message View Blog Entries Regular Coders Join Date Jan 2008 Location Near Chicago Posts 247 Thanks 105 Thanked 2 Times in 2 Posts packages cannot be nested error (1037) I am practicing from a book and places the script in a keyframe in a designated script layer I have gone over it a few times and can't figure out what 1037: packages cannot be nested means. here is the code: package { import flash.display.Sprite; import flash.events.Event; public class Velocity extends Sprite { private var _sprite:Sprite; private var _vx:Number = 3; public function Velocity () { _sprite =new Sprite(); _sprite.graphics.beginFill(0x0000ff, 100); _sprite.graphics.drawCircle(0, 0, 25); _sprite.graphics.endFill(); _sprite.x =50; _sprite.y =100; addChild (_sprite); addEventListener(Event.ENTER_FRAME, onEnterFrame); } public function onEnterFrame(event:Event):void{ _sprite.x += _vx; } } } If it works it will create a shape and animate it. Any suggestions? Reply With Quote 04-02-2008,03:34 AM #2 Medyman View Profile View Forum Posts Pri
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 Read Quick Links View Forum Leaders What's New? Advanced Search https://www.kirupa.com/forum/showthread.php?292777-1037-packages-cannot-be-nested Forum Flash Flash IDE 1037: packages cannot be nested Results 1 to 2 of 2 https://www.sitepoint.com/community/t/as3-error-1037-nested-package-help/56809 Thread: 1037: packages cannot be nested Thread Tools Show Printable Version Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode March 25th, 2008,01:00 AM #1 Evan70 View Profile View Forum Posts 3 posts Registered User 1037: packages cannot be nested I am using Flash cs3 with AS 3.0 cannot be and trying to experiment with code given in the "Actionscript 3.0 Cookbook" I apply the script to a keyframe in layer1 where I would place my scripts, The error I am getting is 1037: packages cannot be nested I have gone over it again and again, and can't figure out what I am doing wrong. I even tried just saving it as an ".as" file then in the upper right hand corner "targeted it" cannot be nested to a .fla file. Nothing. I think I'm either not applying the code right or putting it in the right place or else I need to alter the code somehow. Has anyone else used this book or run into this problem? This is the code: package{ import flash.display.Sprite; import flash.events.Event; public class Velocity extends Sprite { private var _sprite:Sprite; private var _vx:Number = 3; public function Velocity () { _sprite =new Sprite(); _sprite.graphics.beginFill(0x0000ff, 100); _sprite.graphics.drawCircle(0, 0, 25); _sprite.graphics.endFill(); _sprite.x =50; _sprite.y =100; addChild (_sprite); addEventListener(Event.ENTER_FRAME, onEnterFrame); } public function onEnterFrame(event:Event):void{ _sprite.x += _vx; } } } Any Ideas would be greatly appreciated! Reply With Quote March 25th, 2008,11:06 PM #2 icio View Profile View Forum Posts Visit Homepage 3,811 posts looks better in lowercase You cannot put a package or class on a keyframe. Class definitions (for example MyClass) should be within a file named "MyClass.as". You can read more on package and class definitions in the actionscript 3 livedocs on Adobe's website: http://livedocs.adobe.com/flash/9.0/...riptLangRefV3/ "60% of the time it works... every time." -- Paul Rudd as Brian Fantana. Reply With Quote « Previous Thread | Next Thread » Thread Information Users Browsing this Thread There are currently 1 users browsing this thread. (0 members and 1 guests) Posting Permissions You may not post new threads You may not post repl
how my code is wrong, it is verbatim from the flash help at Adobe with the exception of my minor customizations. Any help is greatly appreciated just trying to make a simple contact form - AS3 to PHP: package { import flash.display.Sprite; import flash.net.navigateToURL; import flash.net.URLRequest; import flash.net.URLVariables; public class sendForm extends Sprite { public function sendForm(event:MouseEvent):void { var url:String="formSend.php"; var request:URLRequest=new URLRequest(url); var variables:URLVariables = new URLVariables(); variables.usrName=name_txt.text; variables.usrEmail=email_txt.text; variables.usrMsg=msg_txt.text; request.data=variables; navigateToURL(request); trace(usrName, usrEmail, usrMsg); } } }submit_btn.addEventListener(MouseEvent.CLICK, sendForm); Home Categories FAQ/Guidelines Terms of Service Privacy Policy Powered by Discourse, best viewed with JavaScript enabled Shop Versioning Reference Articles Premium