ActionScript 3.0 :: Identify Names Of Likely Variables / Processes Required For System Generation
Aug 15, 2009
The question is about producing a learning package for users to improve their mathematical skills.One part of it is for times tables. So the user will enter their name and then a question will appear e.g. "What is 6 X 9?" The user then inputs their answer and the system will compare and process the input, storing the incorrect and correct responses and then giving a final score at the end.The question is to; identify the names of the likely variables and processes required for the system generation of a question and the subsequent processing of the user's response.(10 marks)Then it asks to write some pseudo-code to describe 10 consecutive question/response activities and their final results showing their name too. (15 marks)
I'm retrieving variables from a DB via PHP via the URLRequest, and the formatting is set to variables (URLLoaderDataFormat.VARIABLES) and matches the structure "myVarName=myValue&myOtherVarName=myOtherValue&... ".
My question is; is there a way, within Flash, to identify the variables and their values, without having to know their names?, are there methods within the loader class that allow this?, such as the variables count etc?
(I can access the variable "copyrightTxt." via the syntax: loader.data.copyrightTxt because I know its name, but I'd like something like
loader.data.variableSent[45].name = "copyrightTxt" and loader.data.variableSent[45].value = "@ 2009" and loader.data.variableCount = 98
Sometimes flash seems to execute two loops faster that one loop which contains all of the actions that the first two loops contain. Does flash cash processes so that repetitive processes are performed faster if they are performed back-to-back?
I'm currently working on my first flash game and have managed to near enough get everything working. I can play each level individually by manually changing the variable 'level =' (to whichever level I want to play) in the actionscript. Now I need to find out the correct way to reset the movie after each level but still pass the 'currentTime' Timer variable and the 'level' variable over... Would I use variables I have saved in the init() function...
The thing is, I create a grid on the screen, and each of its element is given a name. The question is, how can I access those specific grid's fields by their names? Here's the code:
ActionScript Code: private function drawGrid():void { var startX:uint = 0;
[Code]....
Now, If I wanted to remove, for instance, the box of the 13th row and the 25th column, how can I do that?
If I have a MovieClip called parent_mc and inside it I have another called child1_mc, I can use a variable for the "1" part of child1_mc and change the alpha for example like this:
ActionScript Code: var myVar:Number = 1; parent_mc['child'+myVar+'_mc'].alpha = 0.5;
What is the right syntax to use if child1_mc is not actually a child of anything and just sits on the stage? I have tried the following and it didn't work:
if i have mc duplicated or an object instance name thats stored inside a variable how can i call it? for ex: _root.mov1._x = 53; What if i want instead of mov1 a variable name. lets say randomname is a var and it holds the name of a duplicated object with a name i dont know since its random. now how can i call it just like the example above cause i tried _root.varname._x=33; but it thought varname was an instance name instead of var.
if i have mc duplicated or an object instance name thats stored inside a variable how can i call it?for ex:
_root.mov1._x = 53;
What if i want instead of mov1 a variable name. lets say randomname is a var and it holds the name of a duplicated object with a name i dont know since its random.
now how can i call it just like the example above cause i tried
_root.varname._x=33;
but it thought varname was an instance name instead of var.
I am using AS 2.0 and Flash Player 9.I want to change MC Instance names and target paths, by using variables.As an example, this is the traditional working code.
enter_btn.onPress = function () { clip1_mc.gotoAndPlay("label1"); };
ActionScript Code: for(var i:int = 0; i<numBtn; i++) { var this['menuBtn'+i] = new Sprite(); }
This doesn't work, saying I need an identifier before 'this'.
What I am trying to do is to make a dynamic menu, and the number of buttons depend on how many files there are in a directory, as each button links to each file;I get this value (numBtn in my example) from a php script, and I need to make a menu depending on it, but I can't seem to make it so that when I add a new file into that directory, a new button comes up on the menu and I don't have to change my flash file.
I have created movie clips using loops that names them box1, box2, box3.... via = i + 1;duplicateMovieClip (_root.box, "box" + i, i);but i then want to edit a textbox which is rooted inside each movie but related to the movieclip just produced. so if box1 had just been produced then:box1.textbox.text = " E cell = +j+"V";is done so effectively i am looking to do: box+i.textbox.text = " E cell = "+j+"V";
I am using the tween class to change the alpha value of a MC upon rollOver and rollOut. To refine the effect, I assigned a variable to the MC's alpha value so if the mouse moves off the MC before it has reached 100% alpha, it wont start immediatly fading from 100%, but from the value it had reached before the user stopped the rollOver action. Unfortunately, when I leave my mouse over the MC until it goes to 100%, and then I wait a second or two, the alpha snaps back to 50% (the starting alpha value).I can't figure out why this keeps happening, but I have run into it with other projects and I surmise it is the way I am using the tween class. Below is the code I used to make this happen.To see the problem, here is a link to the compiled file:
var c = mainSubThumbs.SubThumbsHolder[materialType].subthumb_mc[id] what i have obviously doesnt work. materialType and id are my variables that I want to be added onto these mc instances..
What are rules for legal variables names?ie: A-Za-z0-9, hyphen, underscore, etc. must start with an alpha at least n characters, no longer than n characters, etc.
How to post variables to another domain. The other domain is a free cgi-bin service. So I cannot upload a shim movie there. That is, I need to post variables directly to a cgi script on the domain. Is it possible to do so?
Lets say there's a variable called banana1 (I'm just using it for example). Can I replace the 1 with another variable that's equal to 1 so I can modify banana2 just by changing the other variable.
I'm trying to create a series of Loaders in a for loop whose names are created from an Array.If "eval" existed in AS3, the code might look something like this:
var i:int; var tnArray:Array = new Array("tn0","tn1", "tn2"); for (i = 1; i <= 10; i++){