Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Why Is This A Syntax Error?



_level0.preloaderGraphics.percent=int(Percentage) add "%"this code seems to work with no problems as a flash mx file, but it wont work with flash 8.....anyone know why?



Adobe > ActionScript 1 and 2
Posted on: 11/09/2006 05:49:32 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

**Error** TempInit : Line 1, Column 5 : [Compiler] Error #1084: Syntax Error: Expecti
Hi,

I'm trying to convert my AS2 project to AS3. I got rid of all errors but one :

**Error** tempInit : Line 1, Column 5 : [Compiler] Error #1084: Syntax error: expecting identifier before 45.
var 45:MovieClip;

I got no idea what tempInit is, and no where do I declare a variable called 45...

After searching the web for hours I am tired and thus asking for your help.

Thank you,

**Error** Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax Error: Extra Char
Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax error: extra characters found after end of program.
}

I am new to importing classes and I have been practicing making a photo gallery. I am stuck and I want to know if someone can help me with the error I am getting.

If it is convenient, you can download and test my .zip at www.dhtmlguy.freeservers.com

Thanks in advance!

**Error** Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax Error: Extra Characters Found After End Of Program.
Scene 1, Layer 'actions', Frame 1, Line 664: 1087: Syntax error: extra characters found after end of program.
}

I am new to importing classes and I have been practicing making a photo gallery. I am stuck and I want to know if someone can help me with the error I am getting.

If it is convenient, you can download and test my .zip at www.dhtmlguy.freeservers.com

Thanks in advance!

AS3 Error #1086: Syntax Error: Expecting Semicolon Before Btn
1086: Syntax error: expecting semicolon before button.
HI

PLs help me
import fl.transitions.Tween;
import fl.transitions.easing.*;
var homeX:Number = 503;
var homeY:Number = 328;

var aboutX:Number = 505;
var aboutY:Number = 829;

var princeX:Number = -336;
var princeY:Number = 317;

var princessX:Number = 1470;
var princessY:Number = 316;

var galleryX:Number = 489;
var galleryY:Number = -284;

var xTween:Tween;
var yTween:Tween;

xTween = new Tween(main_mc,"x",Strong.easeInOut,main_mc.x,homeX ,2,true);
yTween = new Tween(main_mc,"y",Strong.easeInOut,main_mc.y,homeY ,2,true);

abt_btn.addEventListener(MouseEvent.CLICK, navigate);
prince_btn.addEventListener(MouseEvent.CLICK, navigate);
princess_btn.addEventListener(MouseEvent.CLICK, navigate);
gallery_btn.addEventListener(MouseEvent.CLICK, navigate);

function navigate(event:MouseEvent):void
{
if(event.target == abt_btn)
{
setTween(aboutX,aboutY);
}
else if(event.target == prince_btn)
{
setTween(princeX,princeY);
}
else if(event.target == princess_btn)
{
setTween(princessX,princessY);
}
else
//if(event.target == gallery_btn)
{
setTween(galleryX,galleryY);
}

}

function setTween(tweenX:Number,tweenY:Number):void
{
xTween.begin = main_mc.x;
yTween.begin = main_mc.y;
xTween.finish = tweenX;
yTween.finish = tweenY;
xTween.start();
yTween.start();

}

xTween.stop();
yTween.stop();

}

this is my code but i am getting 1086 syntax error :Expecting semicolon before gallery button pls help me to recover it

Syntax Error Error? Quick Question
I have some code to stream a mp3 and a slider to control the volume. It works fine. I put it into another flash file and then it doesn't. My original is in Flash 8, and the new is in MX2004, I figure that this is why I've got the error message. So I converted the MX2004 to F8 and still I get an error message with my code. Now I can't stream this sound, could someone point out my mistake to me? Thank You


Code:
var game_sound:Sound = new Sound();
game_sound.onLoad = function(success:Boolean):Void {
if (success) {
trace("Sound Loaded");
game_sound.start(loops,1000);
game_sound.setVolume(20);


}
};
game_sound.loadSound("atmosphe-PSION-3280_hifi.mp3", false);

Syntax Error: Can Anyone Spot The Error Pls?
I'm getting a syntax error on this code, can anyone spot where it's gone wrong?
Note: it works using Actionscript 1.0, but not 2.0 for some reason.

