ActionScript 2.0 :: Attaching MovieClip And Assigning It Coordinates Of Another Movie Clip

Sep 16, 2010

I'm making a game where an airplane loads using attachMovie, with a randomly assigned y coordinate and a constant x. The airplane then moves across the screen. You hit another button, and a parachutist is loaded using attachMovie, with the coordinates being set equal to the current coordinates of the airplane. The parachutist loads but he doesn't load to the coordinates of the airplane. If I feed the parachutist numerical coordinates, he loads to those coordinates, but for some reason Flash seems to be completely ignoring my attempts to feed the plane's coordinates to the parachutist. Here's the relevant code, which is of course nested in an onEnterFrame function:

if (Key.isDown(Key.DELETEKEY)){
if (jumped == false){
attachMovie("jumperWhole", "jumper", 0);

[Code].....

As I've said, the jumper loads, he just loads in the upper corner of the game, as if the plane's coordinates are ignored and Flash attaches jumper to the default coordinates of the program. If I try to attach the jumper to the using the coordinates of something that's not in motion, it works, so I'm wondering if this has something to do with the motion of the plane.

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Assigning X And Y Coordinates In Dynamic MovieClip

Jan 11, 2010

I cannot assign _x and _y coordinates in a movie clip dynamically. For example:
for (i=1; i<=5; i++) {
myThumb_mc = "thumb" + i;
myThumb_mc._x = Stage.width/2;
myThumb_mc._y = Stage.height/4;
}

But if I do:
thumb1._x = Stage.width/2;
this works.

View 3 Replies

ActionScript 2.0 :: Get A Movie Clip To Slowly Move To The Coordinates Of Another Existing Movie Clip

Oct 23, 2010

it seems simple enough but i have no idea on how i could get a movie clip to slowly move to the coordinates of another existing movie clip

View 5 Replies

ActionScript 2.0 :: Find The X-y Coordinates Of The Attached Movie Clip Within The Created Movie Clip?

Mar 26, 2006

Q1) The registration point of a created clip is top left - my question is how can I dynamically change it's registration point - say to center center?

(I am trying to attach a movie clip to a created clip and I wanted it to be centered inside the container - a related sub-question, how can I find the x-y coordinates of the attached movie clip within the created movie clip?)

Q2)When I tried to create two different movie clips, I found I had to create them at different depths, else the first would load and the second would not. Why would that be so? I'm on MX 2004 Pro.

View 4 Replies

ActionScript 2.0 :: Assigning A Level For The External Movie(reseller_locations.swf) Loaded To A Movie Clip(clipHolder)?

Jul 25, 2006

assigning a level for the external movie(reseller_locations.swf) loaded to a moivie clip(clipHolder)

code

loadMovie("reseller_locations.swf", this._parent.clipHolder);

View 1 Replies

ActionScript 2.0 :: Attaching Several Movie Clips Into A Movie Clip?

Jun 20, 2006

I'm trying to attach several movie clips into another movie clip. I can add the movie clips successfully . However, the movie clips start from the middle of the main movie clip that I used as the background layer for the other movie clips. Is there any way to make it located to the top left? Here is the code I used:

Code:
Layer_Movie.attachMovie("NumberTop","num",depth,{ _x: scol + (col * 32), _y: scol - 32 });

scol and srow are the attributes that represents the starting locations from the left and top. (I used 10 for the variables scol and srow the movie should be located 10 pixels away from the top and left) 32 is the height and also width of the movie clip to be added.

