I have a problem accessing a variable which is to store a frame label. Code has been shortened to relevant parts. The following is on the main timeline.
I have a movieclip called "sections" which loads different sections of the website.When the first section is clicked thencontainerCenter is true and the evt.target.name is loaded in to the nextSection variable.Now if a 2nd section is clicked then containerCenter is false. It plays the sections movieclip. Within that movieclip it will eventually play and come to the following script:
PHP Code:
gotoAndPlay(nextSection);
For some reason it won't pick up the variable "nextSection" within the movieclip. I'm getting the error message "Access of undefined property nextSection". It has no problem when it is in the main timeline.I know you can't access a variable declared inside a function, but I have it declared outside the function as you can see above. I've just amended the variable from within the function.
ok so lines 2 and 3 are not real code. Im an old AS2 designer guy trying to learn to code all in the first frame. So how can I see if my var is set and leave it alone if it is?
I have a menu movieclip that has several buttons, each with listeners writtin in the movieclip's actions layer in Frame1. The script goes something like this:
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 work with FlashDevelop, Flex SDK and FP10 debug. I am able to access a local variable (xcorner) which is never declared before, at the condition that it must be declared after... in an "if" for instance. If I remove the declaration of xcorner, within the if, errors occur at compilation, but otherwise it works.
PHP Code: public function pushShape2Pool(name:String, sh:Shape, rotAngle:Number = 0):int{ [...] // xcorner is NEVER declared before !!! coordSprites[0] = new Rectangle(xcorner, 0, globalBmp.width, globalBmp.height); trace("xcorner=" + xcorner); // display 0 xcorner += globalBmp.width; [Code] .....
Am I not targeting it properly?Alternatively, I've tried storing the flashvars URL in a variable in my root SWF and accessing it from the loaded SWF, but I can't seem to grab it. How would I grab a variable that is declared in my root SWF?
If we have declared some variables on a particular frame, say frame 20 in the actionscript coding window, can we use these variables defined on a frame in a class? Is there something like a global variable which must be declared to do this?The class extends to movieClip and it has been encapsulated by a movieClip which is then put on the stage to run it when the corresponding frame plays.
what i can't figure out is how to get a reference of that asm "buffer" variable into actionscript.
(i did think of one way... what i did was to throw the "buffer" from alchemy asm, and then catch it in actionscript, but unfortunately it seems to leak a lot of memory).
is there a better alternative to doing this?
note that performance is critical, and using default alchemy marshaling is way too slow.
On the stage I have a movieclip by the name of rect_mc. Inside it have have a MovieClip square_mc.In the time line that I get when I double click on rect_mc (timeline of rect_mc) I have written the following code
var width1:Number; width1 = sqaure_mc.width;
How can I access width1 from the document class?The thing that I want to is access the variable declared (width1) in the timeline of rect_mc. Just for the sake of a example only I choose the width of MovieClip.My doubt is how can access a variable declared inside the timeline of rect_mc from the document class. It could be any variable.My document class is:
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".
function drop (thumbClip, xCoord, yCoord) { thumbClip._x = xCoord; thumbClip._y = yCoord; trace (thumbClip); trace (xCoord); trace(yCoord); }
receives the variables (specified in a later function) and traces them all right, but refuses to deposit the variable thumbClip in the x and y coordinates being specified?
I replaced thumbClip with a specific movie clip, and the fucntion worked perfectly. Does this mean Flash cannot use variables to set the x and y coords to?
function drop (thumbClip, xCoord, yCoord) { thumbClip._x = xCoord; thumbClip._y = yCoord;
[Code].....
receives the variables (specified in a later function) and traces them all right, but refuses to deposit the variable thumbClip in the x and y coordinates being specified?
I replaced thumbClip with a specific movie clip, and the fucntion worked perfectly. Does this mean Flash cannot use variables to set the x and y coords to?
I was thinking about how to streamline my code the other day and looked through my classes checking for possible memory leaks. I wonder when are variables declared inside of methods clear for garbage collection? or are they not and just hang around? For instance if I have a class like this:
[Code]...
Since the variable was declared without reference into the class how long does it stay in Flash's memory, or does it stay indefinitely because it cannot be nullified?
I am very new to Flash and I am making a little 30 second clip just to fool around with Flash.Now at the end of my film I just want everything to stop (if possible, once a specific frame is hit move to another frame.)I've heard that you could use ActionScript to perform this but I really have no clue
It's too complicate to explain but I'll give you an example
I have an AS3 ResultEvent Object and this object has several propeties which can be accessed by this like:event.result.name or event.result.age and, I have this String variable: eventProperty:String that contains "name" or "age" How do I access to event.result. with the variable?
how I access variables in a frame on the stage with code from a frame within a movieclip?(basically passing variables from a stage frame to a movieclip frame)
i'd like to access a variable in an associated class from my Document class [code]in my document class im trying to see if the class has changed the variable... if it has changed i'd like to obviously do something.if this isn't possible what's the simplest way to check a variable in another class?
I have a button inside a MovieClip (instance name: bt_fechar) and I want to refer to it from the main timeline (that's where I want to keep most of the code). It returns the following output error message: "Error #1065: Variable bt_fechar is not defined"
Heres the code: function retirarCiclo(event:MouseEvent):void {
I have an xml parser that i tried to code into an external class/package.I have no experience with packages so its been difficult but i got most of the way there.The code works, the problem is that i dont know how to access the output variable from the package in my fla file.How can i use the variable allText in my fla?