This is the error message:
**Error** Symbol=control, layer=actions, frame=1:Line 1: ')' expected
if (_parent:bounce == false) {

//CODE STARTS:
if (_parent:bounce == false) {
_parent:speedXscale = Number(_parent:speedXscale*_parent:friction)+Numbe r((_parent:xscale-_parent:_xscale)*_parent:ratio);
_parent:speedYscale = Number(_parent:speedYscale*_parent:friction)+Numbe r((_parent:yscale-_parent:_yscale)*_parent:ratio);
setProperty ("../", _xscale, Number(_parent:_xscale)+Number(_parent:speedXscale ));
setProperty ("../", _yscale, Number(_parent:_yscale)+Number(_parent:speedYscale ));
}
//CODE ENDS

Error 1086: Syntax Error
Hi there,

I have been following a website tutorial and as far as i can see my code is identical to that in the tutorial however when i compile i get the following output.

1086: Syntax error: expecting semicolon before .3.
This error occurs at scene 1, layer 'layer 2', frame 1, line 3

I will paste the code below so hopefully someone who knows a lot more about AS than i do will be able to solve the problem

thanks in advance,
Darren Rutter


ActionScript Code:
import caurina.transitions.*;
import flash.filters.BlurFilter;
import com.theflashblog.3d.SimpleZSorter;

var blurFilter1:BlurFilter = new BlurFilter(0,0,1);
var blurFilter2:BlurFilter = new BlurFilter(0,0,1);
var blurFilter3:BlurFilter = new BlurFilter(0,0,1);

var mySpace:Sprite = new Sprite();
addChild(mySpace);
mySpace.x = 450;
mySpace.y = 200;

var f1:s1 = new s1();
var f2:s2 = new s2();
var f3:s3 = new s3();

f1.z = 1000;
f2.z = 3000;
f3.z = 5000;

f1.x = 450;
f2.x = 450;
f3.x = 450;

f1.y = 450;
f2.y = 450;
f3.y = 450;

f1.buttonMode = true;
f2.buttonMode = true;
f3.buttonMode = true;

b1.buttonMode = true;
b2.buttonMode = true;
b3.buttonMode = true;

f1.addEventListener(MouseEvent.CLICK, moveCam);
f2.addEventListener(MouseEvent.CLICK, moveCam);
f3.addEventListener(MouseEvent.CLICK, moveCam);

mySpace.addChild(f1);
mySpace.addChild(f2);
mySpace.addChild(f3);

stage.addEventListener(MouseEvent.MOUSE_WHEEL, travelSpace);
mySpace.addEventListener(Event.ENTER_FRAME, updatePos);

b1.addEventListener(MouseEvent.MOUSE_OVER, bOver);
b1.addEventListener(MouseEvent.MOUSE_OUT, bOut);
b1.addEventListener(MouseEvent.CLICK, zipTo);

b2.addEventListener(MouseEvent.MOUSE_OVER, bOver);
b2.addEventListener(MouseEvent.MOUSE_OUT, bOut);
b2.addEventListener(MouseEvent.CLICK, zipTo);

b3.addEventListener(MouseEvent.MOUSE_OVER, bOver);
b3.addEventListener(MouseEvent.MOUSE_OUT, bOut);
b3.addEventListener(MouseEvent.CLICK, zipTo);

Tweener.addTween(mySpace, {z:-f1.z, x:f1.x - 720, y:f1.y - 700, time:2});

function moveCam(e:MouseEvent):void
{
    Tweener.addTween(mySpace, {z:-e.target.z, x:e.target.x - 720, y:e.target.y - 700, time:2});
}


function travelSpace(e:MouseEvent):void
{
 Tweener.addTween(mySpace, {z:mySpace.z - (e.delta * 400), time:2});
//
if(mySpace.z > -1000){
 Tweener.addTween(mySpace, {z:-1000, time:1});
}else if(mySpace.z < -11000){
 Tweener.addTween(mySpace, {z:-11000, time:1});
}
//
}

function zipTo(e:MouseEvent):void
{
 if(e.target == b1){
  Tweener.addTween(mySpace, {z:-f1.z, x:f1.x - 720, y:f1.y - 700, time:2});
 }else if(e.target == b2){
  Tweener.addTween(mySpace, {z:-f2.z, x:f2.x - 720, y:f2.y - 700, time:2});
 }else if(e.target == b3){
  Tweener.addTween(mySpace, {z:-f3.z, x:f3.x - 720, y:f3.y - 700, time:2});
 }
}

function updatePos(e:Event):void
{
 myFilter1.blurX = -(mySpace.z + f1.z) / 80;
 myFilter2.blurX = (mySpace.z + f2.z) / 80;
 myFilter3.blurX = (mySpace.z + f3.z) / 80;
 
//
 myFilter1.blurY = myFilter1.blurX;
 myFilter2.blurY = myFilter2.blurX;
 myFilter3.blurY = myFilter3.blurX;
;
//
 f1.filters = [myFilter1];
 f2.filters = [myFilter2];
 f3.filters = [myFilter3];
 
//
 SimpleZSorter.sortClips(mySpace);
}

function bOver(e:MouseEvent):void
{
 if(e.target == b1){
  Tweener.addTween(b1, {x:753.1, time:1});
 }else if(e.target == b2){
  Tweener.addTween(b2, {x:808.8, time:1});
 }else if(e.target == b3){
  Tweener.addTween(b3, {x:881.2, time:1});
 }
}
//
function bOut(e:MouseEvent):void
{
 if(e.target == b1){
  Tweener.addTween(b1, {x:773.1, time:1});
 }else if(e.target == b2){
  Tweener.addTween(b2, {x:828.8, time:1});
 }else if(e.target == b3){
  Tweener.addTween(b3, {x:901.2, time:1});
 }
}

Still Can't Get It... Syntax Error?
still trying to get this one, suggestions haven't worked yet...

i've got a movie loaded into _level1. there's a drag and drop inside that movie. the drag and drop works fine on it's own (ie. when that movie is played on it's own) but not when it's loaded into _level1.

here's one version of the dozen different ways i've tried...

