Flash - Keeping Track Of Variables Across App (Syntax Error)

Aug 1, 2011

I wrote a singleton class to keep track of some variables across my application. I am getting a syntax error that I can't figure out, I am sure that I am missing something simple but it's been one of those days. Anyone see something wrong with my code?

The error is 1084: Syntax error: expecting rightparen before resultNumber.
public static function setResult(int resultNumber, int value): void {
switch(resultNumber) {
case 2: { this.result2 = value; break; }
case 3: { this.result3 = value; break; }
case 4: { this.result4 = value; break; }
case 5: { this.result5 = value; break; }
[Code] .....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Keeping Track Of Pages?

Mar 2, 2011

I have the code that adds a page number to each page. However, when I go backwards or back to the beginning, the numbers overwrite each other, and will not reset back to zero (first frame)Here is what I am using

ActionScript Code:
var pageCount:Number = 0;
var pageTotal:int = 14;

[code]....

View 0 Replies

ActionScript 2.0 :: Keeping Track Of Which Clip Is Open?

Aug 5, 2004

I have three movie clips which launch three different sections of my flash site when clicked. These clips are tiny images of three products.

When you click them I want another group of 3 clips which contain animations of the products zooming in to play an appropriate frame when they are clicked to zoom in.

Then, once the animation is done... the appropriate section loads.

Here is the problem. I can do the button actions fine. BUT -- When the next product has to zoom up I cannot get the one that is already zoomed up to zoom down and then play the next products zoom up animation.

Anyone know of a way to track and update the states of these? Or determining which of the 3 products was clicked and let them zoom in and out dynamically?

View 1 Replies

ActionScript 2.0 :: Keeping Track Of Loaded Movies?

Mar 26, 2003

how to keep track of loaded MCs? I have a navigation system loading content MCs. The problem is, when I choose another nav button, I want it to (onPress) figure which clip is currently loaded then gotoAndPlay a frame label in that clip, which will play an exit animation and load the content area corresponding to the newly pressed button.

Someone on Flashkit suggested having the loaded content MC send a variable to the main time line to act as a kind of flag to say which section is active but I'm not sure how to go about doing this.

View 7 Replies

ActionScript 2.0 :: Keeping Track Of 4 Button Presses

Jan 14, 2009

I'm attempting to create a few very simple flash games, but I haven't been able to figure out the coding. What I am attempting is to have 4 buttons each activated on a different keypress. Each time a user presses one of the keys, a specific animation is triggered, showing that the key was pressed. What I need to know is- how do I have flash trigger a final animation when all four keys have been pressed?

I tried making a set of dynamic text boxes that would change text, one for each button. I figured flash could run a simple string check (like in the basic password tutorial here) and if they all proved true it could goto and play the next scene or another MC. BUT- It seems to only check at the beginning of the movie, and if I attached it to onEnterFrame, Flash would have a cow about my syntax!

View 5 Replies

ActionScript 3.0 :: Keeping Track Of Movie Timeline Calls?

Sep 4, 2009

I may be chewed out for my methodology of how I'm developing this application which I am okay with as long as it enables me to be a better developer.That being said, I was wondering: how do all of you track movie timeline calls?I am building a web site for my company similar to 2advanced as there's just A LOT of graphic elements and animation. Because there are so many calls and a lot of the look is based on one element being called simultaneously and/or exactly after another element I'm having a hard time keeping track of all the calls(yes....I'm doing ALL of these calls in the timeline). Right now I have a hand-drawn tree diagram and it just keeps getting larger and larger.

On another note is there a better way of doing playing each graphic element than "gotoAndPlay" commands on the timeline? I realize that I could have done all of this in external files, but if that's the case then I imagine I would be doing the same thing and just creating a bunch of classes.

View 1 Replies

ActionScript 2.0 :: Keeping Track Of Score On A Leader Board?

Jun 10, 2010

I create a password and go to save the password and get an error saying it not in the table.The error was because i had to press generate php code.That was so fustrating. couldnt belive it . Ive just wrote the answer now if any 1 else has the same error. It was annoying .

//__________________________________________________ ___________________________________
http://library.creativecow.net/artic...o-tutorial.php
<?PHP

[code].....

View 2 Replies

ActionScript 2.0 :: Keeping Track Of Clicks With Shared Object?

Jan 15, 2008

I'm trying to write a function that keeps a running count whenever a button is clicked - and then writes the count to a Shared Object cookie. Here's the code:

Code:
function counterVar() {
var elemSharedObject:SharedObject = SharedObject.getLocal("elementChoices", "/");

[Code]....

Everytime it runs the count gets reset to "1", endlessly.

View 2 Replies

Flash :: Getting CS3 AS 2.0 Syntax Error

Jun 2, 2009

I'm pretty new to Flash and my first project is my own on-line portfolio. I found (what I think is a Flash 5) code on this board to create an infinite menu. I'm trying to tweak it so that it works in AS 2.0 for CS3 and I keep getting a syntax error. [code]...

View 2 Replies

Flash :: Can't Find Syntax Error

Jan 17, 2012

have anyone can tell me what syntax error on this actionscript (actionscript3.0)?

var rotY: Number = (mouseY - (stage.stageHeight / 2)) / (stage.height / 2) * 400;

View 2 Replies

ActionScript 2.0 :: Flash Player Causing Syntax Error

Aug 29, 2006

I have downloaded a component using the duplicate symbol function, it works fine when published with Flash Player 7 but when I try to update it to Flash Player 8 and publish it produces this error message:[code]

View 3 Replies

ActionScript 3.0 :: Flash Based Advent Calendar - Syntax Error?

Dec 2, 2011

I am very new to Flash. I am currently putting together a flash based advent calendar but coming stuck on a code which keeps throwing back a syntax error. The code I have input is
on(release){this.play();}
Which runs a movie clip when you click on a box.
See the tutorial here to see where I'm coming from: [URL]

View 5 Replies

Flash - 1084: Syntax Error: Expecting Leftparen Before Semicolon

Sep 22, 2010

I am getting 2 syntax errors out of this. I am new to Flash. How can I fix this?

var paddlepos:int = paddle.x.position
if; (paddlepos > 253)
{
paddle.x.postition = 253;
}

Syntax errors:

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.

View 2 Replies

Flash :: Syntax - Get Error Clip To Play If Email Is Not Good

Jul 29, 2011

Trying to get error clip to play if email is not good, trying

if (trace(emailExpression.test(email.text)))
{
error_email.play();
}

but it's playing even if email is right.

View 1 Replies

ActionScript 3.0 :: Flash 1084: Syntax Error: Expecting Colon Before MS

Nov 20, 2011

Im getting error on Line 61 here is the line

[Code]...

View 4 Replies

ActionScript 3.0 :: Error "1084: Syntax Error Expecting Rightparen Before _self

Apr 19, 2009

Im having a problem getting my code to navigate to a url in the same browser window, here is what I've got:
 
private function onClick(e:MouseEvent):void{            switch(e.target){                case casestudyBtn:                    navigateToURL(headerVO.caseStudyURL, "_self");                    break;                case campaignBtn:                    navigateToURL(headerVO.campaignURL, "_self");                    break;            }        }
 
It keeps returning the error "1084: Syntax error: expecting rightparen before _self.

View 2 Replies

ActionScript 3.0 :: Error 1087 Syntax Error: Extra Characters Found At The End Of Program?

Jul 26, 2010

i was building a simple menu shown on a tutorial entitled Drop Down Menu and Linking it: Flash Toturial. Im using Flash CS3 action script 3.0 and i recieve this error 1087 syntax error extra characters found after endo fo program.

View 4 Replies

ActionScript 2.0 :: Get An Error , Syntax Error: Extra Characters Found After End Of Program?

Sep 10, 2008

1.) I have the following exact code for a button in a keyframe on the timeline (not in the button itself and of course excluding the quotes)

"
on (release) {
getURL ("www.yoursite.com", "_blank");
}
"
and I get the following error when I try and preview in Flash CS3 1087 : Syntax error: extra characters found after end of program.

2.) Also, I have another layer with a "stop" action taking place at the same time that this button occurrs, however, once I have the script in the keyframe for the button, it seems to override the stop action. So, basicly, IM looking to stop the movie and get this button to, once clicked, open a web address.

