Array Syntax Error Or Sheer Impossibility?
ok, I got this doubt wich is kinda making me wonder for a while. scenario: _I've got a movieclip with a bunch of buttons inside that invoke a function and send parameters to it. no sweat so far._those buttons are named with a specific word followed by "_btn". that word is the same as the one that goes in the parameter. for example: Code: gobbledigook_btn.onRelease = function() {_root.myFunction(gobbledigook)} question:I'd like to be this work with a for loop, so I don't have to repeat the code for every button. so this is what I did: Code: _root.wordsList = ["bafflegab", "esculent", "kakistocracy", "palimpsest", "quincux"]for(i=0;i<_root.wordsList.length;i++){ [_root.wordsList[i]+"_btn"].onRelease = function() { _root.myFunction(_root.wordsList[i]); }} now, I've searched for array syntax and all, but I can't get this to work, so my question is becoming "can this be done at all?!" answers, anyone?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 05-31-2008, 09:45 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading External Data To An Array Syntax Error
I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like
ActionScript Code:
array[0] = event.target.data.uid1_name;
I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:
ActionScript Code:
for(var i = 0; i<20;i++){
fArray[i] = event.target.data.uid[i]_name;
}
This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out.
Any thoughts on the syntax to iterate the number after uid (uid1_name, uid2_name, uid3_name, etc)?
Mysterious Syntax Error Message When Adding New Array
I keep getting this syntax error in my Test Movie Output:
Quote:
Scene=Scene 1, Layer=Actions, Frame=1: Line 191: ';' expected
var pickqty_arr(comp) = [
but i honestly can't find any error in this script. It seems fine to me. I have other similar scripts that work just fine - why doesn't this?
If I comment out the part of the script where the error occurs (below), the error disappears and my movie functions correctly for the most part, but I can't figure out why.
ActionScript Code:
//Quant Box
_root.createTextField("Quant",20,400,250,50,20);
var QuantText = Quant;
Quant.text = "q0";
Quant.type = "dynamic";
Quant.maxChars = 2;
Quant.font = "Arial";
Quant.size = 10;
Quant.align = "right";
QuantDisp = new TextFormat(Quant);
Quant.setTextFormat(QuantDisp);
Quant.setNewTextFormat(QuantDisp);
//Quantity List
var pickqty_arr(comp) = [ // <--THIS IS LINE # 191 WHERE THE SYNTAX ERROR SUPPOSEDLY OCCURS
{label:"QUANTITY"},
{label:"qone",data:'q1'},
{label:"qtwo",data:'q2'},
{label:"qthree",data:'q3'}];
function changeQty(comp) {
QuantDisp.text = comp.getSelectedItem().data;
Quant.setTextFormat(QuantDisp);
Quant.setNewTextFormat(QuantDisp);
}
qtylist.setDataProvider(pickqty_arr); // REFERS TO COMBO BOX CALLED qtylist
qtylist.setSelectedIndex(0);
qtylist.setChangeHandler("changeQty");
btw, I'm using Flash MX.
Thanks!
Loading External Data To An Array Syntax Error
I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like
ActionScript Code:
array[0] = event.target.data.uid1_name;
I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:
ActionScript Code:
for(var i = 0; i<20;i++){
fArray = event.target.data.uid_name;
}
This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out.
I've also tried the following:
fArray = event.target.data["uid"+i+"_name"];
fArray = event.target.data.["uid"+i+"_name"];
fArray = event.target.data."uid"+i+"_name";
All three of those also give me errors. For the first one the trace statement outputs "undefinded" instead of "Doug". For the second I get "syntax error. Expecting identifier before left bracket". And for the third I get "syntax error, expecting identifer before uid.":
Any thoughts on the syntax to iterate the number after uid (uid1_name, uid2_name, uid3_name, etc)?
**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!
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);
Sheer Courtain FX (help)
hi flash lovers!
I hope you can solve my puzzle here:
check the website:
- http://www.janetjackson.com,
once it's done dwnloading the .swf click on:
-Enter song experience.
let it load again and observe:
there you will see this opening courtain that makes things that stand behind it look sheer. I wanted to know if any of you could find out how they did that nice "opaque"(sheer)effect.
thanks for your help.
Eros
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});
}
}
Buttons Screwed Up {Sheer Hell. HELP}
My fla contains a menu. One button on the menu, when pressed, goes to frame 40, which contains a loaded swf. They can navigate the loaded swf, and press a button on the bottom to return to the menu.
However after returning to the menu, all will only go to frame 40. It's like there is a scripting conflict between loaded and unloaded buttons or something.
Is there some kind of issue with loaded and unloaded clips' buttons conflicting?
What is wrong? This has swallowed up a ton of my time.
Update:
I think the problem is two things:
1) The loaded swf's reference "this._parent" to navigate the root, and the non-swf's use _root.[clip] to navigate.
2) The problem occurs when one specific loaded SWF interacts with the root, and then calls a calls a frame in another loaded SWF. Once inside the frame of the second SWF, you can use the button to get back to the main menu, (The main menu is an MC and not a SWF). This is when the buttons get jammed, and will only go back to the second SWF. It's like their code gets erased.
Does that detail things a little better?
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)));
}
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?
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.
|