on (press) {
startDrag (getProperty(_x, _y));
}
on (release) {
stopDrag ();
if (_droptarget == "_level1.TA1") {
// send image back even though it hit target
setProperty ("", _y, OrgY);
setProperty ("", _x, OrgX);
nextFrame ();
} else {
setProperty ("", _y, OrgY);
setProperty ("", _x, OrgX);
}
}

Syntax Error?
Is there something wrong syntactically or otherwise with this code? -it is on the first frame of my preloader:

loadMovieNum ("Main.swf", 10);
loadMovieNum ("Layout.swf", 100);
loadBytes = "0 of "+Math.round((((_root.getBytesTotal()+_level10.get BytesTotal()+_level100.getBytesTotal())/1024)*1000)/1000)+" Kb";

My preloader bar moves as if the movies are in the levels and are preloading, but my loadbytes number is only representing the 6KB that is the preloader movie itself -- it is not adding the size of the two external swfs into the number....any ideas?

Thanks,
Jaime

Syntax Error, Please Have A Look
Hi! I'm new to flash and I'm now doing the "Building Games in Flash5 Part1: Player Movement and Fire" tutorial, but on step 5 where I'm about to insert the script for the laser I'm getting an syntax error.
My code looks like the one below, please help me anyone


Quote:




onClipEvent (load) {
// code goes here
}
onClipEvent (load) {
moveSpeed = 10;
_root.laser._visible = false;
laserCounter = 1;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.CONTROL) { laserCounter++;
_root.laser.duplicateMovieClip( "laser"+laserCounter, laserCounter );
_root["laser"+laserCounter]._visible=true;
}
if (Key.isDown(Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown(Key.LEFT)) {
this._x -= moveSpeed;
}
if (Key.isDown(Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown(Key.UP)) {
this._y -= moveSpeed;
}
}




Thanks in advance

Syntax Error
Hi all
Please see this Url http://www.geocities.com/elhoot
first: I would like to hear ur feedback about the design of the site
second: there is an error in the end of every page in the site, if any one have any idea about the reason please tell me.

Odd Syntax Error...
This is probably a REALLY stupid question, but I'm having some problems with a little bit of code in Flash. This is the code:


Code:
onClipEvent (load) {
var select;
var _root.qnum = 1;
var _root.gval = 0;
var _root.hval = 0;
var _root.rval = 0;
var _root.sval = 0;
var _root.end;
stop();
}


Flash reports two syntax errors:


Quote:





**Error** Scene=Scene 3, layer=Layer 1, frame=1:Line 3: Syntax error.
var _root.qnum = 1;

**Error** Scene=Scene 3, layer=Layer 1, frame=1:Line 4: Syntax error.
var _root.gval = 0;

Total ActionScript Errors: 2 Reported Errors: 2







What confuses me is the fact that it only reports errors on two of the variables, and they're all declared the same way. Does anybody know the reason for this? It's probably something really stupid that I overlooked...

Thanks,
Matt

Syntax Error?
i don't know if you will be able to tell from my script but any ideas whats wrong with it?


PHP Code:




can_mc.onPress=function(){
can_mc.startDrag();
}
can_mc.onRelease=function(){
can_mc.stopDrag();
grow=(can_mc.hitTest(soil_mc)==true)&&(planted=="1")
if(grow){
this.nextFrame();
_global.stalk="1";
attachMovie("stalk","stalk1",2);
stalk1._x = 450;
stalk1._y = 90;
}else if(can_mc.hitTest(soil_mc)==true){
this.nextFrame();}
}else if(can_mc.hitTest(inv_mc)==true){
attachMovie("jack1","jack1a",76);
jack1a._y=190;
jack1a._x=270;
}







i get the error message


Quote:




';' expected
}else if(can_mc.hitTest(inv_mc)==true){






sure its something very simple. cheers.

Syntax Error...WHY?
This keeps giving me and error and I don't know why...it's probably something real easy and obvious too...

code:

on (release) {
_root.3_mc.gotoAndPlay(1);
}



P.S. I suck at ActionScript. All I want the button to do, is to go to another movie and go to frame 1. All movies are on the Main Timeline. I want to go out of this movie, and into the other, which has the instance name of "3_mc" and go to frame 1. Pretty easy huh...

Syntax Error
Quote:





Scene=Scene 1, Layer=Content2, Frame=6: Line 29: ')' expected





code:
} else if ((variablea == 5 or variablea == 6) && variableb == 2003 && variablec == 08 && (variabled == 2 or variabled == 3 or variabled == 5)) {


Can anyone figure out where the expected ")" goes?

Syntax Error
Hello,

I am constructing a page for a school project. i have an index which loads several swf's in a holder_mc.
I am communicating between the swf's with a var placed in the root of the index.. some of the buttons or tweens alter these vars which i want to be read by the other movie and react to that information.

this action script is what i have made but i have one problem. i have a syntax error in line 6 (the first 'else if' line)

can any one help me or tell me how to do the same thing with a different

This script is located in the external SWF to read the Vars in the root of the index.

code: stop();
_root.vartaal=_level0.vartaal;
_root.varstatus=_level0.varstatus;
_root.varatractie=_level0.varatractie;

if (_level0.vartaal == 1; _level0.varatractie == 1; _level0.varstatus == 1)
{this.leds.gotoandPlay("in_Beeksebergen");
}

else if (_level0.vartaal == 1; _level0.varatractie == 1; _level0.varstatus == 2)
{this.leds.gotoandPlay("out_Beeksebergen");
}



and so on and so on...

Syntax Error Please
PHP Code:




on( release ){
loadVariables("directions/directions.swf","_root.loadMC");
}
on( release ){
if (_root.player.action == "pause") {
    _root.player.action = "play";
    _root.player.status = "playing tr. " add playtrack;
    tellTarget(_root.player.tracks) {
        gotoAndStop ("track" add ../:playtrack);
        }
    _root.player.player;
    }
}









i'm now starting to get back into flash and wanting to make an update but when i try to publish my file it giving me syntax errors.
any help on this issue will be greatly appreciated.
thanks in advance.

Syntax Error? Where?
hey hey


where for the lifeame is the syntax error in this script? I cant get it

import mx.transitions.Tween;
function doTheAction(clip:MovieClip, action:String):Void
{
switch (action){
case "toCenter":
clip._x = Tween(clip,"_x",Regular.easeInOut,clip._x,Stage.wi dth/2,30,false);
clip._x = Tween(clip,"_y",Regular.easeInOut,clip._y,Stage.he ight/2,30,false);
break;
case "wobble":
clip._parent.gotoAndStop("wibblewobble");
break;
case "whatThe****":
_level0.dummyClip.gotoAndPlay("somewhere");
break;
}
};

if i wasnt so bald id be pulling my hair out

Syntax Error
Hi, I keep getting synrax error when I try to export my swf. this code was origially written for Flash 6 and I have recntly upgraded to professional. The error lies in the first line. Any help would be much appreciated .

txtPercentage = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100) add "% loaded";
tellTarget ("loader") {
gotoAndPlay(Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100));
}

