As3 Syntax Error Else Is Unexpected
View New Content Science Forums, The Original Members Forums Chat More Science Forums → Sciences → Computer Science Javascript Disabled Detected You currently have javascript syntax error unexpected else t_else disabled. Several functions may not work. Please re-enable javascript to access syntax error unexpected token else 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 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 - 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
New? Today's Posts FAQ Rules Guidelines Search Advanced Search Forum :: Client side development Flash & ActionScript Adobe Flex getting 1083: Syntax error: else is unexpected If this is your first visit, be sure to 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. Enjoy an ad free experience by logging in. Not http://www.scienceforums.net/topic/53194-as3-error-1083-syntax-error-else-is-unexpected-need-help/ a member yet? Register. Results 1 to 14 of 14 Thread: getting 1083: Syntax error: else is unexpected Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Rate This Thread Current Rating Excellent Good Average Bad Terrible 11-06-2011,12:58 AM #1 akuria View Profile View Forum Posts New Coder Join Date Nov 2011 Posts 38 Thanks 1 Thanked 0 Times http://www.codingforums.com/adobe-flex/243029-getting-1083-syntax-error-else-unexpected.html in 0 Posts getting 1083: Syntax error: else is unexpected i am getting this error in my code in flash builder. here is the code i have: protected function submit_appointment_clickHandler():void { var Sender:String = ""; var Email:String = ""; var HomePhone:String = ""; var CellPhone:String = ""; var Address:String = ""; var City:String = ""; var State:String = ""; var ZipCode:String = ""; var Comments:String = ""; var Interests:String = ""; var Type:String = currentState; var evValidEmail: ValidationResultEvent = emailValidator.validate(); var evValidName: ValidationResultEvent = nameValidator.validate(); var evValidCellPhone: ValidationResultEvent = cellValidator.validate(); var evValidHomePhone: ValidationResultEvent = homeValidator.validate(); if (evValidEmail.type == ValidationResultEvent.VALID && evValidName.type == ValidationResultEvent.VALID && evValidCellPhone.type == ValidationResultEvent.VALID && evValidHomePhone.type == ValidationResultEvent.VALID) else{ resultLabel.text="There are Form errors"; resultLabel.setStyle("styleName", "invalid"); } } any help would be appreciated Reply With Quote 11-06-2011,02:29 PM #2 _Aerospace_Eng_ View Profile View Forum Posts Visit Homepage Supreme Master coder! Join Date Dec 2004 Location In a place far, far away... Posts 19,291 Thanks 2 Thanked 1,043 Times in 1,019 Posts I see a few syntax errors in your code. Try this PHP Code: 5 Replies Similar Posts: ActionScript 3.0 :: 1083 Syntax Error: Package Is Unexpected Dec 10, 2009 So I'm new to AS3, I am trying to convert my http://flash.bigresource.com/ActionScript-3-0-Error-1083-else-is-unexpected--W19afXySG.html as2 to as3 for my movie and I am getting this error: Line 1: 1083: syntax error: package is unexpected[Code]..... View 2 Replies Actionscript 3 :: Compiler Error 1083? Aug 8, 2011 finding https://code.tutsplus.com/tutorials/building-a-simple-driving-game-with-actionscript-30--active-1115 the error here. Its for my loading bar at the begging of my flash movie View 2 Replies Actionscript :: 1083 Syntax Error? Feb 27, 2012 I am trying to create a preLoader syntax error for my animation and I keep getting a 1083 syntax error. Why?stop();addEventListener(event.ENTER_FRAME,preLoad)function preLoad(e:event):void{[code].... View 1 Replies ActionScript 3.0 :: #1083 Error While Loading Xml In Swf Jul 14, 2010 I am trying to load external xml file in swf and i get an error TypeError: Error #1083: The prefix "text" for element "text:style-name" is not bound. For reference here is content of my external xml file (is syntax error unexpected is short because it is for testing):[code] View 6 Replies ActionScript 3.0 :: Conditional Error "Scene 1, Layer 'Layer 3', Frame 1, Line 291083: Syntax Error: Else Is Unexpected? Dec 12, 2011 Why this code doesn`t work?tip_052.addEventListener(MouseEvent.MOUSE_OVER,ove rSub);function overSub(evtObj:MouseEvent) { tip_052.visible = true; else[code]....appear this error "Scene 1, Layer 'Layer 3', Frame 1, Line 291083: Syntax error: else is unexpected. View 5 Replies Professional :: Unexpected File Format Error Jul 23, 2011 I was recently working on a project in Flash CS5.5 for school, last thing i did was save the project and close the program. Next time I try to open it I get an error saying "Unexpected File Format", and the application closes itself out. I can open Flash by itself and work on anything else, but when I try to open my class project it repeats the same thing "Unexpected File Format" and closes. The file was originally started IN Flash CS5.5, and has not moved to any other program since then. View 11 Replies ActionScript 3.0 :: As3 Syntax Error / Package Is Unexpected Dec 10, 2009 I'm new to AS3, I am trying to convert my as2 to as3 for my movie a & Motion GraphicsBundleseBooksDesign & IllustrationCodeWeb DesignPhoto & VideoBusinessMusic & Audio3D & Motion GraphicsPricingEnvato MarketEnvato StudioCommunityHelpEnvato MarketEnvato StudioCommunityForumHelpFree 10-Day TrialSign InHow-To TutorialsDesign & IllustrationAdobe PhotoshopVectorAdobe IllustratorIllustrationTools & TipsInspirationGraphic DesignNewsIcon DesignDrawingMore Categories...Learning GuidesCodeWeb DevelopmentWordPressMobile DevelopmentPHPJavaScriptFlashCMSiOS SDKNewsAndroid SDKMore Categories...Learning GuidesWeb DesignCSSHTML & CSSHTMLAdobe PhotoshopUI DesignComplete WebsitesWorkflowDesign TheoryJavaScriptCMSMore Categories...Learning GuidesPhoto & VideoShootingPost-ProcessingAdobe PhotoshopPhoto CritiqueHow-ToPhotographyLightingInspirationVideoAdobe LightroomMore Categories...Learning GuidesBusinessMarketingFreelancePlanningHow-ToCommunicationCareersBusinessSalesFinanceEntrepreneurshipMore Categories...Learning GuidesMusic & AudioAudio ProductionGeneralLogic ProWorkshopsMixing & MasteringSound DesignOpen MicAbleton LiveReasonRecordingMore Categories...Learning Guides3D & Motion GraphicsAdobe After Effects3DMotion Graphics3D Studio MaxMayaCinema 4DWorkflowNewsVisual EffectsRoundupsMore Categories...Learning GuidesGame DevelopmentGame DesignImplementationPlatform AgnosticBusinessProgrammingFlashFrom ScratchNewsHTML5UnityMore Categories...Learning GuidesComputer SkillsOS XApp TrainingProductivityTips & ShortcutsElectronicsAutomationSecurityOfficeHow-ToHardwareMore Categories...Learning GuidesCoursesDesign & IllustrationCodeWeb DesignPhoto & VideoBusinessMusic & Audio3D & Motion GraphicsBundlesComing SooneBooksDesign & IllustrationCodeWeb DesignPhoto & VideoBusinessMusic & Audio3D & Motion GraphicsPricingAdvertisementCodeGamesBuilding a Simple Driving Game with ActionScript 3.0Advertisementby Stephen Cronin10 Jul 2009Difficulty:IntermediateLanguages:EnglishGamesFlashIn this tutorial I'll be going through the steps needed to build a simple driving program. You'll learn how to add keyListeners, eventListeners and a couple of other things using ActionScript 3.0. I originally wrote this program in ActionScript