ActionScript 2.0 :: Operator '=' Must Be Followed By An Operand - Error?
Feb 26, 2007
I am using Flash 8, and I'm new to actionscript and Kirupa forums. Problem: Everytime I try and test my mp3 player, I get these errors on output: **Error** C:Documents and SettingsAdminMy DocumentsProjectsgotoandlearnmp3Player1mp3Play er.as: Line 49: Operator '=' must be followed by an operand next.onRollOut = next.onReleaseOutside = ()
I'm making a game so far with 2 characters (in 2 classes); Adeiza and Dooray. Combat and movement are all fine, but now I need to make a ranged special. I've created a MovieClip and a class file for AdzFire, which is basically a fireball created by Adeiza in a certain frame. This fireball is created and moves in the direction I ask it to, which is fine. My problem lies with it hitting the opposing character (currently Dooray). Here are the codes I think are affected;1. The code in AdzFire.as, called with an enterframe event.
Code: public function fire(evt:Event) { if (shotDirect==-1) {
I'm somewhat new and trying to learn actionscript. I'm getting and error that has me puzzled. **Error** Scene=Scene 1, layer=actions, frame=1:Line 2: Left side of assignment operator must be variable or property. bg-mb_mc._alpha=50;
I have a timeline with 3 jpgs on it that have been converted into symbols. bg-gooto_mc is an instance of bg-gooto bg-mb_mc is an instance of bg-mb bg-lace_mc is an instance of bg-lace
When I try ... bg-mb_mc._alpha=50; I get the error. using setproperty ("_level0.bg-mb_mc", _alpha, 45); works ok.
I have a a structure like this: e.item.fatturato_ac_s1 e.item.fatturato_ac_s2 e.item.fatturato_ac_s3 e.item.fatturato_ac_s4 [...] and so on...
In order to compute dynamically the string I wrote: e.item.(myStr.toString()) where myStr (type string) = "fatturato_ac_s" + Index (so I can have fatturato_ac_s1, fatturato_ac_s2, ...) I can correctly retrieve the value of e.item.(myStr.toString()) (a numeric value), but if I try to put it in a variable I get the error in the title: myVariable = e.item.(myStr.toString()) myVariable is a Number.
I also tried: myVariable = Number(e.item.(myStr.toString())) But doesn't work... the same if I try String to String....
I am trying to figure out how to apply the is operand or the instanceof in a case statement to determine which datatype a interface object belongs too. keep getting errors
Trying to set up my own site. Have seen this one and would quite like to copy the layout and functions of the buttons etc.So I have started out by creating one button which enters the stage and the remains in the UpState until roll over or clicked.I have tried to add this function:
import flash.events.MouseEvent; large_btn.addEventListener.(MouseEvent.CLICK, openlarge); function openlarge(event:MouseEvent):void{
I have a swf that I want to edit.I decompiled it and edited the one value I wanted to change (It was how many items were displayed). Now, I get a few AS I cannot fix, I know enough AS to get by, but this is above my head.I have two errors, they both say: Left side of assignment operator must be variable or property.
ActionScript Code: function goNext()[code]..........
I marked the lines that have syntax errors.they are hosted on my test server and I can PM you links. (I am building a website and don't want the link out there.
the fighting game class creates an instance of fighter, then adds a child of "dude" to fighter. I want to animate dude, so I tried doing this:
Code: for (var i:uint = 0; i < fighter.numChildren; i++) var mychild = fighter.getChildAt(i); fighter.addChild(dude); thats in the constructor.
TypeError: Error #1123: Filter operator not supported on type Fighter
Code: fighter.(MyChild as MovieClip.gotoAndPlay("walkingright"); that is within the fightinggame.as. Now, the game runs, but when I press right ( the keys that cause that movieclip to animate), it throws a -
TypeError: Error #1123: Filter operator not supported on type Fighter. at FightingGame/Update()[C:UsersOlsenDocumentsFightingGameFightingGame .as:399] at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()
Also the movieclip does not show up, and does not animate. What is this, I can find little information about it, and how do i fix it? the area where it throws the error is the gotoandplay line.
Looking for an operator in AS 3.0 that will work as a like or contains operator. Trying to create a search field that looks for a value (keyword) when a person types in a question in the text box.When it finds this key word it will then play a video. So if they type in "What are your training options?" It will look for train and play an flv file for our training courses.
I am going though a tutorial were I need to us an or operator its showing it as two vertical lines? How do I input that? I can't find anything like it on my keyboard and in the book it just mentions that the two lines represent the or operator and not how to even put in in the code?
basically in english, i'm trying to say that:if color is equal to purple or orange or brown then do this, else if color is equal to red or pink or green, then do this.the error the above code is having is that, no matter what _root.currentSection is, it always goes to the first if statment, so leads me to believe i'm using the || operator wrong.
I'm trying to get flash to randomize an arithmetic operator from a set of operators, i.e.operators = + - * / etc and I want flash to randomly pick one from the list!How do I do this? I looked at the random tut on kirupa but I don't know how to make it work with anything other than numbers!
I'm trying to check to see if all the other movieclips on the stage are on frame 1.If they are, then on release of this button go to and stop on frame 2 of a specified movieclip. If any of the conditions in the if statement are false (any of the movieclips are not on frame 1) then I want to send all of the movieclips on the stage to frame 1 and then send the specified movieclip to frame 2.The code that I am using is below.I have placed this code on the instance of the button and all the movieclips and button are on the main stage.[code]
Im doing a tutorial in a book that moves a car from one end of the screen to the next by buttons.When you release a button it moves the car 10 pixels more down the X axis.The code confuses me and I want to understand it Please Help!
Here is the code:
// stop the cars traveling stop(); // callback for onPress event on 'back' button back_btn.onPress = function() { // move my car -10 pix
[code]...
Why does the - sign and + sign appear before the = instead of after?Is this a logic operator(-= or +?Why doesn't putting the - sign or + sign after the = work?
Is there any simple way to use a plus or minus operator in AS2? To give this context, lets say I want to randomize a speed, higher or lower, on event (passing a certain x or y value) (like a ball bouncing around in a bounding box,but create some random rebound angles).I'm essentially asking if there's anoperator for the symbol '�' in AS2...
From a position on an Array of sector Sprites on an 11 x 11 grid, I am trying to "sense" what Child occurs at nearby sector Sprites. I felt certain I could use something like this
if (sectorArray [currentSector - 11].getChildAt is MovieClip) { //do stuff }
but it doesn't seem to work. I changed my visibility settings to true, thinking the false visibility might be a problem, but no result.
basically in english, i'm trying to say that: if color is equal to purple or orange or brown then do this, else if color is equal to red or pink or green, then do this. the error the above code is having is that, no matter what _root.currentSection is, it always goes to the first if statment, so leads me to believe i'm using the || operator wrong.
How can I prevent concatenating when using the addition operator? totalCost_txt.text = (firstCost_txt.text + secondCost_txt.text)I can replace the "+" with any other operator and it works. (huh?)
I want to fill color based on condition so I used conditional operator for the checkbox. But it's shows the error Implicit coercion of a value of type String to an unrelated type Array. What did I do wrong ? How can I dynamically change the color of a checkbox ?[code]...
Isn't there some way to combine two images together using the xOr operator? I realize I can step through pixel by pixel, but with all the graphics options available to Flash, I am reluctant to take such a ham-fisted approach. How can this be accomplished efficiently?
var pixel1:uint; var pixel2:uint; var xorMergedPixel:uint;
I've faced such situation. I've used to program in C#, and such code:
[Code]...
was asking both, condition1 and condition2 to be true (the case when they both are giving false and the end-result is true, could be achieved in other way). In Flex, same code would perform "some actions" if the both conditions are false. I just was wondering if is there any chance to make it break after finding first false in a queue, or I have no choice and should write nested if's?
i have a movieclip "button51". And within button51 I have opponent1.i m writing button51.(getChildByName("opponent" + indexHorizontal)as MovieClip). gotoAndStop(2);but it throws a runtime error -TypeError: Error #1123: Filter operator not supported on type stapu_fla.opponentNumbers_2.at Main / selectMode().Basically I want to change frame of a movieclip which is inside another movieclip using getChildByName for the inside mivieclip name.. Pls help
how can I shortcut the syntax on multiple operands using the "or" operator? Does each statement have to be explicitly written out? [code]Also, if I have to write a looooooooooonnnnnng line of AS like in the code window above, can I just go to the next line without Flash crying about it or does it all have to stay on the same line (not wrapped...)?