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'm wondering how I can create a reference to a function/variable by using strings. Sorry if I'm not explaining the problem well, but let me show you what I mean in an example:You can create a reference to a class using strings by using the getDefinitionByName as follows:var classRef:Class = getDefinitionByName("myClass") as Class;var myClass1:classRef = new classRef();Similarly, how do you refer to functions and variables? The reason why I want to know is because I'm trying to implement a function which takes in the event handler name as the parameter, and what the function essentially does is that it adds an event listener with the associated handler (based on the parameter) to an object, something like this:
public function addListener(handler:String):void { mc.addEventListener(Event.ENTER_FRAME, "on" + handler); }
I wonder what the most common reasons for memory leaks in AS3 are.First thing what I am not sure about is: is it better to have a variable reference inside a function or outside it. Will the variable be null-d automaticly inside a function or when do I have to null it and when not?I have massive problems with my game with memory leaks. I noticed I reference some of the clips of the timeline even inside my debugging clip to display propertys and this was causing collecting huge amount of memory.But even before I go into the game with bigger objects the System.memory is slowly growing and growing.I just have a socket connection and some interval loops and enter_frame events.
I have only two fields Name and Email in a Order form and a PayPal button for payment at PayPal ( into my account).I can do the mail portion but have no idea about PayPal code, however on search here I found one code and after pasting this one to the PayPal button it redirects to my PayPal account. But the question is anybody can post a message and leave the site without paying me. How can I do this thing so that the user will forced to pay before posting the mail form. No idea how to proceed?
I'd like to invoke a function inside a mc from it's parent, but I want to have the reference to the clip be dynamic. When I path the mc directly and invoke the function it works, how would I make that same reference work dynamically.
Here's a sample of what I'm trying to do:
Code: var myArr:Array = new Array(); myArr[0] = "galleryContainer_mc.eventGallery1_mc.imgContainer_mc"; trace(myArr[0]);
I am trying to implement paypal payment in as3. But the return variable conflicts with an as3 keyword. So how to set return variable for returning from paypal to merchant site.
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");
Real newbie to AS3 here (currently I am a C++ programmer looking into writing Adobe Air apps....my wife has some ideas for apps lol). My dumb question: Where do I find a reference libary for *.AS projects? I looked at the below website from adobe, but all the examples are in MXML syntax. Being new to AS3 I'm not quite following the whole MXML vs .AS. [URL]
I am specifically looking to write for the blackberry playbook, but I'm going to try the cross platform deployment for iOS and Android too. I do have FlashDevelop setup, my playbook emulator, and I made the simple "hello world" app. So I'm ready to start laying out some basic controls....once I find a good reference.
I'm trying to use google maps in my wpf c# project, I've installed Adobe Flash player but cannot for the life of me find the shockwave player object reference or when I add a new item in the toolbox find in, both in the COM lists. I had to download and install flash using internet explorer.
I'm trying to find a function that will repeat my Rotational tween function. I found the yoyo() function to be what i want to do but i don't want the tween to change the rotation to CCW while originally moving CW. Basically i want the animation to move CW at a steady rate continuously.
I'm using the following code at the moment, i'm not too sure if this is the most suitable code for this situation, maybe im off track.
From my thoughts, i assumed that i would need to put the stars function in a onEnterFrame to repeat the animation and change yoyo() to continueTo() function. or maybe some sort of if statement in the stars function?
ActionScript Code: import mx.transitions.Tween; import mx.transitions.easing.*; var stars:Tween = new Tween(ring, "_rotation", Regular.easeInOut, 0, 360, 4, true);
I'm creating a mute/unmute button.I have it working correctly, except 1 part.I want to make my SoundChannels remove themselves when the SOUND_COMPLETE Event is fired.I'm storing my Sounds and SoundChannels in an array called "soundsPlayingArray".I want to do 1 of 2 things.Either:
1) Have my "unMuteAll" function check to see whether a song is "playing" before unmuting it.
2) Remove the Sound + SoundChannel from array (and make them null) when the SOUND_COMPLETE Event fires.
How can I figure out what the instance name of the SoundChannel that dispatched the SOUND_COMPLETE event is?[code]
I have a php script that calls a result from the DB and gives it a variable. I then have a dynamic text box in flash that I want to say "goto read.php, find the variable and display the variable's contents in this text box"...
As title states, I'm seeing an error in Safari's error console when trying to view a site I'm building with swfaddress.I've got the Flash side of things worked out (I have a textfield which updates with the parsed SWFAddress.setValue value in Flash), but it doesn't appear to be making its way to the browser (the address bar doesn't change), and I'm assuming it's because of this javascript error.Using the latest versions of both swfobject and swfaddress.
I have a dynamic group of movieclips... these fade in/out on rollOver/rollOut. During the rollOver they reference an index in the legendArray. In the legendArray each index has 5 digits (0 = off, 1=on). Over each "bg" mc are a series of 5 dynamics mc's ("dt" mc (see eg.jpg)), which are to change tint via tween, depending on the legendArray index. I have been able to associate the btn("bg" mc) with the proper legendArray index, but for some reason I'm having difficulty associating the legendArray index to the "dt" mc. As it stands, I keep getting error 1069.
I want to be able to reference the text of a text box within an MCThe MC is called "box1", the text field is called "field1"...I have many MCs (all with field1 in them)... box1, box2, box3 etc etcObviously I can set the text to being something by saying...box1.field1.text = "set_this_text"However, I'm using a variable to come up with the "box1" bit. (Using an array and a loop to figure out which box I want to update based on where the user clicked). So, let's say I have a variable... and I want to say..boxClickedon = box1 //will be defined by userSo I don't know in advance about box1... I can only access it through "boxClickedin" variable, but
boxClickedin.field1.text = "set_this_text" or [boxClickedin].field1.text = "set_this_text"
A flash application in flash builder is currently throwing this error:
ReferenceError: Error #1065: Variable is not defined.
Not telling me which variable it is that's not defined, but note there are two spaces between 'variable' and 'is'. and it gives me some more feedback as to what lines of code are having trouble, but those lines are all within the actual flash/mxml packages and not any of the files in my own project.
I suspect it's related to my php data/services, but I don't see what variable would not be defined. I'm not very familiar with debugging, so I'm not sure how to determine with it where the problem is cropping up.
So I downloaded a trial of CS4, opened the .fla file he sent me and had a prod around.Slowly it started to make sense, except for numerous references to procedures that I just can't find.e.g. a button might call _root.graph.gotoAndStop("start");_root.graph.clearGraphMovies();but can I find any other reference to "graph" other than the calls? No chance!Tried trawling through "Movie Explorer" and "Find/Replace" but nutt'n!I'm now beggining to get the feeling that I'm missing something pretty fundamental with this Flash stuff.