Syntax Error?
I'm totally lost here, I'm getting a syntax error in the following code:

// import class
import com.senocular.ProgressiveDrawing;

// starDrawing ProgressiveDrawing instance, draws in _root
var starDrawing:ProgressiveDrawing = new ProgressiveDrawing(_root);

// define drawing commands for star
starDrawing.lineStyle(1,1,100);
starDrawing.moveTo(150,79);
starDrawing.lineTo(168,133);
starDrawing.lineTo(225,133);
starDrawing.lineTo(179,167);
starDrawing.lineTo(196,221);
starDrawing.lineTo(150,188);
starDrawing.lineTo(104,221);
starDrawing.lineTo(121,167);
starDrawing.lineTo(75,133);
starDrawing.lineTo(132,133);
starDrawing.lineTo(150,79);

// draw star over 200 frames
starDrawing.draw(200);

I can't seem to find it anywhere.

Syntax Error - Why Please Help
I have the following function:


Code:
function calculateNewX(centerStageX, regionX, regionWidth, holderX, recurse) {
// Distance to center point for left side of region = Center of map _x – region _x
d = centerStageX–regionX;

//Center point _x for region = Region width / 2
RcpX = regionWidth/2;

//Total Pixels to move region in order to center horizontally = D +/- RcpX
TpX = d - RcpX;

// Final X Position for Map Holder = Map Holder _x +/- TpX
FxMH = holderX – TpX;

return FxMH;
}



And I keep getting the following errors:

Code:
**Error** \serverapachehtdocs\_currentoOCsource filesflashmapFunctions.as: Line 195: Syntax error.
d = centerStageX–regionX;

**Error** \serverapachehtdocs\_currentoOCsource filesflashmapFunctions.as: Line 204: Syntax error.
FxMH = holderX – TpX;

**Error** \serverapachehtdocs\_currentoOCsource filesflashmapFunctions.as: Line 206: Statement must appear within on/onClipEvent handler
return FxMH;

**Error** \serverapachehtdocs\_currentoOCsource filesflashmapFunctions.as: Line 207: Unexpected '}' encountered
}

Total ActionScript Errors: 4 Reported Errors: 4



What am I doing wrong?! Any help would be hugely appreciated

[F8] Syntax Error?
whats a syntax error? I don't know how to fix them and I get them kinda a lot. This was the code I used for a skill button. Do I need a different order or something? The whole project thing was to test a turn based system (thats why the codeing might be bad or wrong)
on(press)
{if(_root.mp)(LESSTHAN)0}
on(press)
{gotoAndStop(12)}
on(release)
{gotoAndPlay(7)}

thanks for reading.

[F8] Syntax Error
hi there,

I'm using this panorama picture template (http://www.flashkit.com/movies/Anima...9997/index.php)

and everything works fine when my publishing settings are set to flash 5,6,7 | AS1

why then does it throw up a syntax error when i export using flash player 8 when the AS is still set to 1?

the line in question which is being called up as a syntax error is:

Code:
dup = "body" add m;

the full piece of code is:

Code:
m = 0;
while (Number(m)<Number((/:myPanoramaDuplicates*2)-1)) {
m = Number(m)+1;
dup = "body" add m;
// Depth of this layer and depth of city layer CANT be the same. So in this layer I add 10 to the depth to make sure of that.
duplicateMovieClip("body", dup, Number(m)+10);
setProperty(dup, _x, Number(getProperty(dup, _x))+Number(m*getProperty(dup, _width)));
}