(I know sometimes actionscript is not so powerful to implement such kind of processes. Since I have not time to wait for the another version of actionscript

View 6 Replies

Attaching Movie Clip On Layer?

Nov 21, 2009

I need to create new object, but in a layer that is below the tope one. So far I tried some commands:

PHP Code:

_root.attachMovie(...);

- this one creates object above all other. Changing depth doesn't change anything when it's about objects I put manually in editor.

PHP Code:

_root.layername.attachMovie(...);

- this one doesn't work at all.

View 3 Replies

ActionScript 2.0 :: Movie Clip Not Attaching

Feb 27, 2008

I'm trying to just attach a movie clip inside of another movie clip, and it's not working...which is beyond me. The following code is written in an actions layer within the first movie clip (main_mc). I want to attach a close button to close an externally loaded swf, and the close button has to be on top of the externally loaded swf, and it's not attaching, so therefore I can't close anything.[code]any glaring mistakes that I can't see? o.O this is really confusing, it seems like such a simple task, I must be missing the greater picture.

View 1 Replies

ActionScript 2.0 :: Attaching Movie Clip To _root.?

Mar 8, 2005

I tried to connect a mc to the _root, with the statement

Code:
_root.attachMovie("missile", 'missile'+x, x+10);

It was linked and everything but for some reason didn't work. Am i overlooking something?

View 1 Replies

ActionScript 2.0 :: Attaching A Movie Clip From The Library?

May 27, 2007

I am attaching a movie clip from the library with this code

PHP Code:

function movie_start(num){    for(i=0;i<num;i++){         var circle = attachMovie("k_circle","k_circle"+i,i)        with(circle){            _x = (-50);            _y = (-50);        }    }} 

So is there any way of placing Actionscript onto this clip using actionscript I want to place this:

PHP Code:

onClipEvent (enterFrame) {    _x += (_root.k_xpos-_x)/_root.k_speed;    _y += (_root.k_ypos-_y)/_root.k_speed;} 

I have tried a couple of things to no avail...

View 2 Replies

ActionScript 2.0 :: Attaching And Removing Movie Clip?

May 6, 2008

When i click an image i want to attach a animated movie clip with that image, i tried attach movie for that concept and its working fine, but i want to remove that animated movie clip when the same image is clicked again, how to check whether the animated movie clip is attached with the image

View 2 Replies

ActionScript 3.0 :: Assigning A Movie Clip To An Array?

Nov 30, 2010

I want to assign a specific frame from a movie clip to a specific item in an array. I have a movie clip with 52 frames and each one has a different image of a playing card. I also have an array in a separate as file that has 52 items. If say I want to assign frame 1 of the movie clip to array[0] what exactly must be done? If I click on a button and a two of spades is drawn, how do I make sure the two of spades frame in the movie clip is chosen?

View 0 Replies

ActionScript 2.0 :: Assigning A Movie Clip A Depth?

Mar 16, 2009

I'm re-arranging how I have the movie set up (I used to have it in multiple .SWF's, but now I'm making it into one big movie), but I've ran into a snag. I don't know how to assign a movie clip a depth. The reason this is a problem is that if I were to attach a movieclip (Say Movie1), it would overlap another movieclip's (Movie2) drop shadow.Movie2 isn't assigned a depth because it's loaded along with the first movie, but Movie1 is assigned a depth when it's loaded on a click

View 1 Replies

ActionScript 2.0 :: Attaching Movie Clip To The Absolute Top Layer?

Jan 27, 2009

im adding some button movieclips to a swf and for some reason its programmed to always have the dynamic hovers on top, i need to add a few static buttons on top of the dynamic hovers. here is what i tried but it still isnt working

Code:

this.attachMovie("placeholder_mc", "placeholder_mc2", 1000, {_x:150, _y:200});

is there a way to attach the placeholder_mc at the absolute top layer even over the hovers?

View 1 Replies

ActionScript 2.0 :: Attaching A Movie, Valled Targetx It Has A Second Clip?

Mar 15, 2006

I am attaching a movie, valled targetx it has a second clip inside it, called holder. I am using loadmovie to load an image or swf into the attachmovies holder clip. But, if I use trace(targetx.holder._width) to get the loaded clips width I get 0, which is cleary no correct.

View 6 Replies

ActionScript 2.0 :: Attaching Loaded Image Into Movie Clip?

May 1, 2009

I'm not sure if this can be done, but I'll try my luck here I've loaded external jpg image using loadClip method... Now i want to attach the same image to another dynamically created movie clip. I know i can attach images from library but i need it on this way.

It have to be attached as JPG. I know for bitmap data class and I am already using it but don't know how to attach jpg.

View 1 Replies

ActionScript 2.0 :: Attaching Blood Movie Clip In Depth Below Enemy Mc?

Jun 29, 2009

what i have:guy with gun who shoots bullet,bullet hits enemy,bullet removes itself,blood attaches above enemy but how would i make the blood attach below the enemy?

View 2 Replies

ActionScript 2.0 :: Call Out Specific Frame After Attaching A Movie Clip?

Mar 22, 2005

if there's a way where you call out specific frame after attaching a movie clip.

View 4 Replies

ActionScript 3.0 :: Assigning StartDrag XY Coordinates?

Feb 26, 2010

I'd like to figure out how to get these four skulls to move on a constrained X axis on enter frame, and on CLICK, I'd like them to reset to their original positions.Example:On frame 1 is an mc I created named holder. Inside there's an mc named box. Inside box are four mcs, circles1-4, inside the circles I have four skulls.I've also created an mc called rectangle and dragged it over the first skull to get the coordinates I want using the following trace:

trace(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
Resulting in these coordinates: 143.95,119.05,131.15,61
So, this works MOUSE_OVER the circles

[code].....

View 19 Replies

ActionScript 2.0 :: Assigning X And Y Coordinates To Array?

May 13, 2008

I'm pretty new to actionscript. I have an outline of a human body. When the user would click on one part of the body (x y coordinates) it would return the name of that part of the body? I'm assuming i would be using an array in this instance. How you can assign x and y coordinates to an array?

View 2 Replies

Actionscript 3 :: Fitting Movie Clip To 4 Coordinates?

Apr 4, 2012

i've got 4 coodinates an need to fit a fit movie clip to them, so each corner of the movieclips is on one coordinate.The only thing i could find it tranforming it with a matrix and angles (see example), but these cant be the best solution for my problem to calculate all the angles etc.

var degX:Number = 0;
var degY:Number = 0.3;
//Get the transform matrix for the object to skew
var m:Matrix = bild.transform.matrix;

[code]....

View 1 Replies

ActionScript 3.0 :: Get Movie Clip To Save Coordinates?

Nov 28, 2009

what i am trying to do is create a game that works on the same bases as battle ships but the difference is that its just at a single grid size scale so basically you only have to hit 5 squares in the 8x8 square grid. The trouble i am having is that i have set it up as a movieclip and i cant seem to get it to same the positions on the side that i select on (named the players side) it works fine for the otherside and will hit the 'enemy squares' and you can win the game but never loose the game that the problem.

View 0 Replies

ActionScript 2.0 :: Drawing Lines In Movie Clip And Coordinates?

Apr 20, 2004

I am drawing a set of connected lines in a MC that is created using createEmptyMovieClip. The lines start at (0,0) within the MC and move into the negative x values when the lines move left. The problem I am having is when repositioning the MC. When I tell the MC to move to _x=0 and _y=0, it doesn't move to the stage's (0,0), it still hangs off the left side of the stage. The following image shows the MC positioned to (0,0) (note: the green is the stage):shouldn't the MC containing the drawn lines use its left-most point when being repositioned so that it doesn't hang off the left side of the stage?

View 5 Replies

ActionScript 2.0 :: Get The Movie Clip To Be Attached Once In The Designated X,y Coordinates?

Jan 2, 2010

Basically its an onPress event handler on a movie clip that attaches another movie to it when pressed.The problem is, I only want the movie clip to be attached once in the designated x,y coordinates, no matter how many times the main object is pressed. I'm essentially trying to write my own FreeTransform script, that allows users to resize the object.

Below is the my source code:

ActionScript Code:
chair_mc.onPress = function() {
var bounds:Object = chair_mc.getBounds(this);
//

[code]...

View 5 Replies

ActionScript 3.0 :: Determine Absolute (stage) Coordinates Of A Movie Clip

Apr 1, 2011

Is there a method to determine the stage coordinates of a movie clip?

I don't mean something like this:
stageX = mc.x + mc.parent.x + mc.parent.parent.x + ....

I would like to be able to determine the movie clip stage coordinates without knowing what are its parents and grandparents etc. The goal is to be able to place the movie clip on exact place on a stage, no matter what is the nesting structure.

View 1 Replies

ActionScript 2.0 :: Changing Behavior Based On Y, X Coordinates Over A Movie Clip With OnMouseMove

Sep 22, 2009

I was thinking that it will be an easy task but something is not right. Here is what I am trying to do. I want to be able to run a function if the mouse is moved over certain areas of the movie clip on stage. Based on which area of the movie clip the mouse is moved I'd like to be able to trigger different behaviour. Below is the code which I was thinking shoud do it:

Code:
var posY:Number;
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {

[Code].....

For some reason, the trace statement is ran always when the mouse moves regardless if it is over the movie clip or not. It also only shows the first trace statement. It is never chaged even if the mouse is in the different areas of the movie clip.

View 5 Replies

ActionScript 2.0 :: Changing Behavior Based On Y, X Coordinates Over A Movie Clip With OnMouseMove?

Sep 23, 2009

I was thinking that it will be an easy task but something is not right. Here is what I am trying to do. I want to be able to run a function if the mouse is moved over certain areas of the movie clip on stage. Based on which area of the movie clip the mouse is moved I'd like to be able to trigger different behaviour. Below is the code which I was thinking shoud do it:

ActionScript Code:
var posY:Number;
var mouseListener:Object = new Object();

[code]......

View 0 Replies

ActionScript 2.0 :: Dragging Movieclip Which Is Dynamically Generated Via Attaching Movieclip From Library

Apr 12, 2010

I have a problem with dragging movieclip which is dynamically generated via attaching movieclip from library.I want to move the movieclip by pressing the yellow square within a boundary say 100*4. I am attaching the flash file with this thread.

View 1 Replies

ActionScript 2.0 :: Assigning Movieclip To Dynamically Created Movieclip

Oct 24, 2006

In part of my actionscript i'm using: thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth()); to create a seperate movieclips for ewach image in my xml file. How would I then attach another movieclip to each of the newly created ones? ie thumbnail_mc.t0, thumbnail_mc.t1, thumbnail_mc.t2... is there a way to do it automaticall7y or do i have to assign it to each one individually? "thumbnail_mc.t"+k.attachMovie obviously doesn't work

View 11 Replies

ActionScript 3.0 :: Attaching A Movieclip To Other Movieclip At Runtime

Jul 9, 2009

I have 3 movieclips, head, body, and legs. head and body has animations. I want to attach all d 3 movieclips at runtime. now if i try to attach them they r moving apart while doing animation at runtime.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved