ActionScript 2.0 :: Move Attached Movie Clips?
Oct 27, 2008
I am trying to move attached movie clips, but I've come across a problem. This is the code inside the movie clip that's attached:
ActionScript Code:
function moveFrom(which){
for (i=which;i<20;i++){
[code]....
View 9 Replies
Similar Posts:
Jun 5, 2011
As most of you don't know, I've been creating an rpg game. And, after several tries of art making, etc, I have finally moved back into coding the game. And now, I'm stuck on the equipment system idea. At first, I thought I would just place a bunch of goToAndStop's for each movie clip to go to a frame that has that certain armor piece. This was my first idea for an equipment system. However, after doing some research, and realizing how much lines of code could be saved, I started looking into simply adding and removing movie clips from the character as my new equipment system idea. Now.... on to the problem.
Basic want/ overall achievement wanted: Create an equipment system, which will basically attach movie clips (items) onto characters, which themselves will already be attached movie clips on the stage.
Problem: What is the exact code to do this? And Is there a better way to do this for an equipment system (a less laggy or more efficient way perhaps that I'm not seeing; Check the code below to get a better idea of what I'm talking about)?
Part of the code (or basic idea of code; see comments for extra details
code:
//Don't worry I have an OnEnterFrame function here;
//attachedObj= the character; figure= the MC name of the character;
attachedObj = attachMovie("figure", "figure"+1, 1);
[Code].....
View 2 Replies
Dec 13, 2005
I'm having trouble figuring out how to target a series of movie clips i'm attaching to my movie.I'm loading some xml for a slideshow and i'm generating a series of dots at the bottom of the screen to indicate how many steps are in the slideshow and the circle is meant to highlight your current position as you step through the presentation.the MC for the dots is two keyframes with a different color and a stop action on each frame.
Here's the rundown of the code:
1. There's nothing weird here, i'm just bringing the xml in [code]
2. Here is the loadXML function i reference in the xml.Data.onLoad above:[code]Okay so now i have some dots with the instance names, step0, step1 etc. right? And at the end of my loadXML function you see the firstImage(); function. This is where my problem is, how do i target the first (step0) instance? I have no problem when I write "step0.gotoAndStop(2);" but I need to figure out how to use a variable to keep moving it along when i make my next and last functions for the slideshow.
3. Here is the firstImage function:[code]how do i target the step the same way i target the image? do i have to go back and do something in the loadXML for loop?[code]
View 2 Replies
Nov 13, 2006
is there a cleaner way to attach movie clips than this type of syntax?
_root.attachMovie ("Frame", "frame", 60);
frame._x = 375;
frame._y = 375;
[code].....
View 2 Replies
Nov 27, 2009
I would like to have one movieclip over the top of other attached ones. I have tried getNextHighestDepth on the movieclip, but it still doesn't work. Here is my code for attaching the movieclips:
PHP Code:
function growSpider() {
spiders = 0;
[code].....
View 1 Replies
Nov 16, 2009
I have a button that has an onPress function that attaches a movieclip with startDrag(true) so the attached movie snaps to the mouse and can be dragged around. The problem is that I don't know how to set up the onRelease function so that when the mouse button is lifted the attached movieclip is removed. Also, the attached movie appears in the upper left corner for just an instant before snapping to the mouse.
View 9 Replies
Oct 15, 2009
I would like to attach (using A3) a movie clip to a draggable movie clip. I has set up a movie clip using startDrag() all works fine. But I would like to be able to dynamically place a movie clip inside it so that it too drags. Ive got it to partly work you can drag the original movie clip around and the attached movie clip (using aadChild) moves too. But if I grab the attached movie clip instead of the original clip it moves independently.
Is there a way of getting a movie clip inside the draggable movie clip and have it fixed in place and not move if you happen to attempt to drag it.
View 6 Replies
Nov 19, 2009
have two sets of movie clips. I'm communicating to these movie clips with another program via binary sockets. For the first set of movie clips: when it recieves its instance name, and a second number (InstanceName+#) from the socket, the named movie clip will jump to the frame corresponding with that number. for ex: if the incoming data from the socket is (mc7+3), then movieclip 7 will jump to frame 3.
For the second set of movie clips: when it recieves its instance name, and a second number (InstanceName+#) from the socket, the named movie clip will move location across the screen, by the y coordinate moving to the # given by the socket...thats a little confusing. for ex: if the incoming data from the socket is (mc4+500), then movieclip 4 will move so that it's y coordinate is at 500.
Here is my code:
Code:
var socketBuffer:String = "";
s.addEventListener(ProgressEvent.SOCKET_DATA, onDATA);
function onDATA(e:ProgressEvent):void{
[Code]....
i got rid of some errors. the first part is working where the movie clips jump to the frame they are told to so no errors there. but when i try to move the movie clips in reference to the FADER array, (along the y axis) nothing happens. (look at bold part of code)
theres also another method i'm willing to approach but i'm not sure how to go about it. rahter than using the FADER array, I would rewrite the code for each individual movie clip, so that it says "if incomign data names a movie clip and gives a number, change the named movie clip's y coordinate to the incoming number"
View 9 Replies
Jul 24, 2009
I just finished animating something, but I don't like how large it is, and I want to resize it. However when I select the objects to move them, it only selects the current key frame that I'm on for those objects, so moving it only affects that keyframe. How can I select all of my keyframes so I can make them all uniform?
View 7 Replies
Aug 14, 2010
How can I join 2 different movie clips (Panle_mc, Text_mc) so that they can move together if I move one clip?
View 5 Replies
Sep 26, 2002
I want to define functions to move a movie clip around the stage, my code works when i define it STRAIGHT to the movie, but when i define it as functions it doesn't.
my code put straight on the movie is:
onClipEvent (load) {
this._x = 0
this._y = 0
[Code]....
View 14 Replies
Aug 15, 2005
get something to work. What I'm trying to achieve is this: there's a slideshow that automatically changes pictures every 10 secs (I've used a kirupa tutorial to achieve this). The pictures are loaded from an xml file, which also contains captions for the pictures. What I would like to do is to have the caption fade in and slightly move to the left with each picture change. E.g. picture 1 is displayed, caption 1 fades in, moves to the left and stays there; picture 2 is displayed, caption 2 fades in, moves to the left and stays there, and so on.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
delay = 10000;
[Code].....
View 6 Replies
Apr 1, 2007
Using the easing transitions I simply move the _y of several movie clips. It is ok but their starting positions are always from the top of my stage, even if I fix their positions at the bottom.
View 2 Replies
Apr 18, 2011
I am having a movie clip playing on a loop on the ON frame of a button , and something else on the OVER frame, and everytime i move my mouse to the button it resets the movie clips thats playing. heres my file:
[URL]
View 1 Replies
Jul 20, 2006
I was making a small animation maybe for forums and stuff just wanted to see if i cud do it when i had some problems. What i want to happen (don't ask why) is to have these random movie clips from the library to come on stage from the far right side and to move over to the left and be deleted, but have the movie clips being moved, deleted, and loaded continuously. The problems i'm having are that i can't get the clips to be attached to the right side because the depth is all different. here's the code on the first frame. I will attach the .fla file too.
Code:
onEnterFrame = function() {
//random number generator
rand = Math.random()*20;
[Code].....
View 4 Replies
Mar 8, 2006
I have ablut 60 movie clips attached dynamically on the stage in flash each at various depths. I want to place some other movie clips in between the depths of those clips dynamically .. how would i go about that?
View 2 Replies
Aug 21, 2006
I want to target ALL the 20 clips attached as below, at the same time, when I press the button "blue". However, my code can target only ONE of the clips at any time. I have tried attaching the clips to a separate dynamic clip and then targeting it but problems with the registration point (0,0) of that clip means I cannot achieve the result I want:
Code:
for(i=0;i<20;i++){
mc = this.attachMovie("red","red2"+i,i);
var scaleFactor:Number = Math.random() * 80 + 20;
mc._x = Math.random()*500;
mc._y = Math.random()*400;
mc._xscale = scaleFactor;
mc._yscale = scaleFactor;
blue.onRelease = function(){
new Tween(mc,"_xscale",Strong.easeOut,mc._xscale,200,3,true);
new Tween(mc,"_yscale",Strong.easeOut,mc._yscale,200,3,true);
}}
View 2 Replies
May 21, 2007
i'm trying to make this little news section and for some reason the rollover and rollout works only on the last news itemClip to be attached. you can take a look at it HERE and see that the bottom one is the only one working.[code]
View 3 Replies
Oct 7, 2009
it is possible to move an object that has a bone attached to it that will follow the movieclip you are moving with script? For example if I have movieclip "arm" connected using a bone to movieclip "hand" and I use the script
hand.x = hand.x + 20
the arm doesn't follow the hand though like it does if I were to drag the hand in flash manually.
View 2 Replies
Jun 29, 2008
As you can see I am attempting to assign x,y positions to clips that are being "attached."
var clipArray = new Array();
clipArray = [189, 275, 361]; // x positions
for (var i:Number = 1; i < 4; i++) {
this.attachMovie("clip"+i,"butt_"+i,i,{_x: [clipArray(i-1)], _y: 142});
}
View 4 Replies
Sep 13, 2009
I'd like to control a movie clips current frame by another movie clips action script.I realise the following controls the outside (root) frame time line:
on(release){
_root.gotoAndStop(1);
}
but I'm not sure how to apply that to my other movie clip. I'm guessing it would be something like this:
on(release){
_*movie_clip_name*.gotoAndStop(1);
}
View 1 Replies
Jan 5, 2010
say I have a clip with an onEnterFrame running on it with a hit test to check if the user has rolled off the clip . . . Then i create an empty clip within that clip and attach clips to it. Will my .onEnterFrame and hitTest now apply to the clips i have attached to the original clip?
View 2 Replies
Jul 15, 2009
I have multiple movie clips on stage (all in separate layers, of course) as well as buttons on stage to play each movie clip. There are buttons inside each movie clip. The problem is that the buttons inside the top layered movie clip work, but the others in the movie clips below don't.
View 2 Replies
Jan 4, 2009
I'm making a shooting game but there won't be much of a challenge without enemies that point and shoot. Is there an easy way to make them do that?
View 5 Replies
Jul 14, 2003
How would one go about masking movie clips that are nested within other movie clips?
I have a photo gallery slider type of thingy that loads jpegs with loadMovie into containers. I can mask the entire movie clip but as for the containers,...well I just dont know whats going on here.
View 7 Replies
Sep 17, 2004
After the dublication of an movie clip,
1. I would like to be able to delete one by one the new movie clips
2. I would like to move them all together.... First you press the word green and then click in the blue area.... A green cyrcle will appear.. Click the word green again and then in the blue square and a new green cyrcle will appear. I would like to move the cyrcles with the buttons arrownd the blue square... And when I press delete I would like to delete any cycle I choose... The flash is too large to attach it to the forum, if anyone is interested I can send it by mail.
View 3 Replies
Jan 5, 2009
Does anyone know a good reliable way to get movie clips to point at other movie clips? I use MX 2004.
View 1 Replies
Aug 18, 2005
Here's what I'm trying to do (in example form): I have a movie clip called "dude". Dude is animated to walk around, then drop a cigar (all inside the movie clip). But the problem is, dude moves, so if you try and move dude as the cigar is dropping, the cigar moves with him. So what I want to do is create a new movie clip instance called "cigar" OUTSIDE of the movie clip dude right as he's dropping it, so that you can move him without moving the cigar. Get it? I've attached another helpful animation to explain.
What I have right now is, on the 13th frame of dude, a few lines of code that create and place an instance of cigar. In that frame I also have an invisible instance of cigar for me to duplicate. Inside of the cigar movie clip is the animation that makes it fall to the ground. I need to change that code so that the instance of cigar is created outside of the movie clip dude. Here's the code I have now (inside of dude, on frame 13):
[Code]...
View 2 Replies
May 8, 2003
I have a problem stopping multiple clips. I have created a presentation using flash and I have many movie clips which have sub movie clips inside of them. Ok lets look at one movie clip in detail. Inside one _root movie there are multiple sub movies; each with a different movieclip labels (each movie clip is named with unique labels ie. north, south, east, west, and What I need to do is be able to STOP all these sub movie clips with one stop, and in turn PLAY these same movie clip with a second action.
The only way I know how to stop all these sub movie clips is to target each and every one individually.
[Code]...
View 2 Replies
Jun 22, 2010
What I'm trying to do is have my Flash piece have custom elements set by an XML file. I'm using ColorTransform. I have a piece that's loaded as a separate movie clip, and I can't figure out how to get to the piece and apply the ColorTransform.
Here's one example of what I'm doing for a different element on the same mc.
[code]...
So, in this example, I'm setting header_mc to a color specified in the xml. In the case I'm having trouble with, I want to set a color to a movie clip on the timeline and not the main movie
View 5 Replies