View 14 Replies

Professional :: Getting Error ... 1084: Syntax Error: Expecting Leftperan Before Colon?

Apr 8, 2010

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?

View 1 Replies

Actionscript 3.0 :: Error "1084: Syntax Error: Expecting Colon Before Dot

Jul 12, 2009

Code: Select allport.push({twitterXML.children()[3].child(j).@name:twitterXML.children()[4].child(i).child(j).child(0)});

getting error "1084: Syntax error: expecting colon before dot.

View 3 Replies

ActionScript 3.0 :: Receiving Error 1158: Syntax Error: Missing Left Brace ({) Before The Function?

Sep 24, 2010

I searched the forums for the error, but the methods they used couldn't help my program, it's an Actionsctipt file in AS3 with CS4.
 
I am receiving error 1158: Syntax error: missing left brace ({) before the function body.Source: public function DirectBlock (e:Event) extends MovieClip :void{  //DirectBlock[code].....

View 1 Replies

ActionScript 3.0 :: Customizing Template - Error 1084: Syntax Error: Expecting Identifier Before 21431

Dec 1, 2009

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]

View 9 Replies

Actionscript :: Flash - Baffling Syntax Error 1084 In Expecting Semicolon?

May 19, 2011

I've had these errors before,Full error:

Main.as, Line 513 1084: Syntax error: expecting semicolon before leftbrace.

This is Line 513:

} else (homeBool == false && embedBool == false) {[code]............

View 3 Replies

ActionScript 3.0 :: Flash 1087: Syntax Error: Extra Characters Found After End Of Programme?

Oct 8, 2011

I am trying to import a .as file to my swf but I get the error below:1087: Syntax error: extra characters found after end of programmeIn my FLA I have a keyframe with:import "NumbersAndMath.As"In the same folder I have saved NumbersAndMath.AsThe code for this file is:

package {
import flash.display.Sprite;
import flash.text.TextField;

[code].....

View 3 Replies

ActionScript 2.0 :: Using Variables In Dot Syntax?

Jun 8, 2004

This animation I'm working on has a dozen pairs of movie clips (with only two library items, one for each type in the pair) with instance names of the form "x" and "xgoal" (this is a drag and drop thing).When I'm writing AS for the "x" clip, how can I refer to its "xgoal" generally? I tried something like:goalName = this._name + "goal";And then using the goalName variable in my dot syntax (retrieving the _x coordinate for the goal clip):this.xgoal = _root.goalName._x;But, of course, that did not work. How can I get around this?

View 1 Replies

ActionScript 3.0 :: Syntax For Using Counter Variables?

Nov 25, 2010

I am using a for loop with "i" as a counter. I have some dynamic text fields (name0_txt, name1_txt, name2_txt...etc.) in a mc called namesList_mc and some variables being returned from php called name0, name1, name2 etc.Where and how do I then use "i" to avoid writing the same code hundreds of times.

namesList_mc.name0_txt.text = variables.name0;
namesList_mc.name1_txt.text = variables.name1;
namesList_mc.name2_txt.text = variables.name2;
..etc.

View 3 Replies

ActionScript 3.0 :: PHP Files And Flash Contact Form - 1087: Syntax Error: Extra Characters Found After End Of Program

Jan 25, 2010

I am creating a website in flash CS4 and I made a contact form and when I test the site out, I can type and click the submit button, so everything is fine there but it doesn't go to anything. Now I know I need a code to tell the contact form where to go, but I can't find one that works, or I may be doing something wrong. I also have been reading about PHP but I am not sure what that is. I found a site that said to put this code in the actions panel.

[Code]...

View 3 Replies

ActionScript 3.0 :: Track The Progress Of URLLoader Receiving Variables?

Jan 19, 2009

I know you can track the progress of URLLoader receiving variables, but has anyone found a way to track the progress of it sending variables?

View 0 Replies

Flex :: Syntax For Binding Multiple Variables Within Text

Apr 14, 2010

When binding multiple variables value1 value2 value3 in the same text field, do I do this:

[Code]...

I noticed both work, but which is the right way to do it and will work all the time.

View 1 Replies

ActionScript 2.0 :: Getting A NaN Error On 'Keeping Score' Tutorial

Mar 1, 2007

I recently did the tutorial on here called "Keeping Score" - where you can click on one button and it will add score to a dynamic text field. Press another and it will subtract. I wanted to take this one step further - although have run into some problems.I have set my stage up so that the MCcontainer loads up a random movie clip each time.. from external SWF's. The idea was to have you click on the random swf's when the pop up and add points.. to the dynamic movie clip on the main stage. Although I end up getting a NaN in the score box.However if I click on a button with the same script in the main movie (not externally) it will add to the score.. and then if I click on the external movie it will add points correctly.[code]I have made sure that it relates to the root - and it only works once a button has been pressed with the same code in the main timeline of the movie, but messes up if you click on the external SWF first.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved