Now I wan't to take the 'QuestionSet' array out of this function and expose it on the first frame (or on the _root. domain) so I can call it from OUTSIDE the function. So for example:
Code:
function handleResult(re : ResultEvent)
{
QuestionSet = re.result;
[Code]....
I can't just return the array because first i need to PUT IN the array in order to return it from the function which defeats the purpose!
how you would target a function's local variable through a concatenated variable string.For example:
var txt = "Hello World"; function testing(msg) { var test1 = msg;[code].........
I'd expect the trace to be "Hello World" but rather is given "undefined". So if variables created outside functions are created on the main timeline, where are local function variables created and how would you access them?
I'm trying to combine PHP/SQL and Flash. I've got a problem now. I want to load a variable that contains an url to an image. so the variable is like this: [URL] Now I want flash to load the image, not the text. The variable is called 'img1' but the loadmovie function doesn't work when I put it in.
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 set of Cue Points in an FLV I'm playing. It's an interactive quiz, so the idea is that flash will change a variable, theAnswer, to a different letter depending on which question it is. The answer to question 1 is B, question 2 is D, etc. Either the cue point event listener isn't working, or else it is working and Flash isn't declaring the variables. 1120: Access of undefined property theAnswer. I literally can't find a single problem with my code. I have an almost identical Event Listener further down which works.
I need to pass a variable to a function inside a function. However this parameter (i) seems not to be passed (to function ...onRollOver). This is required to attach a textfield to a movieclip (reading the adress and showing it as a tooltip).
ActionScript Code: for (i=0; i<array_BE_ElecCities.length; i++) { var attachElecCity = mc_map.mc_places.attachMovie("Plant",
I want to create a vector, then call a function that populates that vector with arrays. Fine. The only catch is the function itself will declare new array variables to put into the vector, but are these new array variables private to the function only?e.g. something like this
ActionScript Code: public var vec:Vector.<Array> = new Vector.<Array>(); private function populateVec():void {
[code]....
Is this "kosher"? a was declared in the private function but added to something outside the function..?
I have created an actionscript function which stops an animation on a specific frame which works fine. I have then loaded in a php file with a variable which will contain the number for the frame i want the animation to stop on. This has loaded in fine and i have loaded it in a function. what i cant seem to do is to get the variable into the function which tells the animation to stop playing.
here is my code:
//load variablesvarReceiver = new LoadVars(); // create an object to store the variablesvarReceiver.load("http://playground.nsdesign6.net/percentage/external.php");//load variables
Can't seem to get the value of myXML outside the function, despite being declared outside. The data loads and traces correctly inside the function.
var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("flightPlannerBoard.xml")); var myXML:XML; // Check XML data fully loaded myLoader.addEventListener(Event.COMPLETE, processXML); function processXML(e:Event):void { myXML = new XML(e.target.data); //trace(myXML); } trace(myXML);
I have successfully passed a value to my function using another class.how do i know it works? Because when I put the trace statement in that function it gives me the value of the passed value.Now I want that value from that function to be get or to be used IN OTHER FUNCTION WHEREIN THAT FUNCTION IS ON ENTERFRAME. But I cant for some reason._a is a global variable
i have a function inside another function. Here is a structure of my code:
Code: function loadXML(loaded) { if (loaded) { timer = new Array();
[code]....
As you can see, I declare timer array in the main function but I also want to use it in another function inside the main function. I have tried to call _root.timer and this.timer but it returned me undefined.How can I call it to use? Or how can I declare it properly?
I am having trouble getting a variable from within a function displayed. Basically I have a combo box, and want to pass the value of that to a global variable, but is does not seem to pass it.I have the following code:
PHP Code: form = new Object(); form.change = function(eventObj) {
I have 3 movieclips in the Libarary, called (both by name and class) section0, section1 and section2.This works for instance to attach a movie clip to the stage:
Code: var myMovie:MovieClip = new section1; addChild(myMovie);
I've tried to make a function that will allow me to change the value of any variable in my flash movie, but it doesn't seem to be working. Here's my current code:
PHP Code:
function changeVar(variable,varValue) { variable = varValue; } changeVar(score,"50");
I have a variable which needs to be updated upon user input. It works inside the function, the trace function returns the correct type, but for a reason it wont pass it on the variable on the main timeline.[code]
i have a function that read a variable from a text file, yet i can only read the variable from within the function. How could i create a global variable or such that i can then read from outside of the function.
Code: var Make:LoadVars = new LoadVars(); Make.onLoad = function() { VARIABLE = Make.textVariable;
I have the as file attached to stage, and I would like to use the variable and function from that as file inside a movieclip. Unfortunately when I called up that function or trying to use variables it would always say the function or the variable is undefined. Is there a way to access the variable and function from as file?