I have the following code that lists 5 buttons with dynamic texts... when pressing each button a popUp_mc window will appear with some content show in dynamic text. Only one of these 5 buttons have some images that will have symbols_mc appear... in this case I just alpha this symbol to 100 only for this button, but for the rest alpha = 0. The button the I want to show the symbol is the third one. I'm a bit confused on how to show this symbol according to the following code below.
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 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 am trying to send a value from one of my xml nodes (<marker>) by declaring it in a function 'showData' as a variable 'XMLMarker'. If I trace this value (XMLmarker) it returns the right data found in the node <marker> (which is 'myMarker_mc'). However, I need to tell the stage that myMarker_mc is a MovieClip...please see the 'PROBLEM' stated in the code below.
What I'm trying to do is setup a function that shoots through a set of buttons within a subset and creates click code for these buttons.
THe three variables are the identifiers for the actual keyframe i wish to jump to, the movieclip in which i want to perform the action and the actual button to go to the right frame.
Presently the problem I'm having is that the variables aren't stored when the onRelease functions are created, so they all are just calling the LAST variables declared.
Here's a sample of the code I currently have
Code: //function to load canvas/acrylic function setSwatches(mySwatchCount:Number, myContainer:String) {
I have an empty SWF that's sole purpose is to call loadMovieNum and start the project. Each loaded movie has a few variables defined within them - unique to those loaded SWFs. Instead of declaring all the variables in each SWF can I declare all of them in one place, in the first frame of the empty loader it all starts from? I'm thinking I can then declare a variable which each loaded movie can increment as needed for me.
What I want to achieve is pretty basic: I have an input text with instance name (contact_date) and I want the information the user enter in this input field to be kept in a variable that I can reuse later on in my movie.
I have 26 buttons in my library named BUTNA, BUTNB, BUTNC, etc. all the way to BUTNZ.
I want the script to pick a random button from the library and place it on the stage.
I am probably doing this wrong, but I am lost.In my script, I need the variable btnp1 in place of BUTNZ in line 8.I don't know how to do this.[code]...
in as2 you used to be able to just declare a variable on a movieclip something line myMC.newvar= "something". this does not seem to work in as3 I get undefined property. Am I missing something on how to dynamically declare variables to sprites and movieclips?
I have several movieclips that I exported to actionscript from the library (c01,c02,c03,...)In the actions I have a conditional that checks a variable and depending on the variable provided I want to create a new instance of that movieclip. For example if cityY==1 then I want to create a new c01.
I tried with conditional and with a switch/case but I get an error declaring the newCity variable more than once.[code]...
What is the difference between declaring a variable like this: variable = 1; and declaring it like this: var variable:Number = 1? Why is it better to use the second way?
Im using a tween engine, and its syntax for use is as follows::
[Code].....
How can I write "_x",100,1,"easeout",0,callback as a string?? I have tried to put "these" around the text. The problem seems to be that "_x" and "easeout" which are effectively strings inside the string! -- but for the tween engine to work - I need to declare that.
I'm trying to find information in how or if it it possible to declare a Variable Type that can accomodate 1 of 2 different Types In this particular case I'd like to set a Variable able to accept either Integrals or Strings I know i Can use a wildcard as below and it works, but it also allows for any other type to be added.
private var _destination:*;
My first Thought was something like this
private var _destination:String^int; private var _destination:String|int;
why can't i get a return value from this function because i need those values to reset a image to it's previous position.
PHP Code:
Cam.addEventListener(MouseEvent.ROLL_OVER,animIn); trace(animIn); // here is where i got a problrm function animIn(evtObj:MouseEvent):Array {[code].......
why i can't do it like that what i mean is why i can't declare this function that way because when i do the fallowing error occur:Ereor #1063
I know that as long as a I declare variables inside a function I can only call them as long as the scope of the function is active. Outside of that function the variables don't exist. Is there any way I can create those variables inside a function and use them outside of it?
I wanted to use a couple of stand-alone function/or static methods by declaring them in the external *.as file and import it.
The problem is, when I import it, I had to instantiate a new class from imported class to use any of these functions which is not necessary in my situation, I just wanted to be able call these functions.
It (AS) does not allow me to declare those functions outside of class declaration, (tried with static keyword in front of those functions just like in C++).
I also tried to declare the class itself with static keyword (also just like C++) but AS also does not allow me to do that.
Remember whole points is declare couple of helper functions in external *.as file and use it over and over.
How to create a dynamic ArrayCollecton instance that use unque naming: ac1, ac2..ac999 whether user click a button. Without having to use hardcode variable name.
I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.
am trying to load xml and make button for its length, and try to make function for each button i have i make buttons and i give them a unique name , but i can't make function for every one?here is the code
///////////////////////////// var xmlLoader:URLLoader = new URLLoader();var my_Arr:Array= new Array();var arr_posX:Array =new Array();//= ["350","350","350","350"]var arr_posY:Array=new Array();//= ["80","120","160","200"]xmlLoader.addEventListener(Event.COMPLETE, showXML);xmlLoader.load(new URLRequest("Models.xml"));function showXML(e:Event):void { XML.ignoreWhitespace = true; var songs:XML = new XML(e.target.data);
How do I create a new arraycollection that can generate a unique variable name? Like: AC+nu as in AC1:ArrayCollection AC+nu as in AC2:ArrayCollection AC+nu as in AC3:ArrayCollection AC+nu as in AC4:ArrayCollection nu++;
im trying to load xml and make button for its length, and try to make function for each button i have i make buttons and i give them a unique name , but i can't make function for every one ?
///////////////////////////// var xmlLoader:URLLoader = new URLLoader();var my_Arr:Array= new Array();var arr_posX:Array =new Array();//= ["350","350","350","350"]var arr_posY:Array=new Array();//= ["80","120","160","200"]xmlLoader.addEventListener(Event.COMPLETE, showXML);xmlLoader.load(new URLRequest("Models.xml"));function showXML(e:Event):void { XML.ignoreWhitespace = true; var songs:XML = new XML(e.target.data);
I encountered a rather irritating problem yesterday. I wrote a class. The class has got 1 variable of the type :Array. its a public variable.On the scene i have 2 movieclips which are connected to my class through its linkage in the library.My problem is that even though the instance-variable (the array) is supposed to be unique for the instance only it gets overwritten for every new instance i create.for example. if i assign the first instance's array 2 values (1, 1)and the do the same with the second but here i change the values to (2,2) then when i check my first instance it has got the same values as the second instance...that is (2,2). [code]
I have a movie that uses a next and previous button. The next button works the same on every page calling a function that uses next(). The movie continues until it is told to stop. The previous button takes you directly to a specific frame in the movie. When running through and testing, if I go forward a frame and then back to the beginning and then add a frame every time, it seems to work fine. But if I go forward 3 times and back 2, or mix it up in any way, the previous button will only work once. Then after that you can go forward as much as you want, but you can only go back once. Each frame that has a previous button has a unique function.
Here is my code below: stop(); import flash.ui.Keyboard; import flash.events.KeyboardEvent; stage.addEventListener(KeyboardEvent.KEY_DOWN, Next); Next_btn.addEventListener(MouseEvent.CLICK, Next); Previous_btn.addEventListener(MouseEvent.CLICK, Disclosure2); [Code] .....
I'm trying to make something that will show up in a dynac text field something like this:"[variable1] text text text [varibale2] text text text"I've linked the dynamic text field to a variable "resu" and set it to:var resu = variable1 + "text text text text" + variable2 + "text text text"The only problem is that when I make the variables random, they don't change