As3 Error Package Is Unexpected
Contents |
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
As3 Error 1009
Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation as3 error 1010 Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like
As3 Error 1046
you, helping each other. Join them; it only takes a minute: Sign up AS3 - Keep getting a “Package is Unexpected” error in Flash CS5 up vote 0 down vote favorite I'm trying to use one of as3 error 1119 Adobe's examples to put a video player in my Flash application using ActionScript 3 in Flash CS5. It's the one at the bottom of the page here: http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html#buffering I'm putting the ActionScript into the frame I want to play the video in. When I try to test it, I keep getting the following error message: "1083: Syntax error: package is unexpected" So I try taking the "package { }" code out and running it again. as3 error 1120 Then this error pops up: "The public attribute can only be used inside a package" I tried removing all the code inside the package and I still get the first error. Might anyone know what's going on here? I'm sure it's something simple, but I can't figure out / find the solution. Thanks in advance. flash actionscript-3 share|improve this question asked Oct 6 '10 at 20:58 rottendevice 96141535 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote accepted That's a class definition. You can't put it directly onto the timeline. You need to create a file FLVPlaybackExample.as with that source code in it. Then, as explained in the instructions above it, set the Document class of the timeline to FLVPlaybackExample. This setting is in the properties window when the Stage is selected. (edit: sorry, not quite right instructions there) Alternatively, if you're against classfiles, you should be able to get the same effect by placing this on the timeline (untested): player.source = "http://www.helpexamples.com/flash/video/caption_video.flv"; player.skinBackgroundColor = 0x666666; player.skinBackgroundAlpha = 0.5; share|improve this answer edited Oct 6 '10 at 21:09 answered Oct 6 '10 at 21:03 Chris Burt-Brown 2,58111015 Thanks! I was actually unaware you could include separate .as files in your Flash project. That worked. –rottendevice Oct 7 '10 at 13:17 add a comment| Your Answer dr
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
As3 Error 1067
New? Advanced Search Forum Flash ActionScript 3 as3 syntax error: package is unexpected as3 error 1034 Results 1 to 2 of 2 Thread: as3 syntax error: package is unexpected Thread Tools Show Printable Version Subscribe to this
As3 Error 2032
Thread… Search Thread Advanced Search Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode December 10th, 2009,08:21 AM #1 synnyzter View Profile View Forum Posts 3 posts Registered User as3 syntax http://stackoverflow.com/questions/3876826/as3-keep-getting-a-package-is-unexpected-error-in-flash-cs5 error: package is unexpected So I'm new to AS3, I am trying to convert my as2 to as3 for my movie and I am getting this error: Line 1: 1083: syntax error: package is unexpected Anyone see what I am missing here? Code: package { import flash.display.BitmapData; import flash.display.MovieClip; import flash.utils.setInterval; import flash.geom.Rectangle; import flash.geom.Point; var visibleBitmap = new BitmapData(800, 800, true, 0x00FFFF00); _root.createEmptyMovieClip("snow", _root.getNextHighestDepth()); snow.addChildAt(visibleBitmap, 33); var hitBitmap = https://www.kirupa.com/forum/showthread.php?340358-as3-syntax-error-package-is-unexpected new BitmapData(800, 800, true, 0x00ffffff); hitBitmap.draw(limit); var hitPoint = new Point(hitBitmap.rect.x, hitBitmap.rect.y); var dir = Math.round(Math.random() * 2) - 1; i = 0 setInterval(dropSnow, 50); function dropSnow() { i++; _root.attachMovie("snow", "snow" + i, i); } } Reply With Quote December 10th, 2009,09:26 AM #2 IQAndreas View Profile View Forum Posts Visit Homepage 2,823 posts Theoretical Deveoper If you are putting it on the timeline, forget the "package" statement. If you are making a class out of it, you have forgotten the class. If it's a library item, you have forgotten the class. Also, there is no longer an "attachMovie" function in AS3. You might want to start learning AS3, as it is a bit of a difference compared to AS2, but once you switch over you will be a lot more productive, and from that point on you can learn basically any programming language. If you want to learn the basics, Adobe released a free book, "Programming ActionScript 3.0" which takes you through everything you need to know to get from 0 knowledge to intermediate, whizzing right through the beginner stage. http://help.adobe.com/en_US/ActionSc...rogrammingAS3/ Blog article of the month: Why My One Line 'if' Statements Are Unusual Twitter: @IQAndreas GitHub: IQAndreas Reply With Quote « Previous Thread | Next Th
View New Content Science Forums, The Original Members Forums Chat More Science Forums → Sciences → Computer Science Javascript Disabled Detected You currently have javascript disabled. Several http://www.scienceforums.net/topic/53194-as3-error-1083-syntax-error-else-is-unexpected-need-help/ functions may not work. Please re-enable javascript to access full functionality. AS3 Error 1083: Syntax error: else is unexpected NEED HELP Started by astro geek, Dec 04, 2010 Please log in to reply 2 replies to this topic #1 astro geek astro geek Lepton Members 5 posts LocationAustralia, Melbourne Posted 4 December 2010 - 07:12 AM I am having trouble with as3 error my code, the code is: { var num1:Number = 0.5; if(num < num1) mc_enemy.y += 20 num = Math.random() else mc_enemy.y -= 20 num = Math.random() } And it shows the error, "Error 1083: Syntax error: else is unexpected", Does anybody have any suggestions? 0 Back to top #2 skyhook skyhook Quark Senior Members 128 posts Posted 4 December 2010 as3 error package - 03:57 PM I'd say my programming skills sucks, don't listen to me, but just to say that you can maybe take a look at the if else statement structure, maybe you can include { } and ; at some parts. http://www.adobe.com...tionary196.html Edited by skyhook, 4 December 2010 - 03:57 PM. 0 Back to top #3 Cap'n Refsmmat Cap'n Refsmmat Mr. Wizard Administrators 11,755 posts LocationTexas Posted 4 December 2010 - 04:23 PM Indeed. Your if() has two lines after it, but no braces, so only the first line is considered to be inside the if(). Then, a couple of lines later, the parser sees an else, but the if() has already ended. You need to do this: { var num1:Number = 0.5; if(num < num1) { mc_enemy.y += 20 num = Math.random() } else { mc_enemy.y -= 20 num = Math.random() } } 0 Cap'n RefsmmatSFN Administrator Back to top Back to Computer Science 5 user(s) are reading this topic 0 members, 5 guests, 0 anonymous users Reply to quoted postsClear Science Forums → Sciences → Com