I have 2 arrays i.e.:[code]Is it possible to set the color of the moviceclips (mcclipsArray) to the relevant colors from the second array (mcclipsColorArray), so movieclip a becomes blue, b becomes red etc.
And the result is: tooltipArray = ["tooltipProy", "tooltipAsig", "tooltipRota", "tooltipActi"]; which doesn't work because the array no longer contains references to MovieClips but strings
2. NOT surrounding the name of my movieclip with "" on (release) { _root.tooltipArray.push(tooltipProy); }
Which gives an undefined value
How can I "transform" the strings in the array to references to MovieClips?
I will do my best in explaining what is happening. I have a feeling it has something to do with how I declare things, but I am kinda new with AS3 so please have patience.
On my stage I have an movie clip (mContainer). In the library I have another movieclip (mElement), that has been exported for actionScript as mElement.
I received help on this site on this info-graphic im doing and the solution was to use an "array" which im not familiar with at all. the person that helped me added the following code that worked:
var city_arr:Array = new Array("louisville");//filll that array with all nedded cities//make all the boxes invisible at startfor (i=0;i<city_arr.length;i++){ var [code]...
since i dont know how to use arrays im stuck. i need to add at least 30 more cities to my info-graphic but don't know how to use the naming conventions of an array.Only one of the houses works (when you click on it a pop-up appears, is draggable and has an x to close the pop-up)
I want to change the value of a variable listed in an array using the array. for example:
Code: var theVariable:Number = 15; var theArray:Array = [theVariable]; now if I try this
Code:
theArray[0] = 20;
I just get an array with 1 value of 20 in it and it no longer references theVariable what i want to do is change the value of theVariable with out removing it from the array but referencing it from the array in a loop or something.
In my movie i can change the color of some movieclips. But when im opening the movie after some it reverts to the older color. What i want to do is save my movieclip's color and load it whenever im opening the movie.
i want when user rollover on any movieclip it comes on top after rollout it goes it's original position but, this code is showing error.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
private function pan3D():void{ excelmc=thumbswork.excel officemc=thumbswork.office googlemc=thumbswork.google
I have a moviclip and I want to change its background color on mouse over event. I think that I have to use ColorTransform, but I've not understood how to use it, I've not understood how the multipiers and offsets work. At beginning the background is #000010, I want to change it to #000030. The moviecip's instance name is borse_mc, how to apply the change to it?
I am using the following script in a MC to produce an empty movieclip and fill it with evenly spaced movieclips on demand.[code]The last piece of code repeated below should remove one of the attached movieclips when it is created then remove its iteration from the array and loop through all movieclips after it in the array and minus 30 from their y coordinate:[code]When I trace Wine[mc] it produces a list of names of movieclips after it in the array as it should, and the movieclip is removed as it should but the coordinates of the other movieclips remain unchanged.
I have a playlist menu made up of movie clips acting as buttons, one clip for each track from a CD. The user clicks on a button, a corresponding sound clip plays and the movie clip button the user selected switches from frame 1 to frame 2 to change color while the sound is playing to show which track is currently playing.
Using an array to store the music tracks (named "Track 01" to "Track 08") and a "switch" command, my user is currently able to select and listen to a given track. My current problems lie with presentation.
I am having two problems with this project:
1. If the user allows the track to play through to the end, I need a single function to be fired on the SOUND_COMPLETE event (and I have applied the appropriate listener to my sound channel) which will reset the button to frame 1, as a visual indicator that the track has stopped. I have been unable to come up with such a function as yet.
Currently, the selected button just stays yellow (frame 2) instead of turning white (frame 1), and the user has to click twice (instead of once) to make the track play again.
2. My playlist includes a "play all" function to play all the tracks through in sequence as laid out in an array. While the track sequence plays fine, I would like to have the corresponding button for each track jump to frame 2 while that track is playing, then back to frame 1 when the track stops.
Is it possible to load up an array with movieclip instances from the library and use that as a reference to go to a certain index, snag that mc, and display it on the stage?
I'm having problems making a loop of different movieClips. I've been able to find info about duplicating the same movieClip but I can't seem to get it to apply to this. This is what I am working with: I have 13 different movieClips of an animated character. They are titled montyDog_mc, montyBear_mc, montyCat_mc, etc. I also have a next and a previous button. What I need to happen is for the movieClip animations to cycle through, one at a time, each time the user clicks the next or previous button. I think I should be creating an array of some sort but I am very confused about how I list the movie clips in an array and apply it to the button.
This is what I have: montyArray = new Array(); montyBear[0] = "montyBear_mc"; montyBee[1] = "montyBee_mc"; montyCow[2] = "montyCow_mc"; montyDog[3] = "montyDog_mc"; [Code] ..... Am I targeting the movieClips properly?
Just started to make the switch from AS2 to AS3 and am having a few problems, most of which I've managed to fix but this one has got me stumped.
I'm trying to create some buttons dynamically that are spaced out evenly.The clip is in the library and exports as NavButton. I've created an array with all the button clips inside it. This is called navButtonArray and when traced shows the NavButton clips. My problem is when I try and add them to stage. I can't tell if it's only adding 1, or just placing them in the same place, or if it's continually replacing the previous navButton.[code]...
I have a MovieClip Button, btn, made up of 2 MovieClips, sqrT and sqrB on top. sqrB is stopped at an empty frame. On Down, sqrB stops at a MovieClip frame, on Up, it goes back to the empty frame. On Click, it traces "Clicked!", but Click never fires. Why is this, and is there a way to make it work without using alpha?
I am trying to change the z-index when you a user clicks on one of my movieclips. I get this error and am not sure how to resolve it. If anyone has a few minutes to view the code I posted below that would be awesome.
Here is the error I am getting: TypeError: Error #2007: Parameter child must be non-null.
If I have a randomClips function that shows a range of swf files every 15seconds and wanted to create a button that could stop the auto change of the clips, what would be the script for that button if the script for the randomClips looks like this:
I've made a loop that is creating 9x movieClips that is loading external images and I have also added eventListeners to those movieClips to make it possible to change the movieclips image. My problem is that i can't access the target of the "first eventListener". Here is the code to browse for the new image, i want to access the movieclip of this function in a later eventListener, like this: event.CurrentTarget
Code: file.addEventListener(Event.SELECT, onFileSelected); function mUp(event:MouseEvent):void{ file.browse(new Array(new FileFilter( "Bild (JPG och JPEG)", "*.jpg;*.jpeg;"))); }
The second eventListener. This function is called when the new image is selected Code: function onFileSelected(event:Event):void{ file.addEventListener(Event.COMPLETE, loadCompleteHandler); file.load(); }
The third and last function, this function is called when the image is loaded and is ready to be used. Code: function loadCompleteHandler(event:Event):void{ file.removeEventListener(Event.COMPLETE, loadCompleteHandler); var loader:Loader = new Loader(); loader.loadBytes(event.target.data); // Here is the problem! event.target.addChild(loader) }
If if put this code, it will target the second function's event. Code: event.target.addChild(loader); I am searching for a code looking like this to replace the old image with the new one Code: event.target.target.addChild(loader);
I'm creating multiple movieclips, containing a TextField and an image as a background. In order to keep track of them I'm storing them in an array. The problem is that I can't add the movieclip to the screen >.< What I'm doing is
PHP Code: addChild(movieclips[0]);
but it's not displaying. I know it's not the movieclip as I can addChild that and it shows, but trying to call it out of the array is not working and it's REALLY frustrating the nark out of me .How do I add the selected movieclip out of my array?
Ive created a array to hold an instance of the Zombie movie clip, the movie is given an instance of "Zombie" + 1, 2, 3..... But now i can't work out how to add the movie clips from the Array to the stage. [code]...
Is it possible to instantiate MovieClips that exist in the library (that have been exported for actionscript) with a for loop using an array that holds their link name?
var fruit:Array = new Array("apple", "banana", "blackberries"); for (var i:int = 0; i < fruit.length; i++) { var aFruit[i] : fruit[i] = new fruit[i]; }
I am trying to get a collision between an array of movieclips but it isnt doing well =S.Here is where I am now:
[code]....
This code works, but it is only colliding with one object. I have made an Array called: _root.enemyArray.I have tried to make an for statment inside the current one without sucess.
Anybody any ideas on how to remove children from stage using AS3 if I store the reference to the objects in an array and they exist in different locations i.e they are not all children of the same parent?
I was trying to make a similar thing with the game SameGame (ie. the block above the removed blocks fall downward). Before trying this with an Array that contains MovieClips, this code worked (tried it with int values). With MovieClips on the array, it seems not working the same way.With int values, example:
popUp(0, 4): Before: 1,2,3,4,5,6,7,8,9,10; After; 1,2,3,4 // Assume the numbers are movieclips XD
Basically, it strips everything else, rather than just the said block >_< Here's the whole method. Basically, two extra arrays juggle the values above the soon-to-be removed value, remove the value, then re-stack it to the original array.
function popUp(col:uint, row:uint) { var tempStack:Array = new Array(); var extraStack:Array = new Array();