ActionScript 2.0 :: Duplicating Movieclips & Placing Them With Equal Spacing?
Nov 10, 2005
how to duplicate a MovieClip 10 times using 'duplicateMovieClip'& place each instance of the new clip with equal spacing when the frame starts.. instance name of my MC on stage i.e. to b duplicated is bt_mc & it is the y position i.e is to b changed.
I am building a horizontal navigation and I am having trouble getting equal spacing between the mc's. Inside the mc's there is a text box that will contain different titles.
Need to make it so when you hit <control> it will place the bullet but if you hit <control> again it will duplicate it instead of moving the bullet from where it was before. I am trying to find a code that I can look at for research but there arent any AS 3.0 scripts or fla files to DL. The bullet does not need to move or anything, just places the bullet.
So I'm adding these movieclips which have textfields inside them and I'm trying to space each new movieclip. Currently they are being placed on top of each other. _taskX and _taskY are variables which I define down there.
Code: public function onClick(event:MouseEvent):void { _taskX = 300; _taskY = 100;
I am a newbie in flash Action script2can anyone please tell me that how can i duplicate a movieclip to as much numbers i want through out the stage using actionscript2. i have searched lots of posts in sites but i can't get it
2 movie clips MC1 and MC2 . MC2 is placed inside MC1. both the movie clips are having rollover effect. the issue is roll over effect is experienced only for the outer movie clip MC1 but no effect when hover through MC2.
Inside one of the mcs I have included a piece of code with the of this forum that allows the user to both click on and drag the mc about the stage. However when the user clicks on the mc I want two things to happen, firstly I want it to position itself in the centre of the stage, already accomplished (with the of the forum - same thread), and I want a number of the other mcs to be positioned around it in a circular pattern. Now I have two main problems with this.. first of all I am using all of the above code inside of a single mc and I am confused as to how I can actually take the other mcs and place them around it, calling it from inside the mc that is, another problem is that I am using an xml file to load data dynamically into the mcs, I am doing this from the main timeline and then as I said before using iterative processes to fill each mc with their relevant data. Inside of this xml file I have a number of items, each having a tag called owner, what I want to happen is for the user to click on the mc in question and then for each mc that is "owned" by the mc in question to then be positioned in a circular pattern around it
How to place movieclips on a scrolling background with AS3? My background scrolls and my character runs when the right arrow key is pressed. But when I tried to place the obstacles he is supposed to jump over, only the first one is visible, and it looks like he's chasing it. My background (Bg) is 3802.8px wide and I put the obstacles and "home" (Cabin) about 600px apart.
var bg:Bg = new Bg(); addChild(bg); bg.y = 280.1; var man: Man = new Man(); addChild(man); [Code] .....
I have 26 letters(english alphabet) into a linkage movieclip(var let:Letter = new Letter() ) and I put a drag and drop function into the mc. My goal is to drag the movieclip leaving the original on its position. The reason why I want to duplicate is that when I spell a word with single vowels on it ex. "word" with single "o" that would have no problem. But when I spell a word ex. "banana" with 3 "a"`s there is where my problem is.
i am trying to populate an MC/text field via XML and the duplicate this underneath itself (in a loop) for how ever many lines of the xml there are.. Ive got quite far *in my humble opnion* but seem to have come unstuck on the looping and duplicating...
My code only duplicates the movieclip once - and the second movieclip is not populated (ie pulling data from the xml) only the first one is!..
Code: function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild;
Currently I have a function that makes a movieclip copied from one specified in the GUI,moves it to a certain point on the stage, then ends. This is called several times to create various patterns etc on the stage.
I am basically trying to duplicate a movieclip by using a button.. (no probs there).however, i want to drag each movie clip individually.. ( my brain froze)here is my butchered code..// graphic is the mc i wanna drag, n is the textfield that i want to count up.
I'm working with a script that loads from an XML some jpgs, these ones once loaded move to their positions.
[Code]....
the problem is that i would like put all these movies well aligned in rows and columns, i've seen it's possible to do this with a nested for.. loop, something like this
if you'll look at [URL] let it load and then click on FASHION. All goes well. Then click on HOME. All goes well. Now click on FASHION again. after you've done each card once duplicate movie clips start popping up, but I've not called any such function. Here's my code.
Code: import mx.transitions.Tween; import mx.transitions.easing.*; if (_root.nextCard == "Home") {
I have a movieClip(contentMC) that contains numerous movieClips for my site. I have set the color matrix of contentMC to be black & white. This works fine by itself but once I start duplicating and populating movieClips inside 'contentMC' the color matrix settings are lost.
[Code]...
I've even tried to populate the content and THEN turn it B/W thinking that it would be better to convert the contentMC to BW after it was done building itself. This didn't work either. So I started to comment out code until the color matrix settings would stick and this line of code is the killer but unfortunately is essential to rendering the site. contentSC.samplesMC.sample._y = contentSC.samplesMC.sample._y+621; (this line offsets a duplicated movieClip)
I have a question about movie clips. I have about 20 MC-s in my flash. Is it possible for me to duplicate one of them multiple times in specific location? I mean if I have button that says "DOG" and I press it, then new dog appears on screen. And I need to do it for like ten times or so
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{ var id:int; var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
i've started to make like a quiz in flash with 218 questions in it! i've made it so the computer will show X amount of random questions.i've already got the code on the buttons so it will jump to a random question, but i'm having trouble with limiting the number of questions asked.
i've got an inputbox so the user can chose how many questions they do and the buttons add 1 each time thier pressed to a different variable.
i've got this code, but it never seems to stop asking questions
on (release) { score = score+0; page = page+1 if( (page == pagemax) ) GotoAndStop(220) if( (page != pagemax) ) myVariable = random(219); //creates a random number between 0 and 5 if (myVariable < 2){ //checks to see if it's value is zero myVariable = 2; //set it to 1 if it is zero } gotoAndStop(myVariable); //goes to and plays the frame. }
I have a couple of mc's that are added to the stage after one another.I want them to have equal space between them.Here i the code snippet with the problem, below is the full code.
Code: for each (var link:XML in settingsXML.links.link) { i++; newsItem = new NewsItem(); newsItem.menuLabel.text = link.@name;
What's the best way to sort an array while making sure that elements of equal value stay in the same position?
When I do something like this:
var i:uint; var myArray:Array = new Array(); myArray.push({num:1, type:0});
[Code].....
The objects that have equal num values swap places everytime I do a sort. So how do I get the sort to not swap the positions of objects that have the same value?
Then how do I make it so all the children added are equal distance apart? I know I can set the X coordinates for each one,but I want it so that the objects can be added in any sequence and then be set to equal distance apart.
If I want a a random number not to be equal to a number in an array so that the random number dose not repeat itself.Or if can't be done with an array how would you get a random number to randomly generate numbers but not repeating itself?