I want to monitor a variable. Whenever the variable value changes I want to call a function. In actionscript 2 I can use "watch" but in as3 what can do ?
i have a variable take away another variable which makes answer1 variable i then want answer1 to be to the power of another variable how can i do this in flash
i want to call a function from within a function using a variable representing its name...
[Code]...
i've been tryin to figure this out for quite some time now since FLASH MX , i just kept abandoning a solution.. and now i'm once again in need of this , still cant solve it so im postin...
basically i want to populate an array with some data, photoArray[count]= varLoader.data.nombre; the problem is that "nombre" is suposed to be a variable, this is inside a loop and i have "nombre = "pic" + count;" before it, but it wont work, how am i suposed to call it?
and so forth.The issues is I need to call a variable from within the array but depending on an option the user has chosen it needs to call the right one.At the moment I am trying
end = "_global.var"+userOption+"Array["+array#+"]"; userOption being the needed array array# being the needed entry within the array.
However when I try and use this I of course just get it like a string, not as a variable...
I'm just getting the hang of AS2 OOP, after avoiding it for all this time, and I have set up my first couple of classes.
One class generates an array, and the other class takes this array, and uses it it to place MC's on the screen, and gives each mc an onEnterFrame function. I have a stack of these onEnterFrame functions, named 'avoidIt1()-avoidIt11()'[code]...
Can I call a variable declared in a SWF, and call the same variable into another SWF, when i am loading it using XML.I am declaring a variable in the "Child movie", and am loading this "Child movie" into a "Parent movie" using XML. Can I retrieve the variable declared in the "Child movie" in the "Parent movie".
I'm trying to pass a variable through a function, but I'm getting it's value 0. Here's my code:
thumbLoader.addEventListener(MouseEvent.CLICK, goToCategory); function goToCategory(e:MouseEvent) { trace(c);[code]....
this trace gives me value of 0. Normally I would do goToCategory(c) and inside that category I would get it's value, but in this case I'm calling this function with an event, how can that be done?
var c is declared globally, so I'm using it above this code in different place... is there smth like global $c like in PHP.. or there's some other way to do it?!
I'm brand new to actionscript and I've decided to try and make an overhead tile scrolling game. It's been going good so far, but here is my problem: I have the level data stored in an array, where the number represents the corresponding tile. I have movie clips in my library called "tile_1", "tile_2", "tile_3" etc. Anyway, what I was thinking of doing was this: var newTileContents:("tile_"+lvlArray[i]) = new ("tile_"+lvlArray[i])(); newTile.addChild(newTileContents); Where, if the value in the lvlArray at [i] is 2, then it will create an instance of tile_2 etc. But I am not sure how to to type the "tile_"+lvlArray[i] bit properly.
I have a several functions that I can compact into 1 function via a for loop if only I can find a way to call the variable by name.
For example:This is what I want to accomplish: (However I do not have the slightest clue as to how to go about doing the below...)
ActionScript Code: var test1:String = "testing 1"; var test2:String = "testing 2";
[code].....
I am able to do something similar to the above when using objects using methods such as: (I know not efficient, but its just an example to show what I am trying to accomplish.)
ActionScript Code: var test1:String = "testing 1"; var test2:String = "testing 2";
I want to use a variable in my movie clip code. Right now I generate a random U.S. state name and assign it to "correctAnswer". Then I want to assign that to myMovieClip.correctAnswer.gotoAndStop("down"); The problem is that the variable is not recognized and is seen as correctAnswer instead of the U.S. state that was assigned to it. My code is below.
ActionScript Code: // Correct answer is randomly generated and can be any U.S. state name correctAnswer = "utah"; // Using the variable correctAnswer this should come out as myMovieClip.utah.gotoAndStop("down"); myMovieClip.correctAnswer.gotoAndStop("down");
Is it possible to call an instance of a movieclip by a variable name?
Say I have several movie-clips on the main timeline and a variable named "disabled". I want to click a button and have be able to tell "disabled" to goto frame 2, where disabled will contain the name of the movie-clip. can I do this?
I need a way to call a function from a function. It's not that hard, I know, but the name of the nested function is a variable passed into the first function. Like in setTimer() and other functions in flash, where you have the name of a variable to call. I'm going to have a lot, so doing some cheap if(funcname == blabla){blabla();} won't work.
Can I call a variable declared in a SWF, and call the same variable into another SWF, when i am loading it using XML.I am declaring a variable in the "Child movie", and am loading this "Child movie" into a "Parent movie" using XML. Can I retrieve the variable declared in the "Child movie" in the "Parent movie".
I'm trying to reference an instance through the use of a variable in my call to a prototype. The variable is myVar and contains the instance name to which I want to apply the resizeTo prototype. My syntax is incorrect.
Code: on(release){ //disregard this line this.swapDepths(this._parent.getNextHighestDepth()); //this is calling a prototype named resizeTo this.resizeTo(150, -100, -100); //Setting instance name of another movie myVar = "green"; //Trying to drop that instance name into my next prototype call this._parent.myVar.resizeTo(100, _parent.old_X, _parent.old_Y); }
I have a variable in the _root called section.Now I want to call hemmaAnimation(); within a the global function (see below).So I set the section variable to hemma & tried these: