Unload Duplicate Movie Clips?
Hi,
I've made a load of duplicate movie clips, but when I click on a button I want these duplicates to unload/delete.
How do I do this?
Thanks.
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-24-2002, 11:20 AM
View Complete Forum Thread with Replies
Sponsored Links:
Is It Possible To Unload ALL Movie Clips At Once?
Greetings,
I'm in the middle of a project that requires alot of movie loading and unloading. There are over 50 movies and before the next movie gets loaded, 49 others have to be unloaded (please don't ask why ). Needless to say this gets very tedious if I have to enter 49 'UnloadMoiveclip' actions every time I need to load a new movie clip.
Does anyone know how to Unload ALL movie clips at once?
Thanks, this would really help me out.
Cheers.
View Replies !
View Related
Unload Movie Clips
Im loading an dunlaoding a moviclip in as2 and before i load the clip by bringing it to the front and loading an external swf everything works ok
this is what im using to load it in to the main timeline.
on (rollOver) {
this.gotoAndPlay("s1");
}
on (releaseOutside, rollOut) {
this.gotoAndPlay("s2");
}
on (release) {
//load Movie Behavior
if(this._parent._parent.blankmovie == Number(this._parent._parent.blankmovie)){
loadMovieNum("pm.swf",this._parent._parent.blankmovie);
} else {
this._parent._parent.blankmovie.loadMovie("pm.swf");
}
//End Behavior
//Bring to Front Behavior
mx.behaviors.DepthControl.bringToFront(this._parent._parent.blankmovie);
//End Behavior
}
this is what im using to unload it.
on (release) {
//unload Movie Behavior
if(this._parent == Number(this._parent)){
unloadMovieNum(this._parent);
} else {
this._parent.unloadMovie();
}
//End Behavior
after the clip unloads it screws the navigation panel, amost like the clip isnt unloading right and the rest of the nav panel dont work right.
View Replies !
View Related
Load & Unload Movie Clips
hi all,
anyone knows how to load and unload a movie clip from an empty movie clip? what i would like to achieve is loading a movie clip onto an empty movie clip on the main movie; then, when click on a button, unload the previous movie clip and load a new one in its place.
i'm very new to actionscript so, please give me the necessary line of codes in details.
thank you so much for your help!
michael
View Replies !
View Related
[F8] Unload And Load Movie Clips
hello,
I have navigation bar who contains an intro, when the intro is finished I want it intro movie to "swap" for the working nav bar. (am I clear???)
So the user cannot see their is a swap.
Should I have something in my AS like play movie, unload and load??
Thank you
View Replies !
View Related
[MX04] Load / Unload Movie Clips
I am loading external SWFs on my main flash file.
For every External SWFs:
They also have multiple levels. There is a base SWF and then 5 levels of other external SWFs there.
So- i load an external SWF on my main flash and that external SWF also has its own external SWFs.
This is how i do that:
on my main flash file.. i create a blank MC:
this.createEmptyMovieClip("blank1", this.getNextHighestDepth());
Now, by default i load my first external MC there (ExtMC1)
_root.blank1.loadMovie("ExtMC1.swf");
Now i have a button (Button2) and when it should be clicked- it should replace ExtMC1 with ExtMC2.
_root.blank1.loadMovie("ExtMC2.swf");
This just don't work because it does replace the base file for ExtMC1 but the external SWFs within ExtMC1 remains on the main flash file..
so i use this instead:
button2.onRelease = function() {
unloadMovieNum(1);
unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
_root.blank1.loadMovie("ExtMC2.swf");
};
so basically i clear all the levels first and then load my second MC (ExtMC2.swf).
similarly to load my third MC i use this on button 3:
button3.onRelease = function() {
unloadMovieNum(1);
unloadMovieNum(2);
unloadMovieNum(3);
unloadMovieNum(4);
unloadMovieNum(5);
_root.blank1.loadMovie("ExtMC3.swf");
};
is there any better way of doing the same- it does work but the issue is, when the first MC (ExtMC1) is loading and click on the button 2 to load the second MC (ExtMC2) - it takes a lot of time.. so i need an effective way of doing the same.. please help.
View Replies !
View Related
Duplicate Movie Clips
Right, this is for a project I have devised ago, and only now have I got round to working out how to achive it. It is like this.
I am creating a "Ransom Note Generator", as a joke, whereby people come along, create a message, save it or send it to someone else, anonymously. I'm not worried abnout the back-end just yet...it's the flash part that I am working on.
To create the note, there is a list of letters in the alphabet (1-26) and when pressed they will duplicate a movie clip with that letter in it. The user then drags these letters together to form a word. Follow me?
In basic terms, how could I have, say to create the letter A a button which when clicked duplicates a hidden movie clip somewhere onto the screen, which has the letter A in it? I can do dragging etc, but it's the actual duplication that stumps me.
I know I should know how to do this...it's fairly basic stuff!!
Thanks,
Nick
View Replies !
View Related
Duplicate Movie Clips?
Two Questions:
1. How do u duplicate a movie clip into another movie clip?
2. I have a dynamic textbox on the duplicated movie clip. Is there any way to set its variable within the code?
All answeres appreciated.
Zoo-man
View Replies !
View Related
Duplicate Movie Clips
hi,
i have created a tool bar which allows a user to duplicate certain movie clips, which in turn can be dragged around the screen.
However, i can only make it work when there is alredy a version of the movie clip visible on the screen.
How can i make it so that the movie clip only appears when the relevant button is pressed, and can then be duplicated?
View Replies !
View Related
Duplicate Movie Clips?
how do i duplicate movie clips after say,i press on a button.,and each time i duplicate a movie clip it appears randomly and moves around randomly? Can any 1 help me?
lets say the movie clip is a bee which i want to duplicate and make it move around randomly...and it only duplicates when i press a button for eg.
Thanks in advanced!
Blue Dragon
View Replies !
View Related
Duplicate Movie Clips
I have a movie clip, which is a blue square, and inside the MC, I turned the blue square into a button. Then,I duplicated the MC in the library, and I changed a text written on the button in each duplicated MC.
Every change I made in the MCs changed the others.
Why does it happen, and how can I make the duplicated MCs independent?
thanks,
Berry
View Replies !
View Related
Can't Duplicate Movie Clips
Can you duplicate a movie clip, and within each duplicated movie clip, duplicate another movie clip?
example:
_root.buttons.buttons.duplicateMovieClip("newbutto n", 1);
_root.buttons["newbutton"].button.duplicateMovieClip("newbutton", 3);
I tried it, can't seem to get it right. any help would be appreciated.
- jeremy
View Replies !
View Related
Duplicate Movie Clips....
I'm making a game here, and the main guy is called Jay. When the 'x' button is pressed, the shot1 mc will be duplicated as so...
Code:
if (_root.jay1._visible == true) {
shotNum++;
_root.shot1.duplicateMovieClip("shot1"+shotNum, shotNum);
_root["shot1"+shotNum]._x = _root.jay1._x;
_root["shot1"+shotNum]._y = _root.jay1._y+30;
_root["shot1"+shotNum]._x += 30;
}
BUT....The duplicates won't respond to a hitTest function...(shot1 is the mc that all the duplicates derive from)
Code:
onClipEvent (enterFrame) {
//The line following line is wrong...
if (_root.square, hitTest(_root.shot1)) {
trace("ow");
}
}
How will the square be activated when it's hit by the duplicates?? Thanks for your help!
View Replies !
View Related
How To.. Duplicate Movie Clips
I have a simple shape tween in a movie clip.
Once its over, I want one just like it to appear 20px underneath.
But I want it done trough auctionscript.
So far, I came up with this, but I know it's not right:
var x = 4.7;
var y = 4.7;
var inc = 20;
for(i=0;i<5;++i){
if((_root.button[i]._currentframe)==20){
_root.button[i].stop();
duplicateMovieClip("button" + i, "button" + [i++], i);
_root.["button"+i]._x = x;
_root.["button"+i]._y = y + inc;
inc = inc + 20;
}
}
^ in the root frame
View Replies !
View Related
Duplicate Movie Clips
The eternal snow question...
I have one MC of snow, i want to duplicate it along the y axis at random locations. I want the duplication to not excede a certain amount of MC's and also to generate every half second or so. Anyone have any ideas?
Thanks in advance
View Replies !
View Related
Duplicate Movie Clips
Very simple...how do i get this code (function) to stop?
code:
var nNum = 1;
function mMove() {
nNum++;
mcSnow.duplicateMovieClip("mcSnow"+nNum, nNum);
_root["mcSnow"+nNum]._x = random(Stage.width);
}
setInterval(mMove, 2500);
View Replies !
View Related
Duplicate Movie Clips
This should be easy but I cannot figure it out.
I have created a button that dupe a mc and positions on the stage. I want to be able to dupe that same clip again so I can have multiple copies on the stage to drag around. I understand I have to change the level or depth each time I click the button. How can I do this?
code is:
duplicateButton_btn.onRelease = function() {
duplicateMovieClip(nerd_mc, "nerdCopy_mc", 1);
with (nerdCopy_mc) {
_x = 60;
_y = 220;
}
};
View Replies !
View Related
[f8] Max Duplicate Movie Clips?
Hello all,
Is it possible, by using the duplicateMovieClip method, to actually duplicate one form of movie clip in place of another? Regardless of how it's been scaled? What I am planning on doing is having some say red bubbles, and blue bubbles for instance. What I want to do is increase the blue bubbles which will in turn make the red bubbles disappear. A bit like survival of the fittest! Would this involve some sort of maxMovieClip command (if it exists?)
Regards
Adover
View Replies !
View Related
[MX] Duplicate Movie Clips
I made an ant squashing game where the ant moves left or right and gets squashed by a foot. But when I copy and paste the ant to make copies, they don't move or get squashed, only the original ant works fine. This happens with all my duplicates of anything.
View Replies !
View Related
Duplicate Movie Clips
Hello, I created a rating slider for one of my sites. It uses 4 layers that contain movie clips, masks and some actionscript. Now I need to duplicate all of this 5 times. I tried to select all the objects and create a movie and then duplicate it.. but it screws up.
Is there a way to properly group all these objects and duplicate them ?
Thank you for your time,
Armin
View Replies !
View Related
Help With Duplicate Movie Clips
Howdy. I have just completed this tutorial : http://www.kirupa.com/developer/mx/snow2.htm and I have the snow reversed to go up instead of down (in my case they are balloons) I was wondering, I have the event on say frame 6 of my flash file) but when I jump to the next scene (yes I used scenes I know deprecation issues) the duplicate movie clips keep going. I have tried
removeMovieClip("snow");
in the actions layer on the main timeline, but the (in my case) balloons just keep rising. How do I remove the duplicated movie clips created using this code:
for (k=0; k<7; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}
Earlier in the timeline.
Sorry if this is a basic question but I am tearing y hair out here..I am a bit of a dunce when it comes to invoking AS on timeline frames.
Basically the balloons form part of a preloading sequence I want to end when time has passed or a user presses a skip button. The premise is that the skip button and the timer (built into another movieclip) take the flash file to a frame, which attempts to unload all copies of that movieclip.
Thanks
Roosterboy
View Replies !
View Related
Duplicate Movie Clips
I would like tohave duplicate movie clips appear automatically when an animation loads. I'd gone through the duplicate movie clips tutorial, but it just could not work. Do I need to add more in the Frame besides
Code:
amount = 50;
while(amount>0) {
duplicateMovieClip (target, new mc name, mc depth);
i = i + 1;
amount = amount-1;
}
?
By the way, I'm using flash mx. Please help, thanks.
View Replies !
View Related
Duplicate Movie Clips & XML
I guess this might seem like a simple question, but I've scrambled my brain trying to figure it out, how do i get the it to create a new row after every 5th movieclip :S, so it would create a grid of movie clips, 5 colums, the rows dependant on how many entries in the XML file.
Code:
fscommand("allowscale", "false");
function load_xml(success)
{
if (xmlStuff.loaded)
{
listcount = xmlStuff.childNodes;
InjectData();
AddNumber();
} // end if
} // End of the function
function AddNumber()
{
itemMax = xinfo.length - 1;
itemCounter = 0;
_root.itemThumb = xicon[0];
for (i = 0; i <= itemMax; i++)
{
mload.attachMovie("tabItem", "tabItem" + i, i);
mload["tabItem" + i]._x = 46 * i;
mload["tabItem" + i].itemName = xname[i];
mload["tabItem" + i].itemThumb = xicon[i];
mload["tabItem" + i].itemDesc = xinfo[i];
mload["tabItem" + i].itemLink = xlink[i];
if (i < 9)
{
mload["tabItem" + i].itemNum = "0" + (i + 1);
continue;
} // end if
mload["tabItem" + i].itemNum = i + 1;
} // end of for
} // End of the function
function InjectData()
{
xname = new Array();
xinfo = new Array();
xicon = new Array();
xlink = new Array();
for (k = 0; k <= listcount.length; k++)
{
if (listcount[k].nodename == "item")
{
xname.push(listcount[k].attributes.name.toString());
xicon.push(listcount[k].attributes.icon.toString());
xinfo.push(listcount[k].attributes.info.toString());
xlink.push(listcount[k].attributes.link.toString());
} // end if
} // end of for
} // End of the function
xmlFile = "menu_images.xml";
xmlStuff = new XML();
listcount = new Array();
xmlStuff.load(xmlFile);
xmlStuff.onload = load_xml;
my XML file below, simplified.
HTML Code:
<item
name="Kat"
icon="kat.jpg" ></item>
<item
name="Beauty"
icon="beauty.jpg" ></item>
<item
name="buggy"
icon="hibuggy.jpg" ></item>
<item
name="Issy"
icon="issy.jpg" ></item>
<item
name="file"
icon="file1.jpg" ></item>
Thanks my friends!
View Replies !
View Related
Help With Duplicate Movie Clips
Howdy. I have just completed this tutorial : http://www.kirupa.com/developer/mx/snow2.htm and I have the snow reversed to go up instead of down (in my case they are balloons) I was wondering, I have the event on say frame 6 of my flash file) but when I jump to the next scene (yes I used scenes I know deprecation issues) the duplicate movie clips keep going. I have tried
removeMovieClip("snow");
in the actions layer on the main timeline, but the (in my case) balloons just keep rising. How do I remove the duplicated movie clips created using this code:
for (k=0; k<7; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}
Earlier in the timeline.
Sorry if this is a basic question but I am tearing y hair out here..I am a bit of a dunce when it comes to invoking AS on timeline frames.
Basically the balloons form part of a preloading sequence I want to end when time has passed or a user presses a skip button. The premise is that the skip button and the timer (built into another movieclip) take the flash file to a frame, which attempts to unload all copies of that movieclip.
Thanks
Roosterboy
View Replies !
View Related
Duplicate Movie Clips
I would like to have a movie clip located on level 2 to be duplicated on level 1. Is it possible to do that using the duplicte movie clip action? If not, is there any other way to do this? If yes, what would the exact syntax look like?
Thank you for your help.
View Replies !
View Related
Duplicate Movie Clips Not Showing Up...?
Hey folks,
I've having a brutal time with the duplicateMovieClip function, hopefully someone will know what I'm doing wrong. Basically, I'm trying to duplicate a movie clip X number of times, once I've done that, I can set properties on the new movie clips, and the values will be held in the new clips when I do a trace. The BIG problem... the new movie clips are not visible and I can't figure out why! Here's my code:
j = 0;
for (i=0; i < ANSWERS.length; i++) {
// duplicate the original movie clip
duplicateMovieClip (root_answer, "answer_box"+i, j++);
setProperty ("answer_box"+i, _x, 400);
setProperty ("answer_box"+i, _y, (i*100)+200);
set("answer_box"+i+".anstext", ANSWERS[i]);
trace(i+"- X: "+getProperty("answer_box"+i, _x)+" Y: "+getProperty("answer_box"+i, _y));
}
... the trace at the bottom of the loop proves that the values are being set into the new clips, but still nothing is visible on the screen. Any ideas?
Cheers,
Anthony
View Replies !
View Related
Hiding Duplicate Movie Clips
hello!
i am having trouble hiding duplicate movie clips.
the script hides the original symbols and replaces them with duplicate clips. i want to transition from the frame with the duplicate clips by having the clips slide away. i faked this by creating a different mc with the art sliding away, however i cannot get the duplicated clips to go away and therefore stay on the screen until the next movie loads. and being that the clips are not in the timeline i cannot simply tween them.
i hope this is clear! thanks for any help.
View Replies !
View Related
Duplicate Movie Clips And The Buttons They Contain
I have a script that duplicates a movie clip 8 times.
I n this movie clip there is a button. pon pressing the button I want tot tell the movie clip that contains the button to move to frame 2. sounds simple...
i have tried
on(press){
_parent.gotoAndStop(2);
}
but it dosen't seem to work
also tried
on(press){
_parent.iveBeenClicked = 1;
}
and then looked for the iveBeenClicked var in the AS on the movie clip but it dosen't see it.
I am assuming that I cn send a var to just one instance of the duplicated clip and not all, is that an incorrect assumption?
thanks for the help in advance
-nathan
View Replies !
View Related
How Do I Duplicate Movie Clips With Actionscripting?
I named the original movie clip, named the new movie clip but what do I put in depth? I thought it meant its co-ordinates but apparently it isn't because I'm only supposed to put one number.
Can anybody tell me how to specifically use it (examples would be appreciated).
Also, how do I target a movie clip created through action scripting if there are multiplte ones.
View Replies !
View Related
Positioning Duplicate Movie Clips
Hello. I have a movie clip (horiz_line) which I would like to duplicate 10 times, each resulting movie clip 25 pixels to the right and 5% smaller than the last. This is what I have so far, how do I set the properties? (If it isn't obvious, I've nicked this code from the Flash tutorial- originally the setProperty (s) were "random", which worked...)
amount = 10;
while (amount>0) {
duplicateMovieClip (_root.horiz_line, "mc"+i, i);
setProperty ("mc"+i, _y, ?????????);
setProperty ("mc"+i, _yscale, ?????????);
i++;
amount--;
}
Thank you in advance for your time and consideration.
Adam
View Replies !
View Related
Remove Duplicate Movie Clips
in my movie iv got duplicate movie clips moving around the stage
you click on them and it adds to a score
when the score hits 10 it goes to next scene but the moives are still
playing in the background how do i get ride of them?
View Replies !
View Related
Hit Detection Of Duplicate Movie Clips
Hello all, I am new here and I posted this question on the general flash help and then I found this forum--so I will try reposting here to see if any of you flash experts can help me out. I am using Flash 4 to make games and was wondering if there is another way of doing hit detection for games when you are dealing with 2 different sets of duplicate movie clips (i.e. duplicate bullets detecting duplicate enemies) right now I limit one of the duplicates(i.e. only 5 enemies at once) and every bullet detects if it is hitting each individual clip. Unfortuneately, -ofcourse-- when you have too many clips, the speed of the game gets very slow. I was hoping there was a way to have the bullets hit detection detect any movie clip that started with a common name (clip1, clip2, clip3) so instead of writing hit detection code for ech individual clip, you could right one line that would check if the bullet is hitting any duplicates of a particular clip.
Thanks
Jeff
View Replies !
View Related
Creating Duplicate Movie Clips
my code works to create teh clips becuase when i debug the movie i see the duplicates created in the debug window.
The problem is i dunno the _x and _y position relative to the stage.
fla is attached, have a look and lemme know what ive done wrong.
Tks
View Replies !
View Related
Limit On Duplicate Movie Clips?
I was wondering if there was a limit
on the duplication of mc's. I'm pulling
a dynamic list, and in some cases the
entries may be over 3 or 4 thousand.
If there is a limit, is there a way
around it, or do i have to upgrade
to a more robust app like director?
just checking because i'm going to have
to answer these questions in the next
couple of day.
Thanks everyone,
leon:.
View Replies !
View Related
Say I Have 10 Hidden Duplicate Movie Clips...
Say i have a movie with a layer, and on said layer i have 10 duplicate movie clips of an animation playing, spread out in rows of 5. i.e.:
X X X X X
X X X X X
And i pull in a variable from a simple text file called "Number". And say that number is 5. So i have a variable in the first frame called Number=5
HOW can i take the value of NUMBER and only get that number of animations to play? So i might have 10 hidden movie clips on the stage, but if the value pulled in is 4, how can i get 4 of those hidden movie clips to become visible and start playing? Or if the value is 8, how can i get 8 of the 10 movie clips to become visible and start playing?
Does that make sense?
This is the last piece of a puzzle ive been trying to solve. So if ANYONE could please help me through this, i would appriciate it muchly.
::cliff notes::
have a stage, on stage is 10 hidden movie clips , i pull in a numeric value to a variable in the first frame. Need to know how to only make visible and play the value returned, and leave the rest hidden.
View Replies !
View Related
Duplicate Multiple Movie Clips From Xml
I'm using the duplicateMovieClip command with regard to an xml file. I'm trying to duplicate several clips inside the fla all depending on the number of entries with in the database. I've managed to successfully duplicate the firstchild of the xml file but when it comes to a duplicate movie clip of multiple symbols inside the fla., it only duplicates the last duplicate movie command.
Has anyone encountered a problem like this where the fla will only duplicate one symbol as opposed to several different symbols in the same manner.
heres the code I'm using
museum_xml = new XML();
museum_xml.onLoad = startObjects;
//museum_xml.onLoad = startChurchs;
museum_xml.load("xml/museums.xml");
museum_xml.ignoreWhite = true;
//_root.background.tecg.text = "lkjlkjlk";
function startObjects(success)
{
startMuseums(success);
startChurchs(success);
}
function startMuseums(success) {
if (success == true) {
rootNode = museum_xml.firstChild.firstChild;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
//trace("loop"+i);
museumNode = rootNode.childNodes[i];
nodeName = museumNode.attributes.name;
duplicateMovieClip("_root.background.mainMap.map.p an.start", nodeName, i);
//_root.background.nodeName
x = museumNode.attributes.x;
y = museumNode.attributes.y;
//url = museumNode.attributes.url;
//line2 = museumNode.attributes.line2;
//line3 = museumNode.attributes.line3;
// create new movie clip
// set all properties most importantly name
// make visible
setProperty("_root.background.mainMap.map.pan."+no deName, _x, x);
setProperty("_root.background.mainMap.map.pan."+no deName, _y, y);
setProperty("_root.background.mainMap.map.pan."+no deName, _visible, false);
}
}
}
function showText(museum_name)
{
_root.background.line1.text = museum_name;
rootNode = museum_xml.firstChild.firstChild;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
museumNode = rootNode.childNodes[i];
if (museum_name == museumNode.attributes.name)
{
_root.background.line1.text = museumNode.attributes.line1;
_root.background.line2.text = museumNode.attributes.line2;
_root.background.line3.text = museumNode.attributes.line3;
}
}
}
function clearText()
{
_root.background.line1.text = "";
_root.background.line2.text = "";
_root.background.line3.text = "";
}
function openMuseumURL(museum_name)
{
rootNode = museum_xml.firstChild.firstChild;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
museumNode = rootNode.childNodes[i];
if (museum_name == museumNode.attributes.name)
{
getURL(museumNode.attributes.museum_url, "_blank");
}
}
}
function toggleMuseumVisibility(visibleV) {
//trace("bout to show / hide");
rootNode = museum_xml.firstChild.firstChild;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
museumNode = rootNode.childNodes[i];
nodeName = museumNode.attributes.name;
//trace("showing " + nodeName);
setProperty("_root.background.mainMap.map.pan."+no deName, _visible, visibleV);
}
}
function startChurchs(success) {
if (success == true) {
rootNode = museum_xml.firstChild.firstChild.nextSibling;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
//trace("loop"+i);
churchNode = rootNode.childNodes[i];
nodeName = churchNode.attributes.name;
duplicateMovieClip("_root.background.mainMap.map.p an.church", nodeName, i);
//_root.background.nodeName
x = churchNode.attributes.x;
y = churchNode.attributes.y;
//url = churchNode.attributes.url;
//line2 = churchNode.attributes.line2;
//line3 = churchNode.attributes.line3;
// create new movie clip
// set all properties most importantly name
// make visible
setProperty("_root.background.mainMap.map.pan."+no deName, _x, x);
setProperty("_root.background.mainMap.map.pan."+no deName, _y, y);
setProperty("_root.background.mainMap.map.pan."+no deName, _visible, false);
}
}
}
function showText(church_name)
{
_root.background.line1.text = church_name;
rootNode = museum_xml.firstChild.firstChild.nextSibling;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
churchNode = rootNode.childNodes[i];
if (church_name == churchNode.attributes.name)
{
_root.background.line1.text = churchNode.attributes.line1;
_root.background.line2.text = churchNode.attributes.line2;
_root.background.line3.text = churchNode.attributes.line3;
}
}
}
function openchurchURL(church_name)
{
rootNode = museum_xml.firstChild.firstChild.nextSibling;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
churchNode = rootNode.childNodes[i];
if (church_name == churchNode.attributes.name)
{
getURL(churchNode.attributes.church_url, "_blank");
}
}
}
function togglechurchVisibility(visibleV) {
//trace("bout to show / hide");
rootNode = museum_xml.firstChild.firstChild.nextSibling;
for (var i = 0; i < rootNode.childNodes.length; i++)
{
churchNode = rootNode.childNodes[i];
nodeName = churchNode.attributes.name;
setProperty("_root.background.mainMap.map.pan."+no deName, _visible, visibleV);
}
}
View Replies !
View Related
Duplicate Movie Clips For Multiple MC's
I need to duplicate several MC's (each one x 20) when he movie is loaded.
I can't get it to work for the life of me....
Any ideas?
Thanks
~fit
this code resides in _root.MC and the first frame
================================================== ==
count = 0;
function dup1() {
while (count<20) {
circle.duplicateMovieClip("circle"+count, count);
count++;
}
}
count2 = 0;
function dup2() {
while (count2<20) {
circle2.duplicateMovieClip("circle2"+count2, count2);
count2++;
}
}
dup1();
dup2();
================================================== =
Only duplicates the circle2. If I don't initiate the 2nd func (dup2();...it works for circle...and visa/versa?????????
Can you NOT do duplicate movies for multiple MC's??
View Replies !
View Related
Duplicate Movie Clips... Still Dont Get It
I am trying to do something where different coins (mc's) are dragged onto a table (mc) and as the coins are dragged onto the table , the amount 'variable - penceupdate' updates and the coins duplicate so that anothe coin can also be dragged onto the table aswell..... once the user clicks the ok button i want all the movie clips to be cleared from the table and the pence variable to be reset to 0...
Ok i have a movie clip (with an instance name '50p') i have another movie clip (with an instance name 'wood') and it is supposed to be like when i drag the '50p' mc onto the 'wood' it need to duplicate the '50p' mc and update the variable to the current amount on 'wood'
This is the current code on the '50p' movie clip.....
on (press) {
_global.clones++;
this.duplicateMovieClip("50p"+clones,clones);
startDrag(this);
xloc = this._x;
yloc = this._y;
}
on (release) {
stopDrag();
if (this._droptarget == "/wood") {
// add score
_root.penceupdate = _root.penceupdate+50;
} else {
this.removeMovieClip();
setProperty(this, _x, xloc);
setProperty(this, _y, yloc);
}
//trace(this.duplicateMovieClip("50p"+clones,clones) );
}
but using this code if i click on the duplicated clip one it as been dropped on the stage the clip begins dragging again...so in other words, once i drop the clip onto the 'wood' mc and then go back to that clip and click on it once - it sticks to the mouse cursor and you cant get rid of it....
if youre still unsure of what i am trying to do , I can send you the .fla file if you email me at -
viktajatt (at) hotmail (dot) com
thanks...
View Replies !
View Related
Problem With Duplicate Movie Clips
Hi,
I am trying to duplicate a movie clip several times and put them in a scroll pane. This seems to work for about 10 duplicate movie clips but when I try to duplicate the movie clip 20 times my browser crashes and I get an error saying a script in this movie is causing flash player 7 to run slowly. If it continues your computer may become unresponsive. This is my code:
code:
function createClip(noOfPrescriptions)
{
var i=2;
var noOfCurrentPrescript = noOfPrescriptions;
var amount = noOfCurrentPrescript;
var prev_y;
prev_y=0;
Scroller.setScrollContent("NewRegularPrescription" );
var scrollContent = Scroller.getScrollContent();
while(amount>0)
{
scrollContent.attachMovie("NewRegularPrescription" , "CurrentPrescription"+i, amount);
scrollContent.NewRegularPrescription.duplicateMovi eClip("CurrentPrescription" +i, amount);
scrollContent["CurrentPrescription"+i]._y = prev_y;
//20 is width of movie clips
prev_y = prev_y+20;
i++;
amount--;
}
Scroller.refreshPane();
}
Does anyone know what i'm doing wrong as it's driving me crazy?!
Thanks
View Replies !
View Related
HELP How Do I Make Duplicate Movie Clips Different
Newbie here,
I took a tutorial and created a nice simple custom scrollbar. Now it said at the end of the tutorial i can gather all the elements, create 1 movie clip out of it, then use it multiple times in my own website. So i duplicated the MC renamed each one, even gave then instance names. and put one in my News section & about me section. but when i change the content in the About Me section it changes the other one as well. What am i doing wrong.
Please help.
View Replies !
View Related
HitTesting Duplicate Movie Clips
I'm working on a shooter game in flash. So far I've been successful in implimenting most of my idea. I've been putting aside this hurdle in the hopes that I would just figure it out later on. I have not.
What I want to do is this.
I'm using the duplicatemovieclip(); to make a copy of an existing movie clip on the stage of an enemy.
The player can shoot at these movie clips. So far I can get 1 bullet to hit and the rest of the bullets do not hit. I'm using another duplicate movieclip on the bullet movie clip.
How do I setup a hittest on the enemy that can accepts any duplicate movie clips of the bullet?
-Binx
View Replies !
View Related
Flash Duplicate Movie Clips.
I am trying to create a game where an image appears at random on screen and moves across. Similar to Jetman and Helicopter. I am using the tutorial found here (http://www.actionscript.org/resource...ts/Page1.html). I am able to get the image to appear and move across the screen, once a button is pressed. However, i have realized that if the button is not pressed within a few seconds of the movie loading, the movie clip does not duplicate, which makes my game have a major flaw, ha.
I'd really appreciate any help i could get.
Thanks.
View Replies !
View Related
Duplicate Multiple Movie Clips
I want multiple instances of the f(x) logo on the screen at the same time. What do you suggest?
http://funkshun.us/banner.xhtml
the f(x) logo is name fxfade_mc and there is one instance placed off the stage
// root frame 1
Code:
function fxfade(){
moviename = random(10);
varrotate = random(360);
varscale = random(120)+50;
xlocation = random(530)+30;
ylocation = random(115)-30;
duplicateMovieClip(fxfade_mc, moviename, 0)
};
setInterval(fxfade, 500);
// inside the fxfade_mc movie on frame 1
Code:
this._xscale = _root.varscale;
this._yscale = _root.varscale;
this._x = _root.xlocation;
this._y = _root.ylocation;
this._rotation = _root.varrotate;
// inside the fxfade_mc movie on last frame
Code:
varname = this.name
if(varname != "fxfade_mc"){
this.removeMovieClip();
}
stop();
View Replies !
View Related
Create Duplicate Movie Clips..
What I need is this:
for the user to be able to create a copy of a movie clip (that's in my library) onto the stage when they click a button.. they need to be able to create as many of these movie clips as they want each having it's own input text field and each being dragable.
Sample code?? I found stuff for AS 2.0 but not 3.0
examples of sites that do this type of thing??
Source files?
Please help!
View Replies !
View Related
Remove Duplicate Movie Clips
Follwing is the script I have used for duplicating movieclips:
while (coalcount<2) {
_root.coal.duplicateMovieClip("coall"+coalcount, coalcount);
_root["coall"+coalcount]._x = random(550);
_root["coall"+coalcount]._y = random(500);
coalcount += 1;
}
on time-up it goes to the next scene following the script:
onEnterFrame = function () {
now = getTimer()/1000;
txt = countTotal-now;
p = parseInt(txt);
res = p;
if (p == 0) {
gotoAndPlay("scene 2", 1);
}
};
Th problem is I am not being able to remove the duplicate movieclips. I have tried using the script : _root["coall"+coalcount].removeMovieClip but it doesnot work. Help pls!
View Replies !
View Related
|