ActionScript 3 :: Multiple Statements In For Loop (1084 Error)
Sep 30, 2011
I'm trying to do a binary search in a for loop. However, flash does not like the following for loop.
for(var select:int = Math.floor((min + max / 2)), var turns:int = 0;
turns < input.length / 2 + 1;
turns++, select= Math.floor((min + max / 2))){
if(input[select] > want){ max = select;
} else if (input[select] < want){
min = select;
} else {
return select;
}}
On the first line I get 1084: Syntax error: expecting identifier before var. I think I know why (I'm using , to separate the different statements), but how do I fix it? ; won't work since it's what the for loop uses.
( var select:int = Math.floor((min + max / 2)) ;
var turns:int = 0);
turns < input.length / 2 + 1; //etc
does not work either.
I need to put a load of MC's on stage with the use of an array as such:
Code: for (var i = 1; i = 4; i++) { if (reg[i] == "singlewall") { var Wall:MovieClip = new wallClass() as MovieClip; mainClip.addChild(Wall); } }
I need a lot more then 4 though and I need a way to make new "Wall" variables Tried doing it with:
Code: for (var i = 1; i = 4; i++) { if (reg[i] == "singlewall") { var Wall:MovieClip = new wallClass() as MovieClip; Wall.name = "mc"+i; mainClip.addChild(Wall); } }
This does not work though, yields an infinite loop somehow
I am trying to learn flash and make forms with them. I keep getting this error... 1084: Syntax error: expecting leftperan before colon here is my code function sent:(e:Event):void why am I getting this error?
A friend of mine gave me this template that she want me to edit (change color etc) but when I try to export it, it gives me this error 1084: Syntax error: expecting identifier before 21431. (13 times - on every as file it loads from) 21431 = the name of the .fla file, also there's a folder called "21431_fla" where it loads a bunch of as files from. When I choose "Go to source" on one of the errors in the compiler it opens up a file (i.e. AboutPageContents_35.as) from the 21431_fla folder - and I guess the error comes from (and I did some searching on the web regarding this) it starting with the line;
ActionScript Code: package 21431_fla As I understand it reports the error because you can not load a package that starts with a number? I haven't change any code, so I'm curious how it could work before I edited the colors? And how do I fix it so it works I post a .zip file so you guys could check it out; [URL]
I am tying to make the effect flash as3 resize image and I am getting the following errors:
Scene 1, Layer 'AS3', FRAME 1, Line 22 1093: Syntax error. Scene 1, Layer 'AS3', FRAME 1, Line 22 1084: Syntax error: expecting rightparen before 1.
from the following code:
//Imports the tweenlite plugin.import com.greensock.*; //The orginal width and height of the images.var imageWidthOriginal:uint = 400;var imageHeightOriginal:uint = 300; //Array to hold the image instances.var imageArr:Array = new Array(image1_mc,image2_mc,image3_mc,image4_mc);
I am new to Flash. I am trying to make a card flip, I have a photo on one side and info on the next. It is controlled by a button. I an getting this error: 1084: Syntax error: expecting rightparen before flip on lines 5 and 6.
Here is my code: import fl.transitions.Tween;import fl.transitions.easing.Strong;import fl.transitions.TweenEvent; con.sidea.flip. addEventListener (MouseEvent.CLICK, on flip);con.sideb.flip. addEventListener (MouseEvent.CLICK, on flip);addEventListener(Event.ENTER_FRAME,loop); var isStill: Boolean=true;var arraytween:Array = new Array (); [Code] .....
Im getting this error: 1084: Syntax error: expecting rightparen before not. When doing this: if(mouseX > 800 && mouseY !> 400){ You_mc.rotation = 90;} I've never used not (!) before so im not sure if im doing it right. Am I?
I'm trying to create a click and drag quiz. This is my first time using actionscript and so I've been following a tutorial to create the drag and drop. I've hit a wall at the moment and keep getting the same error of expecting identifier before extends...not sure what that implies though.Here is my coding so far: (fire is the object on stage that I want to move)
flash.display.MovieClip; import flash.events.MouseEvent; fire extends MovieClip
how to send off multiple variables in an object (from a class) to the FLA file...[URL]The setup: I have a class that extends EventDispatcher. I created an Object called _pass, public var _pass:Object;.In my last function (everything is cool up until now), I have four variables that need to be passed to the main fla. Let's say they're param1, param2, param3, param4.
It was explained to me that I could use the public var _pass:Object; by first creating an instance of the object like so, _pass = { param1, param2, param3, param4 }; (each param is available in the function). Having setup an object instance, I could then dispatch the object to read from within my fla: dispatchEvent(new Event(Event.COMPLETE));.
But I get these errors:
Quote:
1084: Syntax error: expecting colon before comma. 1083: Syntax error: rightbrace is unexpected.
As the livedocs show, you can use an associative array (with braces and a colon), but I don't need that. I just need to pass my variables that are pre-made to the FLA.
I am trying to load one swf into another. In the former I have a preloader, and a mc to load the content. I am getting "Scene 1, Layer 'actions', Frame 1 1084: Syntax error: expecting rightbrace before end of program." Here is my code.
So I'm doing this basic coding thing to make an object "shoot" bullets. It's from a tutorial video. My code matches his exactly unless I'm missing a tiny detail. Basically the code looks like this:
And the compiler error I'm getting says this:Location:bullet.as line 31 1084: Syntax error: expecting rightbrace before end of program. Source: }Location:bullet.as line 31 1084: Syntax error: expecting rightbrace before end of program. Source: }And yes it does say it twice. The vid I'm learning from is this:[URL]
Scene 1, Layer 'Actions', Frame 1, Line 28 1084: Syntax error: expecting rightparen before leftbrace. Scene 1, Layer 'Actions', Frame 1, Line 27 1084: Syntax error: expecting leftparen before semicolon.
Did make a Flash banner and it al works fine. But when i want to put with the rectangle tool a button over the whole banner and put in the action tab the code:
I will get an error: Scene 1, Layer 'Layer 5', Frame 1, Line 1 1086: Syntax error: expecting semicolon before leftbrace I've allready searched for many hours to the solution but couldn't find anything on the web. Does anyone know how to solve this problem. If more info is needed let me know.
I am trying to make a gallery here and I dont know what the problem is with my gallery...
1084: Syntax error: expecting rightparen before colon. 1071: Syntax error: expected a definition keyword (such as function) after attribute Function, not ldr1.
This is my code... btn1.addEventListener(MouseEvent.CLICK, ldr1) Function ldr1(e:Event){ my_ldr1.source="cat.jpg"; }btn2.addEventListener(MouseEvent.CLICK, ldr2) Function ldr2(e:Event){ [Code] .....
This is what I'm trying to do. I need to call some javascript when a button in my flash movie is clicked on. This javascript in turn launches a flash audio player on the page.[code]...
In the code below, if I take out the '<fbAnsIntro></fbAnsIntro>' node everything works fine. I have tried changing it's name, putting text inside the node, etc.
I get this error
Code:1084: Syntax error: expecting identifier before xmltagstartend.
Code: fdbckOutline = <fbQuestIntro>To the Question</fbQuestIntro> <fbAnsIntro></fbAnsIntro>; scenarioMapXML.appendChild(fdbckOutline);