Loading Images To Duplicated Movie Clips
Hi ppl,
I 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 n = 0; while (n<=TotalRubs) { n = n+1; set("PosY"+n, getProperty(n, _y)+RubHeight- 1.5); if (TargetRub==n and eval("Total_Subrubs_Rub" add n)>0) { z = 0; while (z<eval("Total_Subrubs_Rub" add n)) { z = z+1; duplicateMovieClip("subrub", n+"_"+z, Number((n*10))+Number(z)); this[n+"_"+z].img.loadMovie("urun2.jpg"); set(n+"_"+z+":subtxt", eval("L" add n add z)); if (Number(z) == 1) { setProperty(n+"_"+z, _y, Number(getProperty(n, _y))+RubHeight- 1.5); } else { setProperty(n+"_"+z, _y, getProperty(n add "_" add (z-1), _y)+SubrubHeight); } } max = SubrubHeight*eval("Total_Subrubs_Rub"+TargetRub); //set("PosY" add TargetRub, Number(getProperty(TargetRub, _y))+Number(getProperty(TargetRub, _height))); set("Distance" add n, eval("Distance" add n)+5); if (eval("Distance" add n)>=max) { set("Distance" add n, max); } //setProperty(Number(TargetRub)+1, _y, eval("PosY" add TargetRub)+eval("Distance" add TargetRub)); } else { z = 10; while (z>0) { z = Number(z)-1; removeMovieClip(n+"_"+z); } set("Distance"+n, eval("Distance"+n)-10); if (eval("Distance"+n)<=0) { set("Distance"+n, 0); } } setProperty(n+1, _y, eval("PosY"+n)+eval("Distance"+n)); }
I ll be very happy if somebody help me on this problem thanks in advance...
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-26-2007, 02:20 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Images To Duplicated Movie Clips
Hi ppl,
I 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
n = 0;
while (n<=TotalRubs) {
n = n+1;
set("PosY"+n, getProperty(n, _y)+RubHeight- 1.5);
if (TargetRub==n and eval("Total_Subrubs_Rub" add n)>0) {
z = 0;
while (z<eval("Total_Subrubs_Rub" add n)) {
z = z+1;
duplicateMovieClip("subrub", n+"_"+z, Number((n*10))+Number(z));
this[n+"_"+z].img.loadMovie("urun2.jpg");
set(n+"_"+z+":subtxt", eval("L" add n add z));
if (Number(z) == 1) {
setProperty(n+"_"+z, _y, Number(getProperty(n, _y))+RubHeight- 1.5);
} else {
setProperty(n+"_"+z, _y, getProperty(n add "_" add (z-1), _y)+SubrubHeight);
}
}
max = SubrubHeight*eval("Total_Subrubs_Rub"+TargetRub);
//set("PosY" add TargetRub, Number(getProperty(TargetRub, _y))+Number(getProperty(TargetRub, _height)));
set("Distance" add n, eval("Distance" add n)+5);
if (eval("Distance" add n)>=max) {
set("Distance" add n, max);
}
//setProperty(Number(TargetRub)+1, _y, eval("PosY" add TargetRub)+eval("Distance" add TargetRub));
} else {
z = 10;
while (z>0) {
z = Number(z)-1;
removeMovieClip(n+"_"+z);
}
set("Distance"+n, eval("Distance"+n)-10);
if (eval("Distance"+n)<=0) {
set("Distance"+n, 0);
}
}
setProperty(n+1, _y, eval("PosY"+n)+eval("Distance"+n));
}
I ll be very happy if somebody help me on this problem
thanks in advance...
Loading Jpg In Duplicated Movie Clips?
hello there.
I am trying to make an easy upgradable thumbnail flash. the concept is, duplicate a movie clip x times in order to load x .jpg files in the duplicated movie clips.
my code is:
x=1;
mc.duplicateMovieClip ("mc"+x, x++ );
problem is that I cannot address the newmovie clips to be loaded specific jpg files.
meaning, when I use:
newclip="mc"+x;
trace(newclip);
..I get the filename that corresponds to the loaded jpg I want, eg, jpg filenames be mc1.jpg, mc2.jpg, mc3.jpg, etc.
but I can't use this using loadmovie, eg
newclip.loadmovie("mc"+x+".jpg");
How do I syntax the loadmovie function in order to get the results I want?
Loading ASP Vars Into Duplicated Movie Clips
sup sup?
help a brother out?
I got this from a really simple ASP script that I wrote:
1=brian
2=borna
3=mel
4=stacy
5=boy
so what I want to do is:
_load the information into flash
_duplicate a text movieclip named "name"
_have each duplicated movie clip associate itself with a new value based on the ASP generated script.
Can it be done?
I can already load a single variable into Flash with the LoadVariableNum scripting, and I can change all of the duplicated clips, but how do I change one, and then have the next one (i+1)? have a new value?
Thanks
phoenix
Easy Question? Loading Dynamic Text Into Duplicated Movie Clips
I think I have an easy question for you (I haven't been able to find the answer for this yet on the boards or in the tutorials).
I am trying to create a dyanmic menu system via my XML document. The menu system, or button MC's, need to be duplicated and need to have dynamic text inserted into each indivdual button.
I have:
1.) Created a MC with a dynamic text box with a variable name of "navText"
2.) On my stage, I have given this MC an instance name of menuClip.
My problems:
1.) I can duplicate the MC's correctly but cannot get the text to display in the text areas.
2.) For debuging purposes, I removed the "duplicateMovieClip" call, let the lone MC sit on the stage, and I am able to pass information to the dynamic text field of the MC.
So...I know that logically something is working correct....I just need the text to show up when the MC is being duplicated.
Here is the AS:
Code:
function topNav(navNode) {
for (var n = 0; n<navNode.childNodes.length; n++) {
menuClip.navText = rootNode.childNodes[n].childNodes[2].childNodes[0].nodeValue;
menuClip.duplicateMovieClip("menuClip"+n, n);
this["menuClip"+n]._x = this["menuClip"+(n-1)]._x+this["menuClip"+(n-1)]._width;
this["menuClip"+n].choice = n;
trace(menuClip.navText);
}
};
Any ideas?
Loading Images Into Movie Clips
How do I load an image located in a folder into a Movie Clip.
I have tried with picture1.loadMovie("images/pic1.jpg") but this doesn't seem to work.
Loading Images Into Empty Movie Clips
Can anyone tell me how to load an image called "frame.png" into an empty movie clip on the stage called "frame"?
I tried doing this on the first frame of the main timeline (there is only one frame in the movie so far)
loadMovie("images/frame.png", "frame");
This doesn't work. What am I doing wrong?
Thanks
Loading Swf Into Duplicated Clips
I use a movie clip which duplicates with the idea to load swf's into them.
The "mother clip" loads an swf from the maintimeline that works fine.
The problem is the sfw which is loaded into the movie clip calls for another swf to load into a duplicated version of the first clip. I have done this before but never with duplicated clips, and I can't get it to work.
Is it not possible to let one swf which is loaded onto a clip call for another swf to load into a duplicated clip?
Loading Random Images Into Movie Clips Using Attachmovie?
Ok so I'm totally at a loss here...
I have four empty movie clips that I want two types of pictures to load into randomly.
(example)
food1_mc place1_mc food2_mc place2_mc
now I want to randomly load images into those empty clips (pictures of food and places, imagine that). I can load in PNGs randomly but I ALSO want to have those images animate into frame each time the user visits the home section. So if I load PNGs it doesn't animate since the animation frames are passed before the PNG loads in. I also tried to throw a loader on the front but that only loads the flash file (of course) and not the PNGs. So my idea is to import all the images (there are 12 of each kind) into the library into their own movie clips (naming them food1, food2 etc etc) and then randomly AttachMovie to those empty movieclips... And then I will throw a loader on the front of that whole thing.
So I have the basic idea correct, I think, but I can't figure the code out.... Is this the most efficient and sane (at least on my end) way to do what I want?
halp?
big thankee sais in advance.
Duplicated Movie Clips Help
Question 1.
How do I duplicate movie clips that aren't in the frame but in the library? I went to linkage and exported it for actionscripting (I told it to export in the first frame) but it doesn't recognize them.
Question 2.
I use a variable called movie_num to keep track of my duplicated movie clips. Everytime a movie clip is duplicated, I add 1 to movie_num. When I try to alter a variable in a movie clip (let's call the movie clip "circle"), I would say in action scripting:
("circle"+ movie_num).variable_name = 1;
That would alter the last movie clip to be duplicated but it doesn't work. When I use that method for dragging or removing a movie clip, it does work. What am I doing wrong? Also, give me a better way if you have one (provide action script please).
Talking To Duplicated Movie Clips?
I am having a problem communicating properly to MCs that are being duplicated when the user clicks an icon and drags them to a hotspot.
My question is, if I have an data array associated to the MC being duplicated, does or can the duplicated MC contain a unique instance of the data array set? and if so, if the dulicated MC is on _level0, can I send the mulitdimensional array to the server as one variable? Since, I'm going to have an array of duplicatedMCs that each contain a unique data array set.
Targeting Duplicated Movie Clips
Hope someone can help me. I'm trying to target individual MC's that are inside duplicated MC's generated by an array. Is this possible?
thanks for any help!
Ray Boehmer
E-Learning Developer
Cisco Systems, Inc.
HitTest For Two Duplicated Movie Clips?
i have this game where there are MC's being duplicated and positioned at random points...my question is how do i test if one duplicated MC hits another one? i cant just go if(this.hitTest(_root.something)) because i dont know what name exactly the _root.somethign will be...since it could be either _root.something1, _root.something2, etc...get what i am trying to say? thanks.
Controlling Duplicated Movie Clips
hi,
On the scene I want 2 insects.I scripted one insect movie,when you click it,it gets crushed.Then ý duplicate it but when ý click on the second movie clip ,still first one crushs.Can you tell me what to do to crush the second one?Sorry,this is the second message but I couldn't get any help from the first one.
Thanks
Targeting Duplicated Movie Clips
So I'm using the following actionscript to duplicate a movie clip 50 times:
i++;
duplicateMovieClip ("_root.flower", "flower"+i, i);
Is there a way to target these clips?
Basically what I'm doing is duplicating a movie clip of a flower-like object. Then, when it's been duplicated 50 times, I want to wipe the stage clean of all duplicated clips and start again. What can I do to remove all of these movie clips?
Masking Duplicated Movie Clips
I am duplicate a movie clip that is under a mask layer but the duplicates of the clip apear outside the mask. is there any way to specify what layer the duplicates belong to or to put them under the mask.
thanx dave
Masking Duplicated Movie Clips
I am duplicating a movie inside another movie that loads external images.
I want to mask over the images to show only portions for a menu.
I tried using two movies in the container movie, one for the images(works well) the other for mask(failure).
I need help Urgently Please....
Targeting Duplicated Movie Clips
anyone know how to do this....i've been trying really hard and failing.... pleeeeease help someone...i want to target a movie clip("grow") inside some of the duplicated movie clips and tell it to play...
on(keyPress"i"){
//variables
b = random(12);
i++;
a = "leaf" + i
//dupposition
_root.leaf.duplicateMovieClip(a,i);
_root.leaf._y = ypos[b]
_root.leaf._x = xpos[b];
}
on(keyPress"i"){
_root.leaf1.grow.gotoAndPlay("fall");
}
Controling Duplicated Movie Clips
please could some one help me as this has been bugging me for days now.. i have duplicated a movie clip with the following lines :
for (i=0; i<=nosBoxes; i++) {
_root.box.duplicateMovieClip("box"+i, 1);
}
Now what i can't work out is how to contol/position the newly created boxes..
Also do you know where i could get some decent tutorials on scripting interactive graphics, i can't find any anywhere!! Any help would be greatly appreciated.
Removing Duplicated Movie Clips
Please help me!
I've got a movie clip that is duplicated that I'd like to remove/ or make invisible through a button action. I can remove the original clip, but not the duplicates of it. Can anyone help me?
Thanking you kindly!
Removing Duplicated Movie Clips
Does anyone know how to remove mulitple movie clips at one time (like when a user clicks a button)?
I need to clear an area of duplicated movie clips, all with different instance names at different levels.
Since they are on consecutive levels, I was going to run a loop to remove them based on their level position, but I don't know how to target a movie clip based on its level.
Thanks!!!
Removing Duplicated Movie Clips
I have a movie clip that can be dragged and when released a duplicate movie clips clip is created. This is the script that I used:
on (press) {
startDrag(_this);
}
on (release) {
stopDrag();
_root.i++;
_root.draw.green_circle.duplicateMovieClip("green_ circle"+_root.i, _root.i);
}
Now I would like to create a button that removes all of the duplicate movies clips. I have tried this with no success:
on(release){
for (var j = 1; j<_root.i; j++) {
_root.draw["green_circle"+j].removeMovieClip();
}_root.i=0;
}
Any suggestions?
Dragging Duplicated Movie Clips
i have movie clips that i'm using as stamps in a drawing program. when you click once on the stamp it picks it up then when you click again it places the stamp on the board. there are some problems with it though that I dont know how to fix. the problems are...
the biggest problem... when you click on a different stamp, one of the previous stamps disappears. so if you put two pig stamp on the board, and then put a chicken stamp on the baord, one pig will disappear. i dont want to have a stamp limit, they should be able to fill the whole board with stamps if they choose.
once the stamp is placed on the board you can click on it again and duplicate and drag the already duplicated MC. i dont want it to do this. i only want them to have one chance to place it on the board.
heres the code im using:
on (press) {
this = this.duplicateMovieClip("pig2"+count, count);
count += 1;
startDrag (this);
}
on (release) {
stopDrag ();
}
i changed the name of the duplicate mc for each stamp, for example the chicken is named "chicken2".
any help would be appreciated, thanks.
Masking Duplicated Movie Clips (HELP)
I have an array of thumbnails that I create through duplicated movie clips and loading jpegs into the clips. I have more jpegs than I do space in the strip I am using to display them however and I wanted to create a mask for each of the thumbnails so they would only be visible in the center of the strip.
duplicateMovieClip(_parent.thumbStrip.ImageButtons , "ImageButtons"+i, i);
duplicateMovieClip(_parent.thumbStrip.mask, "mask"+i, (i+totalImages));
_parent.thumbStrip["ImageButtons"+i].loadMovie("Thumbs/"+ _parent.slideImage[i]);
_parent.thumbStrip["ImageButtons"+i].setMask(_parent.thumbStrip["mask" + i]);
When I run this, the movieclips are simply duplicated above the thumbnails and do not act as masking layers. I don't want the masks to be visible, I just want them to act as a window. I've searched the forums and the links I have found don't quite relate to this approach that I can tell.
Any suggestions as to what I am doing wrong, and is this question clear?
Targeting Duplicated Movie Clips
I'm duplicating a movie clip using the following code:
i = 1;
do{
my_mc.duplicateMovieClip("my_mc" +i,i);
i++;
}while (i < 50);
The next thing I want to do is line them all up side by side, so what's the best way to target all the duplicated movie clips so I can re-set their _x and _y coordinates?
Sorry if there are loads of posts on this already but my browser kept timeing out every time I tried to search.
Many thanks.
Duplicating Duplicated Movie Clips
yo...
i found this tutorial here in fk that teaches how to make a flame animation.
the flame animation duplicates a movieclip.
what i want to happen is make the flames rain down,
i'm lost for words right now... sorry if im unclear...
anyways i'll attach the .fla here.
thanks.
Problem With Duplicated Movie Clips
Hey guys,
i'm having a strange problem with a slide show i'm trying to make. Essentially, it will be a scrolling slide show that automatically centers every time you click on an object. that part works right now. However, I want the slideshow to "wrap around" - that is, if i reach photo 100, i want photo 1 to be shown next to it, and vice versa.
Currently, I have it as far as duplicating the movie clip and positioning itself correctly - however, the onEvent handlers do not work for the duplicated movie clips.
I'd like to think i know a decent amount about actionscript but I must admit this is kind of uncharted waters for me. If anyone could help me get flash to recognize the on(release) event on the duplicated clip, I'd be forever grateful!
How Do I Mask Duplicated Movie Clips?
I am making a paintball game and have created a paintball movie clip that grows to simulate it hitting the screen. The problem i am having is that when i duplicate it, all my masking stops working. Is there a way of duplicating it behind the mask?
This the code i am using for duplicating at the paintball
_root.shot.duplicateMovieClip("shotx"+count, count);
_root["shotx"+count]._x = _root.enemy._x;
_root["shotx"+count]._y = _root.enemy._y;
_root["shotx"+count]._xscale = 0;
_root["shotx"+count]._yscale = 0;
count += 1;
Moving Duplicated Movie-Clips
If I have a line and duplicate it and make the new name "line"+i. How do I make the _x of every "line"+i to be added by 5. It doesn't work for me or I don't know the trick, I use Flash MX if that makes a difference or not. I'll post the code of what I mean.
Code:
_root.onEnterFrame = function() {
for (i=1; i <= 25; i++) {
duplicateMovieClip(line, "line"+i, i);
}
_root["line"+i]._x += 5; // this is what I want to work but I don't know how
};
Masking Duplicated Movie Clips
hi,
i'm using duplicateMovieClip() to display a list of results and i'm trying to mask an area of those results.
the problem i'm having is that the mask doesn't work because the duplicated movie clips are created at a higher depth than the mask itself.
anyone have any ideas how to fix that?
thanks in advance,
alex =]
Removing All Duplicated Movie Clips
I have a whole bunch of different duplicated movie clips called "unit+_root.i". (like unit0, unit1, unit2... etc) and when they defeat this castle thing, it moves to the next frame. The thing i want is when it goes to the next frame, it will take off all of those duplicated movie clips i just made. can anyone help me?
Controling Duplicated Movie Clips
hi, i'm developing a shooting game, in which i am duplicating the bullet (ship) to shoot at a guy.
i have an array as you can see here.
Code:
for (i=1; i<=50; i++) {
_root.ship[i] = new shipparent();
duplicateMovieClip(_root.ship, "ship"+[i], i);
_root.ship2._x = _root.gun._x;
_root.ship2._y = _root.gun._y;
}
}
in stead of using ship2, i would like to use what ever is the next unused ship... and im not quite sure how to do this.
does any body else know?
thanks a bunch
How Do I Target These Duplicated Movie Clips?
i want to when i click a button delete all these 50 smoke movie clips from the movie... how?
unloadMovie(_root.smoke_mc+j")????
_root.smoke_int = setInterval(createSmoke, 50);
function createSmoke() {
for (j=0; j<50; j++) {
var newSmoke = attachMovie("smoke", "smoke_mc", 500+j, {_x:400, _y:400});
newSmoke._x = (random(5)+70);
newSmoke._y = (random(100)+185);
newSmoke._xscale = (random(20)+50);
newSmoke._yscale = (random(120)+50);
newSmoke._alpha = random(5);
newSmoke.gotoAndPlay(random(20)+1);
}
}
Duplicated Movie Clips And Hittesting
I'm attempting a tower Defence game.
I've used both the available tutorials, then built from there.
I'm up to finding a way in which you can not place a tower on another tower.
i know it can be done.
heres the code.
Code:
function new_tower() {
tower.duplicateMovieClip("tower_"+t, t);
_root["tower_"+t].delay = 1;
_root["tower_"+t].dmg = 33;
_root["tower_"+t].bulletspeed = 5;
_root["tower_"+t].timer = 0;
_root["tower_"+t].range_visible = false;
_root["tower_"+t].tower_range._visible = false;
_root["tower_"+t].placed = false;
_root["tower_"+t].radius = 18.5;
_root["tower_"+t].onMouseDown = function() {
if (!this.ctower.hitTest(_root.path1.g1)) {if (!this.ctower.hitTest(_root.path1.g2)){if (!this.ctower.hitTest(_root.path1.g3)){if (!this.ctower.hitTest(_root.path1.g5)){
with (this) {
placed = true;
}}}}}
};
Just the top third of the tower actionscript.
Anyway, the t value is ++'ed at the end.
I've been toying around.. but to no avail.
But yeah, how would i do it. I tried a few stupid attempts like if(!this(_root["tower_"+Infinity]))
ect.
Please help us out, thanks.
Controlling Duplicated Movie Clips?
Okay, I was here just the other night discussing this (and you guys were alot of help!) and i just have some questions
I have this game I'm making, its kinda like the game Defend Your Castle (if you've ever played it)
Basically I have one movieclip of a stickman, and i have that stickman being duplicated using duplicateMovieClip. All these duplicated stickmen spawn on the left side of the screen, and start running to the right.
Here is the code on the frame:
------------------------------------
interval=setInterval(SpawnStick ,1000);
count=1;
depth=1200;
function SpawnStick(){
status=Math.round(Math.random()*2);
if (status==0){
name="stick"+count;
duplicateMovieClip("stick", name,depth++);
setProperty(name,_x,-31.7);
count++;
}
}
------------------------------------
//basically just a setinterval to call the function SpawnStick (to spawn new stickmen)
I just want the stickman to turn red when you shoot/click him once. The red version of the stickman starts on frame 7 of the movieclip
on the "stick" movie clip i have:
------------------------------------
onClipEvent(load){
shot = 0
this._y=random(175)+140;
}
onClipEvent(enterFrame){
this._x += 2;
}
onClipEvent(mouseUp){
shot++;
if (shot==1){
this.gotoAndPlay(7);
}
}
------------------------------------
The only problem is that when i click/shoot any of the stickmen, ALL of the stickmen that are on the stage turn red. I understand WHY this happens (all the duplicated movie clips have the same code on them) but I don't know how to fix it.
How can i individually control each duplicated movie clip? I just need them to turn red when i click/shoot them once.
If anyone could help, i would be eternally grateful
Removing Duplicated Movie Clips
HI There
I know this has been discussed before, but I was unable to resolve the following problem using the proposed answer. I am working on a Flash / ASP application for logging IT related requests. In order to display all requests logged by the current logged in user, I query the database, and return the results as arrays. Using the arrays, I create a set of duplicated movieclips using the following code:
ActionScript Code:
stop();
// hide the origional clips
RefID._visible = 0;
Subject._visible = 0;
DateLogged._visible = 0;
// split up the array by looking for the commas
ID_array = IDoutput.split(",");
Subject_array = SUBoutput.split(",");
DateLogged_array = LOGoutput.split(",");
// get the length of the array
ID_length = ID_array.length;
// set the start y position (x position depends on where you put it on the screen)
yposition = 70;
// looping everything
for (i=0; i<ID_length; i++) {
// RefID
duplicateMovieClip(RefID, "RefID" add i, depth);
setProperty("RefID" add i, _y, yposition);
RefID.RefID = ID_array[1];
set("RefID" add i add ".info", ID_array[i]);
depth--;
// Subject
duplicateMovieClip(Subject, "Subject" add i, depth);
setProperty("Subject" add i, _y, yposition);
Subject.Subject = Subject_array[1];
set("Subject" add i add ".info", Subject_array[i]);
depth--;
//Date_Logged
duplicateMovieClip(DateLogged, "DateLogged" add i, depth);
setProperty("DateLogged" add i, _y, yposition);
DateLogged.DateLogged = DateLogged_array[1];
set("DateLogged" add i add ".info", DateLogged_array[i]);
depth--;
// Set the y position plus 25
yposition = yposition+25;
}
The code above works fine. When the user clicks on the "RefID" movie clip, it must take him/her to the details of that issue. This once again works fine, but when I try to remove the movieclip, it only removes the first one, and the rest remains visible.
I tired the following code to remove the duplicated clips:
ActionScript Code:
stop();
for (i=0; i<ID_length; i++) {
test = "RefID" add i;
removeMovieClip(test);
}
Thank you in advance
O-Grrrrr
Formatting Duplicated Movie Clips
Hi All,
I am using the following code to duplicate a movieclip (itemInstance) and get them to stack one below the other.
Code:
// get position of template movie clip
yPos = getProperty("itemInstance", _y);
// iterate over array elements
for (i=0; i<(names.length-1); i++) {
// clone movie clip and name it
duplicateMovieClip("itemInstance", "itemInstance"+i, i);
// set position
setProperty("itemInstance"+i, _y, yPos+i*108);
}
This works fine, but I want it to stack 10 vertically and then go right 300px (or so) and then go back to the top and stack another 10. And so on, like bricks in a wall.
Just so you know the number for 'i' is dictated by the number of names in a database.
Any help will be greatly appreciated - thanks
Masking Duplicated Movie Clips
In the attached fla I have 2 mcs. One is duplicating the other using the following code:
---------------------------------
onClipEvent(load) {
var i = 1;
}
onClipEvent(enterFrame) {
var makeBubbles = (random(26)==2) ? 1:0;
if (makeBubbles) {
_parent.bubble_mc.duplicateMovieClip("bubble"+i, i);
var bubbleX = Math.floor(Math.random() * (250));
var bubbleY = Math.floor(Math.random() * (450 - 350)) + 350;
setProperty ("_parent.bubble"+i, _x, bubbleX);
setProperty ("_parent.bubble"+i, _y, bubbleY);
i++;
}
}
---------------------------------
The duplicated mc's are animated. The code animating them is attached to the mc to be duplicated. All this works fine.
The problem is that the mc's are masked and while the mask works for the first mc being duplicated, it doesn't work for the others.
I have tried masking different layers, playing with depths etc but have had no luck.
I have stripped all the other content out of the movie so it is easy to see. Any suggestions on what is causing this problem would be ideas much appreciated.
TIA,
Adrian
LoadMovie From Duplicated Movie Clips
I'm creating a web page to display photographs and I want to display a list of buttons which when pressed will each load different photographs from an external source. I'm trying to be clever in creating all the buttons from a single instance in the library by using attachMovie and the following while statement
while(i++<list.length-1) {
name = "button movie" + i;
y = i*spacing;
display.list.attachMovie("buttonMovie", name, i);
display.list[name]._y = y;
display.list[name].title = list[i];
}
This has created all the buttons I need from the array that I created but I am now having problems loading an external movie (the photos) from each individual button.
Is there anyone who can help out there? I'd be very grateful
Paul
Hittest With Duplicated Movie Clips
If I have duplicated movie clips using this code
ActionScript Code:
onClipEvent (enterFrame) { count = 1; while (count<5) { _root.fall.flakey.duplicateMovieClip("boxx"+count, count); count += 1; }}
Does anyone know how I can use hittest on all the duplicated movie clips?
Hittest On Duplicated Movie Clips
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? please help , i will give the code if any1 replys
Unloading Duplicated Movie Clips
Greetings Everyone,
I am taking a brief break from the election bruhaha to ask a quick questions that I have a sense is going to be very very very 'head-thwackingly' simple, but I have to ask anyway.
FYI, I had to chop (butcher) my FLA file down so that I could post it so don't judge me ... well don't judge me based on the design ... judge me on the stupid question I am about to ask.
As you will see when you test the attached file, the cloud and 'green things' are duplicated. The problem I am having is when I click on the contacts button it goes to the next frame (I originally had each of the 8 menu segments as their own scene, an idea I may go back to ...)
The problem is that when it goes to the next frame/section the clouds and green things carry over to the next section. How do I stop this from happening?
Thanks.
Brian
Draggable Duplicated Movie Clips
Hello, I'm creating an application with Flash and I could really use some help. The application is for floorplan furnishing. There is a floorplan and you drag and drop furniture on the floorplan.
I would like to allow the user to generate as many MCs as they'd like of whatever furniture pieces they want and rotate them.
Thanks!
Y Position For Duplicated Movie Clips.
Hi.
How 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++;
}
Thank you very much in advance.
HitTesting With Duplicated Movie Clips.
Simply, I want to be able to initiate hitTest actions with a duplicated movie clip, or even be able to do any action with a duplicated clip.
I've been trying things like if(_root.mc1.hitTest("mc2"+i)) or if(_root.mc1.hitTest(_root.eval("mc2" + i))) but cant get it to work right.. I know I'm missing something.
HitTest On Duplicated Movie Clips?
i have two separate movie clips, both of which will be duplicated for continuous movement, and i want to do something when they intercept each other.
i know how to do a hitTest on 2 regular movie clips... but how do you reference duplicated movie clips for the hitTest?
anyone? please?
Reference Duplicated Movie Clips
I 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. Any advice or suggestions you could provide would be most helpful.
Code:
for (x=22; x<42; x++) {
if (this.hitTest("_root.bad" + x)) {
trace("DEAD");
}
}
}
Thank You!
|