Getting Multiple X And Y Coordinates
I have 12 clips on the stage. I want to get each one of their X and Y coordinates when they appear on stage. This will give a value to their starting position.
I will then use that starting position to create a reset function for them to obey after I rollout of each individual clip.
Confused?
loop for name of 12 clips (these are all named mc1, mc2, etc)
then
get the starting x and y coordinates for the clips
assign variable to the values (mc1x, mc1y, etc)
Thanks for help.
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 07-06-2005, 01:35 PM
View Complete Forum Thread with Replies
Sponsored Links:
Sliding Through Multiple Coordinates With One Button
I am trying to move a mc horizontally stoping at certain xpos coordinates using only one button to cycle through them until hitting the last and stopping. So far I am using this on the mc that moves:
onClipEvent (load) {
_root.xpos=200;
}
onClipEvent (enterFrame) {
this._x += (_root.xpos-this._x)/7;
}
And on the button I am using:
on (release) {
if (once != true) {
once = true;
_root.xpos = -300;
} else {
once = false;
_root.xpos = -400;
}
}
How should I go about storing the coordinates? Array? And is it possible to use the one button to cycle through (ie...first click moves to 200, second click moves to 400...etc...)? I have been searching through the forums but can't find anything relevant to doing this.
View Replies !
View Related
Move Coordinates Of Multiple Movies Over Frames
Ive made a movie on my main timeline with about 300 frames and 7 or 8 layers. Is there an easy to move all of the movie clips across all the frames to a different coordinate on the stage? The objects on stage are aligned to the top left of the screen and i want to have it be center aligned.
View Replies !
View Related
Coordinates Of MC Inside Multiple Conainers, Relative To Root
Hi everyone,
Does anybody know, how to get coordinates of a MovieClip relative to stage(root)? For instance i have a mc on stage at x:100 and y:200, inside mc, i have buttonMC, with x:100, and y:100. Basically the coordinates relative to root would be mc.x + buttonMC.x = 100 and mc.y + buttonMC.y = 300. But if i have like 10s of containers and need to get relative coords? Is there a way to do that?
Thanks in advance.
View Replies !
View Related
Coordinates
Shew, so much to learn. Here's my problem. Say I want to compare an objects coordinates in one MC to some in a different movie clip. I've been making all of my MC's top left origin 0,0 (not the center) which has been helpful in comaring them correctly atleast to the root level. I know that there is a function in ActionScript that get's local or global coordinates. I found the function's description and board messages that were pertaining to it confusing so haven't used it yet. Can you help? Do you have any recommendations how to handle this? What do you do? Thanks! - Michelle
View Replies !
View Related
Coordinates
Hey
Uhm I need to know something....what kinda script i have 2 use...
In my flash movie Ive got on the left side of the screen a map where the user is able to navigate through.The Screen seems like this
-----------------------------------------------------
BIG MAPXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXLITLLE MAPX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦ XXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
XXXXXXXXXXXXXXXXXXXXXXXX ¦
-----------------------------------------------------
The BIG map is able to zoom so to know where ya are on the map there is the litlle map.How do I trace the coordinates in the big map and put them in the little map?Hope you understand me...
Thanks
Martijn
¦
View Replies !
View Related
Coordinates Nav
Hi - I saw an effect I want to try to duplicate - I want to be able to tell a MC to go to a specific x position and a specific y position from any spot - - so let's say I am at 50x and 60y and I want to go to 10x and 35y. I just need the logic and method to do this. I come close but the MC starts jumping around and being all nutty - I guess id the coordinates are not divisible by the rate at wich the MC moves it jupms - how can I avoid this? Thanks!
View Replies !
View Related
Coordinates
I need my spaceship not to enter som x and y coordinates.. does anybody know how to do this ?
i have a town on the bottom and i dont want the spaceship to fly in front of if, i need the ship to stop before it gets so low..
thnx !
S.Boy
View Replies !
View Related
XY Coordinates
I have created a new project that uses Loadmovie to load an swf. The problem is the it loads at the top of the stage,
loadMovie("test.swf",1);
How can I tell it to load to a different xy coordinate?
Thanks
View Replies !
View Related
Coordinates
I have created a MovieClip-A containing a button with the code:
Code:
on(press) {
startDrag("",true,0,0,250,0);
}
on(release) {
stopDrag();
}
MovieClip-B contains MovieClip-A rotated at about 23 degrees, effectively creating a diagonal slide bar.
MovieClip-B is then placed within Scene-A.
My problem is trying to get the _x and _y coordinates of the button relative to the Scene-A not to MovieClip-A.
I have tried
Code:
_root.MovieClip-B.MovieClip-A._x
_root.MovieClip-B.MovieClip-A._y
but this does not take into account the rotation applied within MovieClip-B
any ideas ?
View Replies !
View Related
X Y Coordinates
I'm not a Flash newbie but this is a newbie question:
I can't figure out how the x and y coordinates work in Flash. I mean, I understand what they ARE, I just don't know how Flash figures them. Why is it that symbol 1 could be x:50 y:50 on the main stage but within the "edit in place" stage the coordinates change drastically?
What I want to be able to do is to take symbol1 and have it be x50 y50 on the main stage, but also x50 y50 within other symbols. Main stage x50 y50, so it's in the exact same place when the swf plays.
View Replies !
View Related
=- Coordinates? =-
I want to know how to generate this effect, http://www.ofarevolution.com go to the site and use the menu (the bar in the upper left) it will zoom out then zoom into to correct area.
How would i recreate this effect. I have one large image that is made up for 4 sub images. and lets say 4 buttons labeled 1-4
So when its like
on (realease)
*shift to center (x,y) and zoom out*
and if you press the 1 button
go to coordinates (x,y)
how would i code that
thanks
n
View Replies !
View Related
X/y Coordinates
I've got a project where I have to have a 640x420 image that is actually a bunch of pictures in one. It will be masked by 100x75 mask.
In the app, I'll have scroll arrows so that the user can scroll to different images within the mask, (which will be actually moving the 640x420 image.) the problem I'm having is that in the upper left corner of the "mask" I need to be able to record the x/y coordinates of the image behind, because i'll also have a "button" where the user can scroll to the image they want, and click the button, which will actually send those x/y coordinates to a database. (and by these x/y's we'll be able to tell what image they had showing up in the mask.)
I know how to place my image, and place the mask on the stage over it. and then I know how to have the image scroll behind the mask using the arrows. But I'm not sure how to collect the "x/y" coordinates in order to send.
Does anyone have any solutions to this?
Hopefully there is someone out there that understands what I'm trying to do in the first place!!!
Thanks in advance for any help!!
View Replies !
View Related
Coordinates
Can any of you think of a way of simulating latitude/longitude? I need to have movieclips placed on a map within MX based on an XML file. Getting the value out of the file isn't a problem, but putting them in the right place on the map is. Please help.
View Replies !
View Related
X Y Coordinates
hi,
do you know how an element's x-y coordinates are determined? Suppose we have a MC named example. For example: movie clip example has an _x value of 200. When you load the swf that contains exampleto another swf, its x coordinate changes.
Does it directly add up? (example's _x and the _x of the MC it is loaded in)
View Replies !
View Related
XY Coordinates
Hi.
How do I code a button within a movieclip so that when it's clicked it takes me to a particular xy coordinate of that same movieclip?
Basically how do I make a button that takes me across a different part of the screen?
Please help!?!
View Replies !
View Related
Do X/y Coordinates Max Out?
does flash limit the x and y coordinates (negative or positive) that an object is capable of moving in actionscripting?
my x coordinate seems to max out around -8200 pixels.....once the object reaches this coordinate, it disappears.
any help??
View Replies !
View Related
X&y Coordinates
Could someone give me the the proper scripting to load a movie 100 pixels to the right? I have tried to follow the manual but there's got to be something missing in these pages because it doesn't work.
Here's what's up....
I have a swf titled pastors.swf. I want to load it into an existing movie using the action script "load movie". I want it to load 100 pixels to the right of 0 and that's it.
For the life of me I can't figure it out!
Tom
View Replies !
View Related
X And Y Coordinates
do the x and y coordinates change when you test out a movie? for example, i have a mc symbol positioned at the bottom of the background, but when i ctrl + enter to test it, it's positioned above where i want it to be. when i test its in a different position and i'm afraid when the mc will be affected when i refer to specific coordinates in the code...
so basically, do they change when you load it?
View Replies !
View Related
[F8] Getting X Coordinates
This is hard to explain but i'll try my best.
I have a movie clip inside a movieclip = "Panel" inside of "Final"
Also inside of "Final" is another movie clip called "Stroke"
when the user's mouse enters the "stroke" movieclip the "Panel" Movieclip starts scrolling (depending where the mouse is) the problem is i want the "Panel" clip to stop moving when it reaches it's xMax and xMin; I have this code:
Code:
panel.onRollOver = panelOver;
function panelOver(){
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds();
function scrollPanel(){
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax){
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
var xdist = _xmouse - 169.95;
panel._x += -xdist / 7;
if(panel._x >= 25){
panel._x = 25;
}
if(panel._x <= -770){
panel._x = -770;
}
}
Instead of using just the pixel x coordinates to stop I want something that will get the min and max whenever the code runs (I want it to be easily customizable)
I hope that that made sense.
View Replies !
View Related
XML Coordinates
Dear people..
I want to make a map, witch has buttons on it, but the coordinates of those buttons need to be externally loaded because my client has to be able to modify them hisself.
I came this far :
Code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function() {
var map:Array = this.firstChild.childNodes;
for (var i = 0; i<map.length; i++) {
duplicateMovieClip(_root.button, knop[i], 1000);
knop[i]._x = Number(map[i].attributes.xpos);
knop[i]._y = Number(map[i].attributes.ypos);
trace(map[i].attributes.xpos);
trace(map[i].attributes.xpos);
}
};
myXML.load('xml.xml');
But it just doesn't work..
does anybody know how ?
greetz roland
ps. fla+swf+xml are in attachment
View Replies !
View Related
X Y Coordinates
Hello,
My question is how to move a movie clip along an the x coordinate. It's a long movie clip that extends pass the right side of the stage. I want a button each time when pressed to move the movie clip about 500 pixels along the x coordinate to the left. Is there any actionscript that can do this or know of any tutorials? Any suggestion are appreciated! Thanks!
View Replies !
View Related
(MX '04) Cant Get It To Go To Coordinates
I have an idea for a game but I cant find the script I'm looking for.
item_1 falls from top of screen on(release) item_1 goes to set coordinates at set speed.
I dont know if thats read able but thats how it looks in my head. I got the falling part and the click part, but it just goes to the x y axis i set and wont move across the screen. any hints
View Replies !
View Related
Coordinates
How would you set randomly generated values to coordinates of movie clip pinky? THis is what I was thinking
var pinkyx = (Math.rand()*x);
var pinkyy = (Math.rand()*y);
so basically I want pinky to be generated at a random place. I can't remember the coordintes and size of the stage so I can't really entert exact values, but tha's not the point. i can't get the pinky to be generated a t a random spot. It always appears where I put it in the first place, the x and y variables won't change
Thanks
View Replies !
View Related
Xy Coordinates
Hi,
I have a javascript that controls a animated character in swf format. The script looks like this,
<script language="JavaScript" type="text/JavaScript">
<!--
function chiamaMetodo(clip, label) {
var IE = navigator.appName.indexOf("Microsoft") != -1;
var filmato = IE ? window.mainMovie : window.document.mainMovie;
filmato.TGotoLabel(clip, label);
}
//-->
</script>
The character plays different animations when the user rolls over the page navigation. Like when he rolls over home it plays "anim1" and when he rolls over about us it plays "anim2".
Everything is fine but i want the character to move close to the respective navigation labels and play the animation when the user rolls over them. That is, close to the (x,y) coordinates of the specific navigation label.
Pls this is urgent!!!!!
thanx
View Replies !
View Related
MC Coordinates...
I think this should be easy, how can I get the coordinates of a MC on stage.
For example, you have a MC called ball. And you want its x coordinate displayed in a dynamic text field with its Var: ballx.
I tried (dont laugh):
ball._x = ballx;
this displayed "_level0.ballx" in the text field.
thanks.
View Replies !
View Related
Map & Coordinates
Hi guys
I need to create a map in flash that takes its coordinates from an external XML file. I know that this is possible but i need a code for reading an xml file and assign the values read from the xml to Flash Varibles. Besides this i don`t really know if it`s possible but, if it is, only action script can help. Can i load an object (a movie clip for example) that i have in my library and from action script to "tell" the object where is his place in the current secene without practily be on that secene ?!
To make more sense i have to create this map that reads coordinates, (coordin. aleready set in flash, not random) and when i read from the XML the name of a country a red flashing dot has to appear on the map above that country.
IF u have any ideeas or you have done something like this PLEASE CONTACT me or post a message !
Thank you !!!
(dj_s0m30n3@yahoo.com)
View Replies !
View Related
Coordinates
Anybody know what's going on?. I've opened a new screens presentation document and the X & Y coordinates are all up the spout. If I position something at X:0 and Y:0 it get's positioned way off the stage. What's happening? Thanks
View Replies !
View Related
Coordinates
Hi
Regarding Flash 8, is it possible to "reset" the stage X & Y coordinates to a default setting? I have two different flash documents and I want to copy and paste content from one to the other. When I paste a button or movie clip into the second document, I want it to be in exactly the same position as it was in the original document but the coordinates aren't the same. Is there a way I get the coordinates the same?
thanks in advance
View Replies !
View Related
X And Y Coordinates
Ok I posted up asking if anyone could help me with an interactive map tutorial but no replys so I tried my best (I am fairly new to actionscript) to create one out of some existing code.
I have got it to work but doesnt do exactly what I want the existing code was taken from an image gallery that basically change the y value of a movieclip so it would slide to the right image.
The problem I am having is changing both the x and y values of the movieclip to allow it to move to any point on the stage. i need to know how to make the target variables point to an x and y coordinates. or maybe this isnt the way to do it?
I am really stuck with this and I am sure it would be easy for someone who knows actionscript. Any help would be very much appreciated.
Thank you in advance.
Here is the code I am using and I have attached the fla
this.attachMovie("image_0", "image_0", 101);
target = 100;
target1 = 120;
target2 = 175;
target3 = 200;
images_0._y = -1000;
speed = 5;
for (var i = 0; i<4; i++)
{
var thumb = this["thumb_"+i];
thumb.pos = target;
thumb.pos1 = target1;
thumb.pos2 = target2;
thumb.pos3 = target3;
thumb_0.onPress = function() {
target = this.pos;
};
thumb_1.onPress = function() {
target = this.pos1;
};
thumb_2.onPress = function() {
target = this.pos2;
};
thumb_3.onPress = function() {
target = this.pos3;
};
thumb._alpha = 80;
thumb.onRollOver = function() {
this._alpha = 20;
};
thumb.onRollOut = function() {
this._alpha = 80;
};
}
this.onEnterFrame = function() {
image_0._y += (target-image_0._y)/speed;
image_0._x += (target-image_0._x)/speed;
};
View Replies !
View Related
Help With X And Y Coordinates
Is there a simple way to determine the x and y coordinates of a nestled mc? Or better yet, is there a way to fors Flash to see "0, 0" as the top left most corner of the document? I there isn't, is there a "reason" as to why nestles movie clips assume the top left of that movie clip is 0, 0?
View Replies !
View Related
The Coordinates Of A MC
When I use:
_root.mc1._x=0
the MC appears on the top left corner of the screen
but when I import a movie using loadMovie(), the coordinates are different
_root.container.loadMovie("mc1.swf",1)
_root.container._x=0
this time it's not on the top left corner of the screen.
Does anyone know how to place the MC correctly on the stage?
thanks
View Replies !
View Related
Coordinates... Coordinates...
Hi,
I have this little movie (see http://www.masster.ro/test/but.swf)
Source files are at http://www.masster.ro/test/but.rar
The smiley is loaded from an external SWF and it should work like this: if I drag the smiley over the red circle, smiley gets circle's coordinates. Right now it jumps to the right and lower.
I know why: coordinates are relative to parent movie and red circle is in _root timeline while smiley is external (thus having its own coordinate system). But I can't get the right syntax to correct it. Can you help me correct my code, please?
Smiley is a movie having this code attached:
Quote:
on (press) {
startDrag(this, true);
origX = this._x;
origY = this._y;
}
on (release, releaseOutside) {
stopDrag();
if (this._droptarget == "/hole") {
_root.place(this);
} else {
this._x = origX;
this._y = origY;
}
}
Main movie action is like this:
Quote:
var xPos = 120;
var yPos = 20;
this.attachMovie("container", "sm", this.getNextHighestDepth(), {_xPos, _y:yPos});
loadMovie('smile.swf', sm);
function place(a) {
sm._x = hole._x;
sm._y = hole._y;
}
Thanks
View Replies !
View Related
Coordinates
I was wondering how I would get external .swf movies to load in specific places. I was looking at: http://www.motiongraphiks.com/flash.html Of course, the header/navigation, content, etc load in specific spots on the page. Are there coordinates that have to be listed to achieve this? Could someone advise me with a code or tut?
View Replies !
View Related
Coordinates
I was wondering how I would get external .swf movies to load in specific places. I was looking at: http://www.motiongraphiks.com/flash.html Of course, the header/navigation, content, etc load in specific spots on the page. Are there coordinates that have to be listed to achieve this? Could someone advise me with a code or tut?
View Replies !
View Related
X And Y Coordinates
i want a text to accelerate fasacross the screen and then deaccelerate slowlly off..i know of the teening capabilities but i wan more control of the quickness and the easing and i heard that you can do this by onclipevent doesn anyone know the code for what i am rying to acheieve
View Replies !
View Related
About X And Y Coordinates
At my job, we are having a problem with aligning the x, y coordinates on different scenes. when I try to use the x, y coordinates for the buttons and graphics to sit in the same place as we switch to different scenes---those coordinates change even though they are numbered the same. Anyone know why?
View Replies !
View Related
Display Coordinates
Hi all,
I was wondering if anyone can tell me how to place numbers in my website that will correspond to the coordinates of the mouse?? I tried looking up a tutorial but it doesn't work and causes my computer to freeze. Please help!
quester
View Replies !
View Related
Mouse Goes To Coordinates
hi,
is it possible to make an animation where the mouse goes from one coordinate to another - automaticaly.
I need this for showing a certain point in the movie. I know it can be made with hide and show cursor, but I want that the mouse stays at the last coordinates and that one can continue from this new point.
thanks for help
caitanya
View Replies !
View Related
Defining Coordinates
hi,
I have a rectangle and a circle drawn in it. Then I have a draggable movie clip in the rectangle.
My problem is, I want the movie clip to move inside the rectangle (given the constrain to rectangle option) but not enter the circle.
What script do I define for the movie clip to drag upto a maximum of some coordinates(the rectangle) and not go below some minimum coordinates(not enter the circle).
Thanxz.
View Replies !
View Related
X, Y Coordinates - Their Understanding
How to understand X,Y co ordinates in Flash 5. Is X,Y cooradiates of every MC,Button,Graphic is relative to Movies's X,Y coordinates.
is (0,0) coordinate of the movie is always at the center of the movie.
Grateful if somebody can direct me to a website on this.
hkhyd
View Replies !
View Related
|