ActionScript 2.0 :: How To Store Values In Duplicated Clips
Oct 2, 2003I duplicate a MC 6 times,
for(i=1;i<=6;i++){
this.MovieClip.square.duplicateMovieClip( "square"+i,i*1000);
//
[code]......
I duplicate a MC 6 times,
for(i=1;i<=6;i++){
this.MovieClip.square.duplicateMovieClip( "square"+i,i*1000);
//
[code]......
I duplicate a MC 6 times,
for(i=1;i<=6;i++){
this.MovieClip.square.duplicateMovieClip( "square"+i,i*1000);
//
[Code]....
I have a clip, duplicated to realize the titles of a menu. How can i use these duplicated clips to load the submenus? (The submenu is another clip, duplicated using the numbers contained in the same array)
My script (or, i'd better say, Stringy's!) is:
/*
array: its lenght gives me the number of titles, each number inside the quantity of submenu for each title
*/
[Code]....
is there a posibility to target al of the clips (at once) i duplicated below?[code]
View 5 RepliesThere r two function which I compare for effectiveness, createFlake uses a symbol in the library to duplicate and createFlake2 uses programming drawing to create the same looking shape.When I run this file with createFlake calls it consumes about 70% of my CPU and when I use createFlake2 my CPU is 100% busy.I would prefer to use pure programming here so my question is: Is it a "normal" result because of Flash implementation or am I doing something in a not optimal fashion?
Code:
// copying from Library FAST
function createFlake(i) {
[code]....
Im working on a rock climbing game, and used duplicateMovieClip() to make all the snow. When the character gets to the top of the mountain, the movie goes to the next scene, but the duplicated snow is still there. Look through the .fla at [URL]
View 5 Repliesi am currently making a game , and for some reason the hittest on my duplicated movie clips isnt working i know how to do them , and know it should be working , because it works on one of the movie clips but none of the others so im guessing it something to do with depth?
View 2 RepliesHow do I change the y position for the duplicated movie clips I have created?This is the code I have used to create the movie clips. [code]
View 14 RepliesI am trying to create a hitTest between two duplicated objects. The code below is on a bullet. Bullets hit "bad" MCs that are called bad + x (X being a number from 22 - 40). I can't get it to work. I belive that I am not referencing the duplicated MCs correctly
Code:
for (x=22; x<42; x++) {
if (this.hitTest("_root.bad" + x)) {
[code].....
I used a tutorial from here, that creates snow, and changed it up a bit so that it now creates fizz in a soda. however I'm running into a snag.Is there any way to mask duplicated movieClips so that they only show up in a certain area? Or some way to set parameters to accomplish the same effect? (i.e. I want the bubbles to only appear in the area of the cup, and not all over the place).Right now I have just set X and Y values to do this, but the cup is angled and not square, so it doesn't looks quite right.I have tried setting a mask on a layer above which the duplicated movie clip sits, and also have tried setting the depth of a mask_mc so that it is well above any of the layers that the bubbles are generated on (by use of a for() loop), but nothing works.
View 2 RepliesI've created a tsunami menu made up of duplicated menu items. Each menu item should have a rollover and selected state of 240% which works fine. When a menu item has been selected it jumps to another frame but until the user interacts with it it should loop through the different categories.My problem is that I can't get the menu items to scale big while it is looping through the different categories on the matching category frames.
View 1 RepliesHow do I change the y position for the duplicated movie clips I have created?
This is the code I have used to create the movie clips.
var i = 1;
while (i <= 5){
duplicateMovieClip("bar", "bar" + i, 0);
i++;
}
On my stage I have generated a series of Movie Clips at runtime. They drift around in a semi-random motion, causing them to occasionally overlap each other - is there any way of preventing them from doing this?
View 3 RepliesI have the code tucked under a layer of some text, but the hearts end up covering up the text.
View 9 RepliesI am making a small game in which you are a little shooty spaceship type thing, and there are duplicated mines falling around you. When you press space, the shooty spaceship type thing fires duplicated bullets. How do I check a hittest between any bullet
View 3 RepliesI have a problem in loading pictures to duplicated movie clips. I have a dynamic sliding menu and I wanna load images to submenus. However I havent succeeded yet.
Here is the code:
setProperty("Rub", _visible, false);
setProperty("subrub", _visible, 0);
bas._visible=false
[Code].....
i am currently making a game, and for some reason the hittest on my duplicated movie clips isnt working i know how to do them , and know it should be working , because it works on one of the movie clips but none of the others so im guessing it something to do with depth? i will give the code if any1 replys
View 2 RepliesI have a fire animation that i want to freeze (ha!) on the last frame of my swf. So basically the fire is buring and i want all the tweened flames inside duplicated MC to stop so it looks like a snapshot of whereever all the flames currrently are.Everything else in the movie is stopped too, so i was wondering if there was a global stop all motion command or the best way to freeze my fire
View 2 RepliesI have some code that has hearts falling from top to bottom and randomly float off the screen. The problem is the layer order. I have the code tucked under a layer of some text, but the hearts end up covering up the text. So would this be a depth problem? What would be some code to tell the newly duplicated movie clips what layer to appear on(as in appear below the text layer in the timeline).
View 9 Replieswat i want to make.. is a graph plotter.. i add movie clips on the stage and a line should connect them all.. but im having a fkload of problems in solving that..here is the code for adding the movie clips.
function makeABox(e:Event):void {
var newBox:myMC = new myMC();
addChild(newBox);
[Code].....
I'm trying to make duplicated movie clips scroll down the screen (asteroids) for an experimental game but I just can't get it working. :-
I'm using this to duplicate the movieclip:
i=i+1;
duplicateMovieClip ("m0", "m", i);
and trying to get the movieclips to scroll down with this:
p=eval("m" add i);
p._y+=2;
make renamed duplications scroll down the screen?
What (if any) is the actual differance between removeMovieClip() and unloadMovie() for use in erasing duplicated movie clips (using duplicateMovieClip() )? I was looking over some of my code and noticed I used both without much rhyme or reason as to why one over the other.
View 4 RepliesI want to store some values in browser using cookies
but i don't do i do ?
I have plans to make an RPG that is similar to those on the SNES as far as movement goes- you walk one tile in a direction at a time and if the tile that you are trying to move to has been marked as one that can't be walked on, it stops the character from going there. That means that conventional collision wouldn't quite cut it.
So I decided that I would make it to where every tile will have a specific value (one to say that there is no collision, another to say there is, etc.), and every object will have an X and Y value that changes in relation to the character (because there is scrolling in this project).
The thing is, there will be a lot of objects, and there will be a lot of tiles; this will quickly become an unimaginably huge project if I just go ahead and throw objects in.
So, what would be the most efficient way of storing these values? I was thinking of storing it in an XML file or a class, but I haven't really done it before, so I want to get a second opinion before I try and do so.
Now i have one more doubt in Array.. i want to store some values into an Array from a external txt file.. I want to draw a line graph between two variable(X) and (Y) but i want to read that variable values from a external file.. I try use loadVars() class, but in that i have to assign a varable name to each and every value.. but i want to create a generalised class that will store any number of data into an array..
View 9 RepliesI am creating a card game application in that dynamic movieclips created on stage and inside those movieclips different cards can drop, which have some values.
If one movieclip contains one card and another movieclip contained two cards and all the other movieclips 3rd,4th,5th.. etc contains some cards then, if i want to go back and want to drop another card at the top of the old one, than how i can do this, because when i go back and drop a new card inside movieclip than it replaces the old one. i don't want to create a new array for each movieclip.
I'm trying to use associative arrays to store my variables but am looking for a solution to change the value of array1[i] to array2[i]. Since it's an associative array, the only way I know how to loop through these kinds of arrays is by the following:
Code:
for(var i in array1) {
trace(array1[i];
}
What I would do when using indexed arrays to change the value of array1[i] to array2[i] would be something like this:
Code:
for(i=0; i<array1.length; i++) {
array1[i] = array2[i];
}
However, I can't see any way you can do this with associative arrays because they do not have a numbered index such that in a loop you could
say array1[i] = array2[i] .
So I'm looking for a way to do this with associative arrays.
How many small size movie clips can I store in the library. On the stage I randomly use 6 of them but this random clips will come from an array full of 3500 m.clips. Is it reasonable , or should I use another way like using xml files.
View 10 Replieshow to duplicate movie clips which allow me to drag every movie clip duplicated.
View 4 RepliesI have a problem with SharedObject. I created SharedObject using AS2.0 it's working fine.... my question is can it possible to store the variable values in an .txt file where the flash file is saved... basically the SharedObject will store the vallues in localdrive with file extention. not only using SharedObject if any other way to store the vaules in .txt file will be helpfull for me... my requirement is to store the the position of the swf file and when the time it reopen, it should start from previous position.
View 2 Replies