Duplicate Movieclip With Xml Data
im in a bit of bother with flash and was hopinh you could help me out,i got this bit of code that gets information from an XML file and loads into a movie clip in flash, this clip is then duplicated to display other records from the XML, but it work wont. im working in AS 2
this is the code
myXML = new XML(); myXML.ignoreWhite = true; myXML.onLoad = function(){ imageList = this.firstChild.childNodes; showImages(imageList); } myXML.load("gallery1.xml");
function showImages(list:Array){
for(i=0;i<list.length;i++){ imageFile = list[i].attributes.url; nametxt = list[i].attributes.title; phonetxt = list[i].attributes.phone; yval = list[i].attributes.yval; xval = list[i].attributes.xval;
info.duplicateMovieClip("info_"+i, i+1); on this line is the variable ' i ' info.name_txt.text = nametxt; ------ what i need to do is add the variable i to this instance name, making it info_1 then info_2 etc.. info.address_txt.text = address; simply adding it, eg info+i doesnt seem to work info.phone_txt.text = phonetxt;
info.picture.loadMovie(imageFile); info._x = xval; info._y = yval; trace(nametxt);
} }
Thanks
Geraint.
FlashKit > Flash Help > Flash General Help
Posted on: 05-20-2008, 12:23 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Duplicate Movieclip, Drag Duplicate, Leave Original Behind
Hello all,
I have been searching frantically for an answer to this. I know it has to be easy....
I want to duplicate a movieclip on press and also drag the duplicate, leaving the original behind. I've attached a sample of what I'm doing. Does anyone have any ideas? Is there a way to target the duplicated movieclip to drag that? And leave the original in it's original location?
Any help, guidance, nudging would be greatly appreciated. I've been trying to figure this out for hours.
Thanks,
jessicuh
Unable To Select Previous Movieclip After Duplicate Movieclip
i have a movieClip and was able to duplicate the movieClip. But now the problem is, after i have duplicated the movieClip i cannot select the previous movieclip which don allow me to move it around. Is there anyway that will allow me to select my previous movieclip after duplicated?
Below is my code:
Attach Code
var mySelection = "";
wire.onPress = function ()
{
this.createEmptyMovieClip("mc1", 90);
duplicate(mc1);
mc1 = attachMovie("idwire", "wire1", 91);
mc1._x = 273;
mc1._y = 196.5;
dragging(mc1);
}
function dragging(mc)
{
mc.onPress = function()
{
this.startDrag(true);
mySelection = this;
}
mc.onRelease = mc.onReleaseOutside = function()
{
stopDrag();
}
}
function duplicate(mc)
{
amount = 50;
while(amount>0)
{
mc.duplicateMovieClip ("mc"+i, i);
i++;
amount--;
}
}
Merging Duplicate Data In An Array
I am parsing data from an xml file into an array within my flash file. The nodes within the xml file have common data between them. What I am attempting to do is dynamically push the data in the array without duplicating data already contained in the array. For example I may have an xml file that looks like this:
Quote:
<videos>
<video>
<title>video1</title>
<thumb>file1.jpg</thumb>
<group>group1</group>
</video>
<video>
<title>video2</title>
<thumb>file2.jpg</thumb>
<group>group2</group>
</video>
<video>
<title>video3</title>
<thumb>file3.jpg</thumb>
<group>group1</group>
</video>
</videos>
Say I want to push the "group" data into an array. When it gets to the third "video" node I want the array to see that "group1" already exists so instead of pushing a second reference of it into the array to actually push the secondary data ("title" and "thumb"> into a new array for "group1". I will later use that array to pull up a list of "group1" videos. Any thoughts or ideas? Anything would be huge - I have been banging my head against the wall with google searches.
Duplicate/loading MC Problem Using XML Data - Im About To Pull My Hair Out
I am about to pull my hair out over this. Been looking at this code for weeks and I just can't figure this last part out. I'm very close!
I have a gallery that is being loaded via XML. Thumbnails are loaded and when you click on one of the thumbnails a larger image loads in a mc above and a second image loads in a mc below. Almost everything in the gallery works fine, except I cannot get the second image that is supposed to load below to load in the data from the XML when the thumbnail from the menu is clicked on. Right now it will only load in the first image and if I click on any other images I just receive the error "error opening URL file...undefined"
I have checked my XML for errors, but everything looks good so the problem has to be in the code. This is my first workings with XML and I am still trying to wrap my head around how some of this works.
Would someone be willing to take a look at the code and see if they can spot what my problem is? I've attached both my XML and my .fla to this post. Also, I know my code is a mess as I have been messing with it for so long so my apologies.
Frame 1 code:
[code]//Load XML Data function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; large = []; txt = []; PSphoto = []; total = xmlNode.childNodes.length; for (i=0; i
Fading Duplicate Movie Clips Created During .php Data Load
Hello,
I have a flash file that is recursively getting data from the web to display nodes.
ActionScript Code:
myLoadVars = new LoadVars();
myLoadVars.load("http://pwd.ca/yusef2.php");
myLoadVars.onLoad = function (success){
if (success) {
dataarray = myLoadVars["dataarray"];
locationarray = myLoadVars["locationarray"];
idARRAY = dataarray.split("|");
idLOCATION = locationarray.split("|");
}
}
Once the data is loaded if have another AS seperating them into there different locations on the _root flash movie stage.
ActionScript Code:
// these number give them a range of space to appear near an area of the flash stage
minNum = 30;
maxNum = 80;
// checking location from loaded array and assigning a position on the stage
for (i=0; i<idARRAY.length; i++) {
var locc = Number(idLOCATION[i]);
if (locc == 1) {
theXX = getProperty("one", _x);
theYY = getProperty("one", _y);
rndNum = Math.ceil(Math.random() * (maxNum - minNum + 1)) + (minNum - 1);
} else if (locc == 2) {
theXX = getProperty("two", _x);
theYY = getProperty("two", _y);
rndNum = Math.ceil(Math.random() * (maxNum - minNum + 1)) + (minNum - 1);
} else if (locc == 3) {
theXX = getProperty("three", _x);
theYY = getProperty("three", _y);
rndNum = Math.ceil(Math.random() * (maxNum - minNum + 1)) + (minNum - 1);
} else (locc == 4) {
theXX = getProperty("four", _x);
theYY = getProperty("four", _y);
rndNum = Math.ceil(Math.random() * (maxNum - minNum + 1)) + (minNum - 1);
}
// if the node id doesn't exist create a new one at its proper location else set its _alpha back to 100
if (getProperty("node"+idARRAY[i]+"-"+idLOCATION[i],_x) == undefined) {
duplicateMovieClip("node", "node"+idARRAY[i]+"-"+idLOCATION[i], i);
// assign an idNumber to be displayed with node
idNumber = ("node", "node"+idARRAY[i]+"-"+idLOCATION[i]);
setProperty("node"+idARRAY[i]+"-"+idLOCATION[i], _x, Math.ceil(theXX-50)+rndNum);
setProperty("node"+idARRAY[i]+"-"+idLOCATION[i], _y, Math.ceil(theYY-50)+rndNum);
} else {
// if it still exists set the _alpha of the faded clip back to 100
setProperty("node"+idARRAY[i]+"-"+idLOCATION[i], _alpha, "100");
}
}
the original "node" mc has this code attached:
ActionScript Code:
onClipEvent (load) {
// Fades MovieClip clip to target_alpha in duration seconds.
//The fade happens in finite steps, one each step seconds.
function fade_mc(clip:MovieClip, target_alpha:Number, duration:Number, step:Number) {
// Find out how much we need to fade each step
var num_fades = Math.floor(duration/step);
var fade_amnt = (clip._alpha-target_alpha)/num_fades;
// This function will do the fade, or clear the interval if we're finished.
var fade_function = function (amount:Number) {
if (clip._alpha>target_alpha) {
clip._alpha -= amount;
} else {
clearInterval(fade_interval);
}
};
// setInterval will call the fade_function every step*1000 mS.
var fade_interval = setInterval(fade_function, step*1000, fade_amnt);
}
fade_mc("node", "node"+idARRAY[i]+"-"+idLOCATION[i], 0, 120, 15 );
}
now here in lies the problem. i'm trying to make the original clip a smart object so that it will name itself assign the idNumber to itself and display that in the the text field that is part of the mc. I am also trying to fade the clip to 0 over time then I want to delete that clip from the stage. Hopefully this is clear.
Thanks,
the littlest engineer that could
>> file attached
[MX04] Duplicate Dynamic Movieclip Into Another Dynamic Movieclip...doesn't Work?
I've got a problem when I try to copy some movieclips into other movie clips.
With some code I loop trough a XML file and create a dynamic movieclip mcItemI.
Within the loop to create this mcItemI is another loop that duplicates mcSubItemK into mcItemI.
The problem is, that this isn't working right.
Duplicating mcItemI works fine, but when I duplicate mcSubItemK, I see that they are duplicated, because the appear somewhere on the screen.
I want to set the properties of this mcSubItemK but it doesnt work...
this is the code i use:
Code:
for (I=0; I<varTotalItems; I++) {
mcItemX.duplicateMovieClip("mcItem"+I, ItemDepth+100);
_root["mcItem"+I]._y = ItemPosY;
//Hoog de volgende positie en depth op
ItemPosY += 21;
ItemDepth += 1;
if (varSubItemAantal > 0){
SubItemY = ItemPosY + 9;
SubItemX = 3;
varSubItemParent = _root["mcItem"+I]._name;
for (K=0; K < varSubItemAantal; K++){
mcSubItemX.duplicateMovieClip(_root["mcItem"+I]["mcSubItem"+I+"_"+K], ItemDepth);
_root["mcSubItem"+I+"_"+K]._y = SubItemY;
_root["mcSubItem"+I+"_"+K]._x = SubItemX;
ItemDepth += 1;
SubItemY += 20;
varSubItemParent = _root["mcSubItem"+I+"_"+K]._name;
}
}
}
}
}
Duplicate Movieclip
I'm just wondering: when you duplicate a movieclip, does it duplicate all of the movieclips inside of the duplicated movie clips with the actions attached, too? It doesn't seem to duplicate the actions on the movieclips inside the duplicated movie clips in a game I am working on.
How would I go about getting this to work?
Help With Duplicate Movieclip
Hi
I am an intermediate in flash actionscript i'll really appreciate your help
I wanted to know if i use this.attachMovieClip("_root.a","d",1)
What would be the path of the new movie
One more thing
can u guys expain how to use
getBounds()and setBounds()
thanks a lot for readin my query
keep flashing
[Edited by harnoors on 08-23-2002 at 03:28 AM]
Duplicate Movieclip
I want to duplicate my mc 60 time, one after one on left direction. mc----mc-----mc------mc-----mc on X axel and he have interval of 10 frame on each.
thank you for help me
Duplicate Movieclip
does anyone have the code to duplicate a movieclip within a scrollable pane with each movieclip having a different id so that it can pull through its own information.
cheers.
Duplicate Movieclip
does anyone have the code to duplicate a movieclip within a scrollable pane with each movieclip having a different id so that it can pull through its own information.
cheers.
Duplicate Movieclip, And A Lil More
basically, i have a panoramic piece that i need to well... look panoramic, i have made one of these before and i basically had a single movie clip jump to a certain spot after it reached a certain location, so it looked like it was continiously moving. the problem with this is that i had to set it up like this >> image1:image2:image3:image1 << and this time its for a banner ( inwhich file size is of great concern) and i dont want to add a second "image1".. OK OK so.. I would like to make the movie clip duplicate itself, and locate itself in a certain place, and then have the original movie clip reomve itself once the original clip has reached a certain spot. does this make sence? am i on the right track? good idea bad idea?., i think it should work but im havin problems getting started.
sorry so long, but thanks alot
josh
Duplicate Movieclip
Can someone tell me how i can duplicate a moevieclip that has been used for masking an object? thanks
Duplicate Movieclip
Hi, i am trying to make a photoalbum, where you just have to add the images in the directory of the swf. I know i have to do this with loadMovie, and that's not the problem.
But i want to make thumbnails of al the images on the bottom of the movie. So if i have 5 images, there should be 5 duplictes of the movieclip. But how do i load a "next" image in ech duplicate??
I've tried many thing, but i don't find it?
anyone to help me?? THANKS!!
Duplicate MovieClip
Hello friends
How can I make a flower type of shape using Duplicatemovieclip.
I have attached a sample of what I want but I have done the animation using frame by frame.
I want to create a same sort of animation using Duplicatemovieclip.
Please help me
Duplicate MovieClip
I have a movieClip with instance name "mc1". I just want to duplicate the movie using duplicateMovieClip command.
I also have some actions to perform to the duplicated movie. How should I name the new MovieClip. I want to name the new MovieClip to "mc2" and the next to "mc3" and so on.
Please help me with this.
Duplicate MovieClip
I have a movieClip with instance name "mc1". I just want to duplicate the movie using duplicateMovieClip command.
I also have some actions to perform to the duplicated movie. How should I name the new MovieClip. I want to name the new MovieClip to "mc2" and the next to "mc3" and so on.
Please help me with this.
Duplicate MovieClip
Hi!
I got a little problem - I'm going to duplicate movieclips and movie each movieclip to a spesific frame (in their timeline).
Here is my script:
-------------------------------------------------------
amount = 5;
framemc1 = 20;
framemc2 = 40;
framemc3 = 50;
framemc4 = 60;
framemc5 = 80;
while (amount>0) {
duplicateMovieClip (_root.mc, "mc"+i, i);
with (_root."mc"+i) {
gotoAndStop("framemc"+i);
}
i++;
amount--;
}
-------------------------------------------------------
Here are two errors I need help on:
1. with (_root."mc"+i) - flash cant find this movieclip...
2. gotoAndShop("framemc"+i) - is dosent use the variable witch is set in the beginning of the script.
Duplicate MovieClip
When I make duplicates, it redraws them over everything else. I put the movie clip I want infront on a different layer above the duplicates, but they still appear on top of the movie clip I want on top. What can I do to keep duplicates to stay behind my movieclip?
So If You Duplicate A Movieclip...
Hey All,
If you duplicate a movieclip as such....
for(a=0; a < photoThemes.length; a++){
_root.dupClip.duplicateMovieClip("dupClip" + a, a);
_root["dupClip" + a]._x = _root["dupClip" + a]._x + a*13;
}
You'll get instance names as such......
dupClip1
dupClip2
dupClip3
dupClip4
dupClip5
correct?
Within those clips how do you reference their own value of "a"?
this[a]?
-jub-
Duplicate Movieclip Help Me
Hi Everyone,
I'm using flash 5. I'm making a simple "building blocks" game which involves having a set of pieces which you can drag onto a "canvas".
I can do the dragging and dropping bit fine.
What I need to know is how to make the movie clip stay in its place and a new one drag from it evertime you want to drag that piece onto the canvas. I think it must be the duplicate movie clip command but i can't get it to work properley!
Please Help!
Dom
How To Duplicate MovieClip In AS3?
hi,
i have movieClip on stage with name ==>> myStar
i do not know how to duplicate that movieClip ?
i am trying
Code:
var myStarContainor:Sprite = new Sprite();
myStarContainor.addChild(myStar1);
myStarContainor.addChild(myStar2);
myStar1.x=100;
myStar2.y=100;
but i do not get any thing .. please .. how to use it correctly?
How Do I Duplicate A MovieClip?
Hi, and WAIT DON'T JUST COPY AND PASTE A LINK TO senocular's method because I have no idea how Document Classes work I've just been putting the code on the first frame just like always.
My problem is that I have a a MovieClip in my library with Linkage name "pickup" that I want to duplicate and create new instances of randomly all over the stage 10 times.
Also how do I know unload.MovieClips and why is it when I refer to stage.width or height it alsways comes out wrong.
PHP Code:
var LIMIT:Number = 9;
for(i=0;i>LIMIT;i++){
var DUPE+i:MovieClip = new pickup;
addChild(DUPE+i);
}
Duplicate MovieClip... I Know... Again...
Sorry to ask another question about duplicating MC, I researched, but couldn't find an answer to my problem.... So I'll explain, and hopefully, one of you gurus can enlighten me...
So what I've got, is a site. You press button2 it goes to label2, plays a few frames and stops, you press button4, it goes to label4, plays a few frame before stopping... You get the idea...
Now on label2, I load a MC (MC2), which is an image fading in, then stops. If I go on label4, I load MC4, and I want this MC to appear IN FRONT of anything else (the previously loaded MC2), so that my image fading in, actually fades in front of the previously loaded MC...
Now, I can't get it to work.... Here's some code I've tried:
This code below works everytime, but the previous loaded MC disappears before the loading MC actually loads, so it fades in on a white background... And I would like it to load on top of the previous MC
ActionScript Code:
_root.createEmptyMovieClip("container1", _root.getNextHighestDepth());
_root.container1.loadMovie('image_localisation.swf');
When I try the code below, it doesn't load the 2nd or 3rd tie around...
ActionScript Code:
_root.createEmptyMovieClip("container1", i);
_root.container1.loadMovie('image_localisation.swf');
_root.i++;
Do you know of any way how to achieve that..??? Many thanks...
Duplicate MovieClip
Hi
can any body say the script required to duplicate a movie Clip many Number of times say for 10 times
that is a movie clip should be duplicated and i should get some 10 movie clips any all the movieclips should in different places
if any know the script plz say
bye
Duplicate MovieClip
Hi i habe this http://www.viewtv.co.uk/demo where i have made a movie with a few movieclips in with details of shows. Then i put some code in so that it detects the day and time and then wizzes down to the correct show.
But after doing on i soon found that 999 of these was gonna be a mission, so i need to know is there a way of using asp or another scripting language to input the details and images into a db and then for flash to pull them back in by duplicate movie clip????? the thing is that each schedule will have a different number of shows (movie clips).
This is really hard for me but i know some one out there is well clever
please help or point me in the right direction.
How To Duplicate A Movieclip?
I ask this because it seems that the method "duplicateMovieClip" ""duplicates"" a clip without everythink that is inside! It seems to me that "duplicateMovieClip" has the same effect that "createEmptyMovieClip"
Someboby has a solution to duplicate a movieClip?
My purpose is the following: create a clip with some image inside, and then split the image into several pieces, say rectangular.
So with actionscript I intended to create and fill the clip with the image, then dulicate several times the clip (which will be several pieces), and mask the several duplicated clips with a rectangular mask, so that all the duplicated masked clips reconstitute the original image, and finally move these different clips in order to slip the image in different pieces.
But my problem is that I don't know how to duplicate a clip with all that is inside!!
Duplicate MovieClip
Hey, gotta question...
I have a set of movieclips that I want to duplicate.. but have each of them have their own instance name.. how can I do that?
I've tried doing copy/paste, but after I set unique instance names, they still act like the originals... I can do it the hard way, creating a cuplication of each one of them, but its alot.. so yea I thought theres gotta be a faster way.. any help?
thanks
Duplicate Movieclip
Hello.
I need help to duplicate a movieclip in flash. I have a movieclip which I can drag and drop to make a composition. What I want is this: I have an object (a circle) which is a movieclip. As I press the movieclip to drag it, I want to duplicate that same movieclip in the exactly same place, so I can use as many objects as I want without influencing the others I have already moved..
I have looked for help in other forums but none explains this as I want.
Thanks!
kate
Duplicate Movieclip
Okay guys/gals, I have been dealing with this for longer than I even want to think about.... I have looked around and can't find a solution to my problem or at least I can't get those solutions to work in my problem. It seems that questions around galleries come up a lot, after looking through a ton of them I have yet to get a solution.
Anyways, what I want to do is load an image and scale it down to create a thumbnail (done), then I want to reference that image so that when the user clicks on the thumbnail it shows the full size version of it.
The images are being loaded in dynamically, don't know if that matters or not.
I feel like I am so close to doing this but it's not working out.... I am going to flip out, I get the feeling it's something so simple..... arrggghhh....
thank you in advance for any help
Help With The New Duplicate Movieclip.
ok... we have some down time at work..
i've decided to build the company's new website.
and i've decided to do it in actionscript 3.0.
i'm getting used to certain things but i'm stuck on something.
my sections in this site are moving transitioning by moving up and down.
i have a specific section with duplicated clips as thumbnail navs.
i'm using this.
-----------------------------
var web_thumb_holder:MovieClip = new MovieClip();
this.addChild(web_thumb_holder);
web_thumb_holder.x = 0;
web_thumb_holder.y = 50;
for(var i = 0;i < 6; i++){
var thumb:MovieClip = new web_thumb();
thumb.x = thumb.width * i;
web_thumb_holder.addChild(thumb);
thumb.name = "thumb"+i;
}
------------------------------
ever since i started using this, the specific section dosn't move correctly...
sometimes if, when i click, i hold my mouse down, the section moves correctly....
i've narrowed it down to the for{ } portion as the culprit...
any ideas?
i'm stumped.
oooorrrrr...
any better ways of duplicating clips, ideally with arrays????
thanks.
Duplicate Movieclip ?
If I have a movie clip with action scripts in it, and I duplicate the movie using the duplicate movie property, do my action scripts get duplicated to? If not, what do I need to do to ensure that they get duplicated?
Duplicate Movieclip
hi,
i'm using the following funtion to duplicate a movie clip. i'm calling this function several time in the movie, but at the moment each time i call it, it duplicates fine but replaces the previous duplicate while doing it. i suspect it has to do with either the new movie clip name or the depth? if so, could somebody help me out with a work around?
script:
function printGeneric() {
duplicateMovieClip(genericPrinter_mc.photoMaskGeneric_mc, "newPhoto_mc", this.getNextHighestDepth());
}
thanks a lot,
ponch
Duplicate MovieClip
Hi, Could any body help me.. how to create Duplicate MovieClip if one is already on stage.
Suppose i have a_mc MovieClip in Stage and i want same One as duplicate then how to create with a_mc a new MovieClip()???
Duplicate Movieclip
i have a sqaure movieclip...
name: blockBefore
instance: BLOCKbefore
size: 20x20
my canvas is 400px wide..
im tryin to duplicate BLOCKbefore 20times along the top of my canvas...
i have the first one at 0,0 (top left corner)..
i want to know y this code dose not work...
if anybosy knows..
ActionScript Code:
onClipEvent (load) { amount = 20; while(amount>0){ duplicateMovieClip(BLOCKbefore, "BLOCKbefore"+i,i); <b>_root.BLOCKbefore+i._x</b> = _root.BLOCKbefore+(x-1)._x + 10; i=i+1; amount=amount-1; }}
i keep getting an error here any ideas of wats wrong with this code.. or of a better way to do it would be really hopeful...
Duplicate Movieclip
I have created a button...
how would I script and apply the script to make the button duplicate through the duplicate movieclip action?
Duplicate Movieclip Help
I have a movieclip with text linked to an Xml and I need a function to duplicate that movieClip. I need a number of clips equal to the Xml's tags (but I have that function done, so nevermind)
I need the part of the function wich changes the default movieclip in order to load de next Xml node too.
This is the part of the code wich loads Xml node values to dynamic text objects.
Code:
avatar.loadMovie(image[0], 1);
nom.text = nombre[0];
pers.text = personajes[0];
nomPers.text = nombrePersonaje[0];
nomPers2.text = nombrePersonaje2[0];
razaPers.text = raza[0];
jobsPers.text = jobs[0];
Those zeros must change when the moviclip is duplicated
This is a code I've done, but I know I'm missing something. I't doesn't works at all
Code:
function duplicarClips() {
function loadXML(loaded) {
if (loaded) {
this.cargado.text = "Cargado!";
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
amount = total;
while (amount>0) {
duplicateMovieClip(this.miembro, "miembro"+1, i);
i = i+1;
amount = amount-1;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("miembros.xml");
}
}
Duplicate MovieClip
ok i have a game where you play as the mouse, well you think it is the mouse until you get hit and strage things happen to the mouse (like it starts deforming and stuff) well these circle are supposed to come up and here are the objects i want it to do
1.there can only be 3 circle on at once
2.if it hits the mouse the mouse goes to frame 2
3. if _y is < 0 remove it
should i use the duplicate movie method or just have 3 seperate movieclips?
Duplicate Movieclip Help Plz
Im trying to make it to where I click a button and it takes a movie clip from my libraire and places in the center.
I have tried using the duplicate movieclip function but it won't work right.
how do I do this?
Duplicate Movieclip
i have a sqaure movieclip...
name: blockBefore
instance: BLOCKbefore
size: 20x20
my canvas is 400px wide..
im tryin to duplicate BLOCKbefore 20times along the top of my canvas...
i have the first one at 0,0 (top left corner)..
i want to know y this code dose not work...
if anybosy knows..
ActionScript Code:
onClipEvent (load) { amount = 20; while(amount>0){ duplicateMovieClip(BLOCKbefore, "BLOCKbefore"+i,i); <b>_root.BLOCKbefore+i._x</b> = _root.BLOCKbefore+(x-1)._x + 10; i=i+1; amount=amount-1; }}
i keep getting an error here any ideas of wats wrong with this code.. or of a better way to do it would be really hopeful...
Duplicate MovieClip
how can i duplicate the same mc when i release mousebutton. the mc should load on top of the old mc. Like a deck of cards. With at slighty random position in AS3.
Please help.
Duplicate MovieClip
i need to duplicate a movie that displays a single character so when i duplicate it, it animates all characters in a string individually. can someone please help me with this? thanks!
How To Get An Id Into A Duplicate Movieclip
hi there
i've got a small problem,
i'm creating buttons with duplicate movieclip
but when i use a onPress function i can't send my id with it.
Can someone help me please, i'm stuck
See my script below
Code:
var total = this.aantal_news;
for (i=0; i<total; i++) {
if(old_y==undefined){
old_y=0;
}
duplicateMovieClip(_root.nieuws.txtMC, "txtMC"+i, i);
_root.nieuws["txtMC"+i].news_item.styleSheet = Style;
_root.nieuws["txtMC"+i].news_item.autoSize=true;
_root.nieuws["txtMC"+i].news_item.htmlText = this["message"+i];
trace("***********************")
trace("1: i="+i)
trace("ID:"+this["id"+i])
//HERE i've got my ID
trace("***********************")
_root.nieuws["txtMC"+i].news_item._y = old_y+20
old_y=old_y+_root.nieuws["txtMC"+i].news_item._height;
_root.nieuws.gotoAndPlay(2);
//With this i get my i into my onPress
_root.nieuws["txtMC"+i].i = i;
_root.nieuws["txtMC"+i].onPress = function() {
// NOW HERE IS WHERE I NEED MY ID AGAIN
// but can't get id inhere
_root.nieuws.gotoAndPlay(10);
ItemData1 = new LoadVars();
ItemData1.onLoad = function(){
Style = new TextField.StyleSheet();
Style.load("style.css");
_root.nieuws.news_items1.styleSheet = Style;
_root.nieuws.news_items1.autoSize=true;
_root.nieuws.news_items1.htmlText = this.message;
trace(_global.base_url+"news.php?r=" + random(999)+"&id="+ids)
};
ItemData1.load(_global.base_url+"news.php?r=" + random(999)+"&id="+this[id+this.i]);
}
}
Duplicate And Remove MovieClip
I've a Movieclip(text) and asign this to it
>onClipEvent(load){
> i=0;
>}
>onClipEvent(enterFrame){
>i++;
>duplicateMovieClip("text", "text" +i, i);
>_root["text"+i]._x=this._x+Math.random()*20;
>_root["text"+i]._alpha=Math.random()*60;
>removeMovieClip(_root["text" +(i-2)]);
>}
When I load the Movie, I can't see any duplicated MovieClip, pls tell me if you know where the problem is
Loadmovie Into A Movieclip Then Duplicate It?
hi everyone there,
i have a question about loading a swf into a targeted movieclip and then duplicate it, but it dosen't seem to work! i wonder if this is possible!!
thanx in advance!!
|