if anyone could tell me whats wrong with the code when exporting as flash player 8? thanks.

Syntax Error
Code:
package
{
import flash.display.Sprite;
import flash.events.Event;
public class Boxes extends Sprite
{
private var box:Box;
private var boxes:Array;
private var gravity:Number = 0.2;
public function Boxes()
{
init();
}
private function init():void
{
boxes = new Array();
createBox();
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void
{
box.vy += gravity;
box.y += box.vy
if(box.y + box.height / 2 > stage.stageHeight)
{
box.y = stage.stageHeight - box.height / 2;
createBox();
}
for(var i:uint = 0; i < boxes.length; i++)
{
if(box != boxes[i] && box.hitTestObject(boxes[i]))
{
box.y = boxes[i].y - boxes[i].height / 2 –
box.height / 2;
createBox();
}
}
}
private function createBox():void
{
box = new Box(Math.random() * 40 + 10,
Math.random() * 40 + 10);
box.x = Math.random() * stage.stageWidth;
addChild(box);
boxes.push(box);
}
}
}
When I try ro run the program I get the following error message:


Quote:




Boxes.as, Line 33 1093: Syntax error.




The line in question is:

Code:
box.y = boxes[i].y - boxes[i].height / 2 –
Anyone knows where is the mistake?

Syntax Error
is there any syntax error in the following statement?
if there, please give me the correct code.



var eval(pages._xmouse < 0 ? (-pw / 2) : (pw / 2)) = gdir * pw / 2;

Syntax Error
I keep getting this syntax error i dont know what it is i also have this action on a frame its suppose to make my drop down menu drop (which is called navigate) but whenever I rollover it the menu just sits there what do I do to change this.


ActionScript Code:
// check to see if the mouse is over the menu every time a new frame is entered
// (at the current frame rate that is 12 times a second)
this.navigate.onClipEvent (enterFrame) {
    // if the mouse IS over the menu ...
    if (this.hitTest(my_root._xmouse, my_root._ymouse, true)) {
        // if the menu is NOT fully open
        if (this._currentframe<this._totalframes) {
            // go to the next frame of the menu opening sequence
            nextFrame();
        }
        // if the mouse is NOT over the menu
    } else {
        // if the menu is NOT fully closed
        if (this._currentframe>1) {
            // play the previous frame of the menu opening sequence
            prevFrame();
        }
    }
}

**Error** Scene=Scene 1, layer=Layer 31, frame=100:Line 3: Expected a field name after '.' operator.
this.navigate.onClipEvent (enterFrame) {

Total ActionScript Errors: 1 Reported Errors: 1

Syntax Error
When I publish my code it keeps saying my syntax is wrong for one line.


PHP Code:



var oMatrix:Object = new Object{matrixType:"box", x:0, y:0, w:0, h:0, r:0}; 




what did I do wrong?

Syntax Error :(
var frameArray:Array = new Array(23, 1, 34, 18, 27, 31, 42);
function randFrame():Void{
var whereFrame:Number = Math.floor(Math.random()*frameArray.length
)
_root.gotoAndStop(frameArray[whereFrame]);
frameArray.splice(whereFrame, 1);

(There is a syntax error in this script. What is the error?)

Syntax Error
Hi

Just trying to load multiple images using a for loop. This is what I have, but my syntax for the image file path isn't right. How should I write it??

loadMovie("assets/images/scroller/"+i".jpg",_root.container["imageHolderMC"+i].img)

Thanks

Some Syntax Error
I have writen this code and it is giving me error when i am accessing the lineTo method of myshape. Unable to get what problem is it.


Code:
this.addEventListener (Event.ENTER_FRAME, drawCurve);

var points:Array=[[6.7,88.0],[-1.8,87.2],[-36.8,81.8],[-101.1,55.8],[-138.9,-10.4]];
var myShap:Shape = new Shape();

function drawCurve (event:Event):void{
var arrayIndex:Number = -1;
var bDrawCurve:Boolean = false;

if (this.currentFrame == 1){
myShape.graphics.lineStyle(4, 0x990000);
myShape.graphics.moveTo(points[0][0], points[0][1]);
}
else{

if ((this.currentFrame%15) == 0){
bDrawCurve = true;
arrayIndex = (this.currentFrame/15);
trace ("Array Index: " + arrayIndex);
myShap.graphics.lineTo(points[arrayIndex][0],points[arrayIndex][1]);
}
}
}

Syntax Error
Hi,

this script:

onClipEvent (data) {
Button(1,15);
_root.max = Number(anzahl);
_root.nr=1;
}

is reporting this error:
**Error** Scene=Scene 1, layer=Clips, frame=1:Line 43: Syntax error.
Button(1,15);

Total ActionScript Errors: 1 Reported Errors: 1

Can someone help please?

Tanks

Syntax Error
I am working with 2 dynamic text fields(Breech1, AverageTotal1)... 6 variables (num1, num2, num3, num4, num5, num6) and math.

I have tested the code and the first "if "statement in my code works, but the "else if'"s do not work. I am new to math in flash... and any help would be greatly appreciated.

Best Regards.







Attach Code

//shut off if less than 1000
if (Breech1 < 1000){
// cybercrime
AverageTotal1 = "0";
}

// greater than 1,000 but less than 50,000
if(Breech1 >= 1000){
AverageTotal1 = (Breech1)*(Number(cybercrime.num));
}
// greater than 50,000 but less than 100,000
else if(Breech1 >= 50000){
AverageTotal1 = (50000*(Number(cybercrime.num)))+(((Breech1)- 50000)*(Number(cybercrime.num2)));
}
// greater than 100,000 but less than 250,000
else if(Breech1 >= 100000){
AverageTotal1 = ((50000*(Number(cybercrime.num)))+ (50000*(Number(cybercrime.num2))))+(((Breech1)- 100000)*(Number(cybercrime.num3)));
}
// greater than 250,000 but less than 1,000,000
else if(Breech1 >= 250000){
AverageTotal1 = (50000*(Number(cybercrime.num)))+(50000*(Number(cybercrime.num2)))+(150000*(Number(cybercrime.num3)))+(((Breech1)-250000)*(Number(cybercrime.num4)));
}
// greater than 1,000,000 but less than 5,000,000
else if(Breech1 >= 1000000){
AverageTotal1 = (50000*(Number(cybercrime.num)))+(50000*(Number(cybercrime.num2)))+(150000*(Number(cybercrime.num3)))+(750000*(Number(cybercrime.num4)))+(((Breech1)-1000000)*(Number(cybercrime.num5)));
}
// greater than 5,000,000
else if(Breech1 >= 5000000){
AverageTotal1 = (50000*(Number(cybercrime.num)))+(50000*(Number(cybercrime.num2)))+(150000*(Number(cybercrime.num3)))+(750000*(Number(cybercrime.num4)))+(1000000*(Number(cybercrime.num5)))+(((Breech1)-5000000)*(Number(cybercrime.num6)));
}

Syntax Error
Hi everybody :D,

I can understand why I am getting a syntax error???

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 10: Unexpected '&&' encountered
if (testtext.text >= 010107) && (testtext.text <= 080107) {

Total ActionScript Errors: 1 Reported Errors: 1



you have any idea how I can make this work ??? thanks ! :D







Attach Code

var TestVar = info.text;
flightDateChooser.onEnterFrame = function() {
trace(info.text);
testtext.text = info.text;
};
var onEnterFrame = function () {
if (testtext.text >= 010107) && (testtext.text <= 080107) {
trace ("vid1")
}

}

























Edited: 03/28/2007 at 11:27:53 AM by Kaneon

Syntax Error.
Hello.

I'm trying to make a preloader in flash. I use actionscript 2.0.


When i try to load it i get a syntax error.

What is rong?

Here is my code:







Attach Code

stop();

loaderInt = setInterval (Lbar, 10);

Function Lbar() {
if(getBytesLoaded() >= getBytesTotal()) {
play()
clearInterval(loaderInt);
}
fill._xscale = (getBytesLoaded()/getBytesTotal()*100);
}

























Edited: 03/16/2008 at 04:41:13 AM by Maxyboy001100

Syntax Error
hey guys so i'm trying to add a music player to my website and things are fine except for this
1084: Syntax error: expecting identifier before in

it's a really long coding but it has a problem with this
Tween.prototype.in = function (c, b, v, d, s)
{
return (b + v * Math.pow(c / d, s));
};
Tween.prototype.out = function (c, b, v, d, s)
{
return (b + v * (1 - Math.pow(1 - c / d, s)));
};

what's bold is what he is telling me as a problem.
i hope you guys can help me it's for school but even my teacher doesn't know

Syntax Error Help Please.
In CS3, using AS2.

Taking a tutorial on mp3player. My xml file is fine, my mp3Player.as file is fine. In the mainmovie...one layer, one frame. On frame one i have an action to inlude mp3Player.as on line 1 - #include "mp3Player.as" -

when testing movie i get 'syntax error on line 2' but there is no line 2......is there an issue with the 'include' statement, is it not closed ? I dont get it, still learning AS.

I do know there is something wrong with my action in layer 1, frame 1, Line 2 (which is blank) Line 1 again is as follows:

#include "mp3Player.as"

any ideas?

Syntax Error
I have a code like this, but it I can't get it right. Why can't I use mcMain."contentItem"+i.item_name ? If I use mcMain.contentItem1.item_name then it works. How should I make it correct to use i variable?


Code:
mcMain.attachMovie("contentSubtitle", "contentItem"+i, mcMain.getNextHighestDepth(), {_y:mcMain.height, _x:0});
mcMain."contentItem"+i.item_name = "some text";
i++;

Can Some Help Me Fix The Syntax Error?
Code:
var thumb_spacing = 40;
// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.text = raw_text;
}
function GeneratePortfolio(portfolio_xml){
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i < portfolioPictures.length; i++){
var currentPicture = portfolioPictures[i];

var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
currentThumb_mc._x = i * thumb_spacing;

currentThumb_mc.createEmptyMovieClip("thumb_container",0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);

currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;


currentThumb_mc.onRollOver = currentThumb_mc.onDragOver = function(){
info_txt.text = this.title;
}
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut = function(){
info_txt.text = "";
}
currentThumb_mc.onRelease = function(){
image_mc.loadMovie(this.image);
description_lv.load(this.description);
}
}
}


//new transition code
function loadTheImage (e):void {
TransitionManager.start(image_mc, {type:Wipe, direction:Transition.IN, duration:3, easing:None.easeNone, startPoint:1});
}
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE,loadTheImage);


// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
if (success) GeneratePortfolio(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load
portfolio_xml.load("portfolio.xml");

Syntax Error
I'm not a newbie but i figuredthis is a newbie questions....This should be an easy one...I get a syntax error on this button code...it says the i can't use else without matching if...
thanks,
_DB


ActionScript Code:
on(rollOver){
if (_root.box_one == "on")
    trace("can't ride this box");
} else {
    loadMovie("item1.swf","fashionloader");
    accwall.play();
    pop_1.gotoAndPlay("on");
    pop_2.gotoAndStop("off");
    pop_3.gotoAndStop("off");
    pop_4.gotoAndStop("off");
    pop_5.gotoAndStop("off");
    pop_6.gotoAndStop("off");
    pop_7.gotoAndStop("off");
    pop_8.gotoAndStop("off");
    pop_9.gotoAndStop("off");
    pop_10.gotoAndStop("off");
    pop_11.gotoAndStop("off");
    pop_12.gotoAndStop("off");
    _root.box_one = "on";
    _root.box_two = "off";
    _root.box_three = "off";
    _root.box_four = "off";
    _root.box_five = "off";
    _root.box_six = "off";
    _root.box_seven = "off";
    _root.box_eight = "off";
    _root.box_nine = "off";
    _root.box_ten = "off";
}

Error Syntax
I created a slideshow and now I'm tryin to add a preloader for it. The slideshow itself published fine without the preloader but when I added my slideshow into my preloader it won't function and I kept getting error syntax.

I'm using an operator with actionscripts....

frame 1:

startx = getProperty(/:walls, _x);
starty = getProperty(/:walls, _y);
horizontalno = /:targetx-startx;
vertikalno = /:targety-starty;
setProperty(/:walls, _x, startx+(horizontalno/2));
setProperty(/:walls, _y, starty+(vertikalno/2));

frame 2:

gotoAndPlay(1);


when I tried to publish it with my preloader I get this error....

**Error** Symbol=script, layer=Layer 1, frame=1:Line 1: Operator '=' must be followed by an operand
startx = getProperty(/:walls, _x);

**Error** Symbol=script, layer=Layer 1, frame=1:Line 2: Operator '=' must be followed by an operand
starty = getProperty(/:walls, _y);

**Error** Symbol=script, layer=Layer 1, frame=1:Line 3: Operator '=' must be followed by an operand
horizontalno = /:targetx-startx;

**Error** Symbol=script, layer=Layer 1, frame=1:Line 4: Operator '=' must be followed by an operand
vertikalno = /:targety-starty;

**Error** Symbol=script, layer=Layer 1, frame=1:Line 5: Unexpected '/' encountered
setProperty(/:walls, _x, startx+(horizontalno/2));

**Error** Symbol=script, layer=Layer 1, frame=1:Line 6: Unexpected '/' encountered
setProperty(/:walls, _y, starty+(vertikalno/2));

Total ActionScript Errors: 6 Reported Errors: 6


Can someone please help me out with this? Also, I'm using Flash MX 2004 Professional, if that makes a difference.

thanks.

Syntax Error?
when i use this for move the object in x all its ok



ActionScript Code:
/test:x_target = Number(getProperty("/test", _x))+Number(_level0:movespeed);


but when i use this for Y move dont work

ActionScript Code:
/test:y_target = Number(getProperty("/test", _y))+Number(_level0:movespeed);


someone can help me?
In flash 5 all works well but in 8

Syntax Error
I found this tutorial on making a panoramic image. But when i export it using flash 8 settings the actionscript outputs an error.

Here is the code;


Code:

// --------------------------------------------
// Make duplicate of picture
// --------------------------------------------
// tmi=total duplicates (2)
// dup=new movie duplicates
// image=original movie
// --------------------------------------------
m = 0;
tmi = 2;
while (Number(m)<Number((tmi*2)-1)) {
   m = Number(m)+1;
   dup = "image" add m;
   // Depth of this layer and depth of picture layer CANT be the same. So in this layer I add 1 to the depth to make sure of that.
   duplicateMovieClip("image", dup, Number(m)+1);
   setProperty(dup, _x, Number(getProperty(dup, _x))+Number(m*getProperty(dup, _width)));
}


It outputs a syntax error with this;

Code:

dup = "image" add m;


And i havent gotta clue why it isnt working.

Help will be greatly appreciated

UGH Syntax Error In Flash MX
HELP! i'm getting the following error in the subsequent line of my action script, using FLASH MX...

Error- Property name expected in GetProperty.

Script- setProperty(("../nav", "_rotation"), getProperty("../nav", "_rotation"), -("xPos/20"));

if it's important, the script is meant to rotate a circular menu.

Syntax Error - Can You Check It?
I'm getting errors from this code I got off the tutorials.

loadPercent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() *
100) + "%");
loadBytes = (Math.round((_root.getBytesLoaded() / 1024) * 1000) / 1000 + " Kb
of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");

if (_root.getBytesLoaded() == _root.getBytesTotal()){
loadPercent = "100%";
loadBytes = (Math.round((_root.getBytesLoaded() / 1024) * 1000)
/ 1000 + " Kb of " + Math.round((_root.getBytesTotal() / 1024) * 1000) / 1000
+ " Kb total Loaded.");
gotoAndPlay("Button");
}


Is there something missing? Are there brackets missing?

Spot The Syntax Error
Code:
/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "manhattan/";
// fill this array with your pics
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg", "image10.jpg","image11.jpg", "image12.jpg", "image13.jpg", "image14.jpg", "image15.jpg", "image16.jpg", "image17.jpg", "image18.jpg", "image19.jpg", "image20.jpg", "image21.jpg","image22.jpg", "image23.jpg", "image24.jpg", "image25.jpg", "image26.jpg", "image27.jpg", "image28.jpg", "image29.jpg", "image30.jpg", "image31.jpg", "image32.jpg","image33.jpg", "image34.jpg", "image35.jpg", "image36.jpg", "image37.jpg", "image38.jpg", "image39.jpg", "image40.jpg", "image41.jpg", "image42.jpg", "image43.jpg","image44.jpg", "image45.jpg", "image46.jpg", "image47.jpg", "image48.jpg", "image49.jpg", "image50.jpg", "image51.jpg", "image51.jpg", "image53.jpg", "image54.jpg","image55.jpg", "image56.jpg", "image57.jpg", "image58.jpg", "image59.jpg", "image60.jpg", "image61.jpg", "image62.jpg", "image63.jpg", "image64.jpg", "image65.jpg","image66.jpg", "image67.jpg", "image68.jpg", "image69.jpg", "image70.jpg", "image71.jpg", "image72.jpg", "image73.jpg", "image74.jpg", "image75.jpg", "image76.jpg","image77.jpg", "image78.jpg", "image79.jpg", "image80.jpg", "image81.jpg", "image82.jpg", "image83.jpg", "image84.jpg", "image85.jpg", "image86.jpg", "image87.jpg","image88.jpg", "image89.jpg", "image90.jpg", "image91.jpg", "image92.jpg", "image93.jpg", "image94.jpg", "image95.jpg", "image96.jpg", "image97.jpg", "image98.jpg""image99.jpg", "image100.jpg", "image101.jpg", "image102.jpg", "image103.jpg", "image104.jpg", "image105.jpg", "image106.jpg", "image107.jpg", "image108.jpg", "image109.jpg""image110.jpg", "image111.jpg", "image112.jpg", "image113.jpg", "image114.jpg", "image115.jpg", "image116.jpg", "image117.jpg", "image118.jpg", "image119.jpg", "image120.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
MovieClip.prototype.fadeOut = function() {
this.onEnterFrame = fadeOut;
};
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.holder.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);


this code belongs to suprabeener. i modified it and somehow i get an error of syntax on line 11. i dont kno what to fix! plz help

Syntax Error Function
hi all,
this a stupid newb eror, but it will usefull to find the solution
I try to do a download without openning page.
The prob,
Doing wrong syntaw with my onpress...
It doesn't take my var fichier..
Somabody get idea?


Quote:





var chemin = "http://www.mywebsite.com/PDF/ref/" ;

download = function () {
getURL ("http://www.mywebsite.com/download.php?chemin=" + chemin + "&fichier=" + fichier ) ;
}

this.bt1.onPress = download ; var fichier = "1.pdf";
this.bt2.onPress = download ; var fichier = "2.pdf";

Simple A/S Syntax Error
hey,

What is wrong with this code?


Code:
_root.currMovie = “home”;
container.loadMovie(_root.currMovie+".swf");


This is the syntax error message i'm getting:


**Error** Scene=Scene 1, layer=Layer 43, frame=33:Line 1: Operator '=' must be followed by an operand
_root.currMovie = “home”;

Total ActionScript Errors: 1 Reported Errors: 1


i'm not to familar with A/S, someone please help me.

Thank You,
Baljinder

Help - I Must Be Making Syntax Error
Hi, just wondering what I’m doing wrong. I have the following actionscript: (please note that callevel, cal_ab, and cal_y are global variables).

on (release) {
callevel.slider_movie.cal_ab._y= cal_y;
trace ("check my variables "+callevel+cal_ab+cal_y);
}

When a button is pushed I want the _y property of a movie clip to change so that the clip moves. The trace is picking up all the variables ok but the code callevel.slider_movie.cal_ab._y= cal_y; doesn’t seem to be changing the _y property. If I enter the values of the variables into the line of code then the _y property updates and the movie clip moves. So entering the following works: _level2.slider_movie.a._y= cal_y;

Does anyone know what I’m doing wrong?
Cheers

Syntax Error I Cant Figure Out
hi all,

can anyone see whats wrong with this bit of code?
code: item_txt.htmlText += "<a href="" + itemLink + "" target="_blank"><span class="headline">" + itemTitle + "</span></a><br><span class="thread">" + itemDesc + "</span><br>"

thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved