ActionScript 2.0 :: Attaching Movies To Array & Target Mc?
Oct 30, 2010
I have my code in the root first frame. I would like to know is it posible to attach movie from the library to array, but tu have that array created in some movie clip so the path to the newly created instance would be _root.some_movie_clip.array[i].
the code goes like this:
Code:
for (i=0; i<11; i++){
displayed_icons[i] = attachMovie("my_library_mc"+i, "new_mc_"+i, this.getNextHighestDepth());
I have a website, when you click a menu item it fades the current page out, and the selected one in. No problems with that, it all works well.
The only problem is, within those attached movies, all the actionscript doesnt work. I have, for example, a research page, which have 4 buttons, each of which attach a movieclip to and empty movieclip... Just a simple attachMovie function, but it doesnt work. If copy the research movieclip into a seperate flash file, everything works and the movies are attached fine, but in the website .fla, after the research page is loaded itself, none of the movies attach properly.
Are there any known issues with attaching movies within an attached movie?
Does anyone know of a way to use the attachMovie() function to attach movie clips into the root timeline from the library of a movie that has been loaded into the root movie?I want to place a series of movie clips into a smaller movie that is loaded into the root timeline when needed and be able to script the linked movie clips in the library for use in my root timeline
I am in the process of creating a VS Card game in Flash. It is basically a game where you can choose either one card or another, each randomly pulled from one of the eight different sets. The first card (or swf) can be pulled from any of the 8 sets (out of a total of 12 cards in each set))..and will load into a targetMC, and the second must be pulled randomly from any of the 8 sets except from the folder where the first card was chosen and load onto the second targetMC.
THE PROBLEM: the button is not attached.i know that this don't work by default, and i could use loadMovieNum but i realy do need this TARGETS-mc.I would say: load into a _level, not into a target. That's the usual "getaround" with attached symbols that preload before anything else. If they really need to be in targets, once they are loaded into _level1 for instance, and cached, load them again into your holders.
ive got these clips on stage and add event listeners in an array :
[Code].....
but i want to have nothing on stage and attach the same clip from the library a certain amount of times and have them put themselves into the array, is this possible?
Bit of a problem with trying to attach a sound to a series of movie clips stored in an array. I miss attachSound from AS2, it was so cool. Background first. I'm making a simple pairs game where the aim is to match the 2 cards that have the same sound attachted to it. I'm storing my card movie clips in an array to build the grid (obviously lol) and I have 18 audio files in my library with the class names s0 - s17. Code breakdown below. Apologies if this doesn't appear in code format,[code]I have two issues.
1 - how would I add a sound to each movie clip in the for loop in preparation for adding another function which is called when the user clicks the movie clip and the sound plays?
2 - the grid is 36 tiles long , so to make the whole pairs game work I need to attach each sound twice, and then again I will create another function which will then shuffle them randomly.
I'm trying to create a spinner for different ads for an advertising company website. Each ad has a name, such as "out" "pie" and "bigger". All of them are turned off except "pie" to start off with:
Code: //initialize movie var itemArray:Array = new Array();itemArray[0] = out; itemArray[1] = pie; itemArray[2] = bigger;
[code]....
The thing is, I can' figure out the button script to cycle through this array. I want to click a forward and back button, lets use forward for now, and do something like (don't mind the syntax):
Code: on (release) { i+1, remember the spot, and make everything else invisible. When you click again, you increment to the next ad/instance name and so on. }
I have 5 movies in my library, called question0, question1, question2, question3, question4. I linked them with export for actionscript. I have an Array, called questions. Then I have a button that calls the getQuestion function. But I get the following error:
I've got about 50 buttons onstage with names like btn1a_mc, btn2B_mc, etc. Each one loads an external swf (called "Monosem1Aslideshow.swf", where the "1A" corresponds to the button name.) into a movieclip holder called slideHolder_mc. I'm trying to use an array instead of writing code for each button. I'm using the following:
I would like to randomly move three movie clips, placed in an array, within a set box. The script below worked with used with one movie clip, but not with all in an array.
var clipSpeed:Number= 1; var speedX:Number = 0 var speedY:Number = 0
I've got about 50 buttons onstage with names like btn1a_mc, btn2B_mc, etc. Each one loads an external swf (called "Monosem1Aslideshow.swf", where the "1A" corresponds to the button name.) into a movieclip holder called slideHolder_mc. I'm trying to use an array instead of writing code for each button. I'm using the following:
I'm new on AS3, I'll try to explain what my project consists: Well, There is a main.fla and It loads external movies triggered by button items. The content animation sequence introduction starts with tweenLite and fills the stage with elements from Library (movieClips, buttons) and some sprites. I've built the intro animation through actionscript. Perhaps I'll need to explain how I did it the TweenLite structure, but the code lines are too long
The transitions / navigation: Each button before load the external movie has a respective animation that removes the other buttons from the stage. It triggers an "outro" animation and then loads the External Swf.
First: Each external Swfs contains a removeChild action in a MovieClip that CLOSES and removes the movie.. Like a "pop up" with a close action. After closed It should replay the intro animation and replace the buttons in the stage but it's not happening because I don't know how to communicate between different timelines / external movies.
I have an array with 3 objects and added a click event to them, when clicked the 3 objects move 200 pixels down, but i would like to become that the objects that werent pushed get an alpha of 0.5
i have an array called movieList that's made up of nine movieclips ("one_mc" for example). when something happens in my timeline, i want to send each of the movieclips to their fifth frame. i tried the following code and it didn't work:
I have one main array of 10 elements, inside each element there's another array of 3 elements. So, I must click on any of those 3 elements and compare its index with another array.Problem comes when I try to get its index since it gets it wrong.. I've try with this:trace(_choicesArray[_counter].indexOf(e.target));I even created a temporarly array that gets that specific array elements, but I always get -1. After many tries, I realized it's not a problem of the array or the index, but the event target somehow doesn't know what it index is.. or something like that.. still not so sure.his is the code:
ActionScript Code: private function addChoices():void { for (var i:uint=0; i<_choicesArray.length; i++) {
Is there any way I can target the next and previous items in an array? For example, if I wanted to make a gallery where there's one main image and next/prev buttons to switch between the images in the array.
How can I target a movieclip that is inside each item in the array using getChildByName. Heres my code so far: var aMC:Array=new Array(letter, envelope, parcel); if(i< aMC.length){ var myTargetName:String = aMC[i].target.name; var myTarget:DisplayObject = getChildByName(myTargetName); trace("Stamps Target: "+myTargetName); if (evt.target.dropTarget != null && evt.target.dropTarget == myTarget) { // do what ever here i++; }}