As3 Error 1037 Packages Cannot Be Nested
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 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. More discussions in ActionScript 3 All CommunitiesAdobe Animate CC - HomeActionScript 3 2 Replies Latest reply on Jan 7, 2008 12:42 PM by Newsgroup_User 1037: Package Cannot Be Nested Newsgroup_User Jan 7, 2008 10:30 AM Hi -- I ran in to the "1037: Package Cannot Be Nested" error when using the sample code in Flash help and found the "How to Use the Examples" portion of the Adobe Flash help files to finally get my answer. It appears to be an issue many others have come across so I thought I would explain in more detail how to solve this problem. What you need to do is save the ActionScript file as the name of the class, for example "MyClass." Then you set the Flash movie "Document Class" (FILE-->PUBLISH SETTINGS-->FLASH-->SETTINGS) to "MyClass." You do not need to call/refer to/load the ActionScript file in the Flash movie -- it will do it automatically for you! Just make sure the FLA and the AS file are both in the same directory. Rich 2693Views Tags: none (add) This content has been marked as final. Show 2 replies 1. Re: Package Cannot Be Nested Newsgroup_User Jan 7, 2008 12:29 PM (in response to Newsgroup_User) Richard, > I ran in to the "1037: Package Cannot Be Nested" error when > using the sample code in Flash help Ah, good one! Yes, thanks for bringing this up. A number of the current 3rd party ActionScript books -- and, as you pointed out, most of the sample code in the docs -- is written in the form of class files. I've heard from a number of people who have tried to copy/paste such code into keyframes, then see th
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 "1037: Packages cannot be nested" 5,213 Views 7 Replies New Topic Respond to this Topic « Return to Game Development Forum Forum Index Havegum Havegum Member since: Oct. 20, 2008 Offline. Send Private Message Browse All Posts (3,661) Block Forum Stats Member Level 24 Melancholy "1037: Packages cannot be nested" 2009-11-06 17:23:51 Reply OMFG!!!!!! im https://forums.adobe.com/thread/129428 finaly taking everybodys advice and converting to AS3, but I always get the error:1037: Packages cannot be nested At the end I copied the code directly into my flash and i got the same error -.- AS3, on main timeline: package { import flash.display.Sprite; import flash.text.TextField; public class Starter_1 extends Sprite { private var tField:TextField; public function Starter_1 () { myTest(); } private function myTest():void { tField = new TextField(); tField.autoSize http://www.newgrounds.com/bbs/topic/1119830 = "left"; tField.background = true; tField.border = true; tField.x = 20; tField.y = 75; tField.text = "Hello, world"; addChild(tField); } } } TheBoob TheBoob Member since: Apr. 12, 2002 Offline. Send Private Message Browse All Posts (502) Block Forum Stats Member Level 13 Blank Slate Response to "1037: Packages cannot be nested" 2009-11-06 17:30:16 Reply Packages must be in their own AS file. Each class should have its own file named the same as its class name. zrb zrb Member since: Aug. 8, 2006 Offline. Send Private Message Browse All Posts (5,313) Block Forum Stats Member Level 11 Blank Slate Response to "1037: Packages cannot be nested" 2009-11-06 17:31:52 Reply At 11/6/09 05:23 PM, havegum wrote: AS3, on main timeline: You don't write class codes on your main timeline though :\ As for your problem, not too sure. Looks right to me but I have limited knowledge of AS3. Maybe you have to name your package ? School Sux ! || As :Main || As3: Main || Animation: Main || Flash Tutorials || Havegum Havegum Member since: Oct. 20, 2008 Offline. Send Private Message Browse All Posts (3,661) Block Forum Stats Member Level 24 Melancholy Response to "1037: Packages cannot be nested" 2009-11-06 17:34:41 Reply thats like kinda... stupid... TheBoob
how http://www.actionscript.org/forums/actionscript-3-0-a/156049-error-1037-packages-nested.html my code is wrong, it is verbatim from the flash help as3 error at Adobe with the exception of my minor customizations. Any help is greatly appreciated just trying to make a simple contact form - as3 error 1037 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
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0 Error 1037: Packages cannot be nested User Name Remember Me? Password Register FAQ Community Calendar Today's Posts Search Community Links Social Groups Pictures & Albums Members List Search Forums Show Threads Show Posts Tag Search Advanced Search Go to Page... Thread Tools Rate Thread Display Modes 12-19-2007, 06:34 AM #1 dannepop Senior Member Join Date: Jan 2006 Posts: 130 Error 1037: Packages cannot be nested Why do I get this error? 1037: Packages cannot be nested. The code it is refering to: package com.oreilly.as3cb.util I have made the taget path in the publish settings! D dannepop View Public Profile Find More Posts by dannepop 12-19-2007, 06:58 AM #2 Nomad2000 ActionScripter/Flasher Join Date: Nov 2007 Location: Vancouver, Canada Posts: 159 Did you declare a package in the code on the Actions tab in Flash? If so, this won't work. Flash creates a package of its own that contains your Action tab code. If you want to use a package, you can put the class into an .as file and then use that class as the Document class for the .fla. Nomad2000 View Public Profile Find More Posts by Nomad2000 12-20-2007, 08:28 AM #3 dannepop Senior Member Join Date: Jan 2006 Posts: 130 Itīs declared like this in the beginning of the code: Code: package com.oreilly.as3cb.util { import flash.events.EventDispatcher; import flash.net.URLLoader; import flash.net.URLRequest; import flash.events.Event; import flash.util.getTimer; The as files is in the directory com.oreilly.as3cb.util in my local C:\Users\ME\AppData\Local\Adobe\Flash CS3\en\Configuration\Classes D dannepop View Public Profile Find More Posts by dannepop 12-20-2007, 08:47 AM #4 creynders flash veteran Join Date: May 2005 Location: Belgium Posts: 914 It's a bit hard to know what's going on w/o seeing the code. Anyway, if the files reside in the standard configuration directory (which you say they do) then there's no need to add that path to the publish settings. I'm guessing that's the problem... creynders View Public Profile Find More Posts by creynders 12-20-2007, 04:27 PM #5 dannepop Senior Member Join Date: Jan 2006 Posts: 130 I give up! Shouldnīt 3.0 be a development. Why all these declarations all the time? Back to 2.0 dannepop View Public Profile Find More Posts by dannepop 12-21-2007, 03:09 AM #6 Nomad2000 ActionScripter/Flasher Join Date: Nov 2007 Location: Vancouver, Canada Posts: 159 You don't create a directory called "com.oreilly.as3cb.uti