ActionScript 3.0 :: Moving Images By Coordinates?
Sep 3, 2009
I'm working on co-developing a game in flash, which involves, among other things, designating a path along which an image has to travel. Basically, it collects mouse coordinates, and needs to move the image to each set of coordinates in order. My co-developer insists that it needs to be done with trigonometry.Or is there some simpler method to move an image/movie clip/etc. cleanly to a given position on the stage?
View 2 Replies
Similar Posts:
Nov 19, 2009
Im going to attatch the fla on here...I am also going to give you the script viewable here...im completely a beginner so i made my self notes
also this is not all my coding im just learning off of it to create my own project... What coding would i use to tell the mc to stop scrolling once it reaches a certain x coordinate? for example x=0 (left side of stage) or x= -484 which is when right side of picture is at right side of stage... and can i setup math for it to automatically determine the correct x coordinate (based off mc width) to stop at?? if there is easier scripting to do the same....fill me in
oh and x is off of the stage typically...this is panoramic pics im scrolling
[Code].....
View 2 Replies
Jun 23, 2009
I have a MovieClip on my stage. Inside the MovieClip there are a few buttons (all MovieClips also) and a mask layer to keep anything on the outside invisible.
Problem: My MouseEvent fires and should move objectA into position over objectB. All code in the script tells me it has moved. Tracing the x,y coordinates of objectA also tells me it has moved. The Alpha on objectA is 100% and it is positioned on the topmost layer beneath the mask layer. All this tells me that when the object moves, it should be visible on the stage (the event moves the object into the masked area). Testing disproves everything. The traces all tell me the object is where it is supposed to be but it cannot be seen. I don't understand this and it, amongst other AS3 hiccups, is seriously turning me off Flash as it seems to be a waste of time to try and learn as it seems like 90% of the scripts written will fail 90% of the time.
View 3 Replies
Jul 25, 2011
Excuse the title, had no idea what to call this. I'm creating a simple game with the following components (added picture for clarity):
[URL]
1. Character - The symbol in the center of the stage.
2. Level - The bounds surrounding the stage. Everything in this picture is contained within the level except for the character.
3. Water - The blue square. The water symbol is located within the level symbol.
4. Water droplet - The blue dot floating above the water. This is also located within the level symbol.
Using the arrow keys the player controls the movement of the level. While the character symbol is always located at x=275, y=200 (center stage), the level symbol's coordinates change whenever the arrows are pressed. This gives the player the illusion that they are controlling the character.
When the player makes the character symbol touch the water symbol, I want to move the water droplet to the location of the character. The problem is, I can't for the life of me figure out the coordinates I need as they will always be different depending on where the character touched the water. It's important that the water droplet be inside of the level symbol because after the player drops the water I need it to act as if it's moving with the surroundings.
tl;dr: I essentially need to find the x and y distance from the character symbol to the origin of the level symbol, keeping in mind that the level symbol's location is always changing and that both symbols are located on the stage.
View 2 Replies
Nov 21, 2005
3 buttons, one on top of the other, being 40 pixels far one from the other. Id like to, when any of the buttons clicked, for all of them to move 40 pixels down, changing positions, BUT... the last button has to change places with the first one, going from outside the canvas... Here I attached an animated example of what I whant...
View 4 Replies
Sep 4, 2007
I have this picture which has the dimensions 5599x660 and it's kinda like a moving background, it's moving to the left.Now, when it reaches the end I want it to be replaced by the same pic.Stage size is 950x720.I came up with two possible options:
1. make a duplicate of the pic movieclip and place it on stage right behind the first one and then when the first one is off stage place it right behind the second one and so on...
2. have flash duplicate the pic automatically and place it right behind the original one (I read about that option somewhere I think it's called DuplicateMovieclip)[code]
1. it works, but after the first round - it goes through image 1 (img) then through image 2 (img2) perfectly and then when it's supposed to place image 1 right behind image 2 there's a space of about 100 pixels between them... I don't know why because I gave the right x coordinates in the code...
2. now when u still go on and u go through (the misplaced) image 1 (img) and then u come to the point where it's supposed to place image 2 (img2) right behind image 1 there's also a space between them but only maybe of 5 pixels.How come that with the same pictures with the same code for both of them it's doing something different both times ?
View 1 Replies
Jul 1, 2004
trying to make a MC to change s x location according to the mouse position. Les say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.
View 9 Replies
Mar 11, 2011
There is a plane in my movie and it's moving (from starting point (x,y) to end point (x',y') coordinates in timeline). it's a very simple issue.And there is a popup that will be visible when user click on the plane mc.
I wrote the following code :
planepp.visible = false;
plane.addEventListener(MouseEvent.CLICK, planefunc);
[code]......
View 6 Replies
Oct 9, 2009
I'm attempting to make a game which moves an object to certain x/y coordinates on the push of a button, but I can't figure out what would be needed.
View 1 Replies
Mar 21, 2004
I m having some problems with my menu I m working on.Its weird cus I d already have done the same menu once and worked fine..The selector mark is suposed to "mark" the selection on the menu after a selection is pressed. But I m having problems with the X and y coordinates and scales of the MC and when I click on the option,the MC gets smaller and then bigger to the size I want.Its suposed change scale and position but its not working like it is suposed to work.I m not sure either if I m setting the Mc on the initial x and y coordinates.
View 4 Replies
Mar 2, 2010
Imagine two movieclips, both on the same Y axis. I want one MC to be able to diagonally move to the other MC X axis, all while making a perfect diagonal line until it reaches 100y. So just like this picture, that MC moves in a perfect diagonal until it matches the other MC.x, and 100y (no matter what, it can't go past 100y but must equal 100y). I probably made it sound more complicated than it is.
View 2 Replies
Feb 22, 2005
I wanted to modify the XML Portfolio Tutorial to be able to create a grid of images with the thumbnails.I'm not sure how to control the x and y coordinates of the thumbnail images using the method shown in the tutorial.
View 6 Replies
Jul 31, 2004
problem with loading images randomly and putting them in the right _x and _y coordinates.I have a swf file with in the first frame a button with this code :
on (release) {
filename = ["image-01.jpg", "image-02.jpg", "image-03.jpg"];
path = "images/";
[code].....
View 1 Replies
Jul 31, 2004
I have a problem with loading images randomly and putting them in the right _x and _y coordinates. I have a swf file with in the first frame a button with this code :
on (release) {
filename = ["image-01.jpg", "image-02.jpg", "image-03.jpg"];
path = "images/";
i = filename.length;
[Code]....
the image gets loaded and placed correctly when played from the harddisk. the problem starts when i upload the swf to the internet, then the image won't be centered but the left upper point of the image is placed at x=640 and y=230
View 1 Replies
Mar 22, 2011
From Pro Adobe flash can I export an animation's data? like the x and y coordinates and rotation values for individual images in a sequence
View 1 Replies
Mar 18, 2009
I have made a rotating images but the images are not moving smoothly. You can see the example at:-URL...Does anyone know why the images not moving smoothly?
View 3 Replies
Dec 19, 2011
I was trying to convert global coordinates to local coordinates of a UIComplenent in my flex project using below code using below code
var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point
uic is UIComponent in which I have subclass of Sprite for drawing something I have set the sprite's mouseEnabled and mouseChildren to false to not interrupt the mouse event. above code is within uic's mousemove event where I was tracing the gp and lp gp was giving correct value and suprisingly lp was giving negetive values. when I move the move to the top left corner of uic i expect lp to be 0,0 but it is giving the -width of of uic. I broke my head for hours and ended up finding an alternate by using offsets. Infact my original code was much simpler like this which was same issue
var lp:Point = new Point(e.localX,e.localY);
I am not sure what exactly is causing this problem. the workaround had lot of issues and it creating a mess in my rest of the algorithms.Just now I found even more interesting thing (which is actually weird). for some reason I went and create a new lp2
var lp2:Point = new Point(e.localX,e.localY);
now surprisingly it was giving correct values as expected and I went back and changed the code as
var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point
var lp2:Point = new Point(e.localX,e.localY);
var lp2:Point = uic.globalToLocal(gp);
now it is expected to have all the lp, lp2 and lp3 variables to be same but weiredly lp two is giving wrong value and lp2 and lp3 were giving correct. I am suspecting using the variable lp has something to do. I am not sure about that but above proves it so right now I am using lp2.
View 1 Replies
Mar 12, 2009
I have been working on a couple of projects where image scrolling have been necessary, usually along the x-axis, cause of the number of images - usually the scroll is started if you roll-over a button or something. I have solved it using a Timer, or previously setInterval, that updates the .x-property like 30 times a second or so. But in the end this method turns out to be kind of laggy, regardless of what fps I use. So I wonder if you guys could share your prefered method of scrolling
View 2 Replies
Jan 14, 2011
I have a fla file template and the example sequence swf but the template only show a few of the images in the finshed preview even though all the images are present 12 bitmaps and 12 symbols.see why the images are not moving in the Banner .
View 1 Replies
Feb 28, 2010
Recently I came across a site showing a no. of images (probably 8 - 10) rotating around an invisible eclipse. When we put mouse-pointer over any of the images it's tip shows a linked site's name and if clicked that particular site opens up. Only one image is displayed perfectly which is on the top while rotating, while other remain blurred out not clickable. How to create such effect as I need to get it implemented.
View 1 Replies
Sep 4, 2004
I get that Flash glitch of the movie jumoing like one pixel over after alpha transition from actionscript
View 1 Replies
May 21, 2007
I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:
transforms x,y,z coordinates into Flash x coordinate
xFla = function (x, y, z) {
// cartesian coordinates[code].....
I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:
red line
style(1, "0xFF0000", 100);
plot(0, 0, 0);
draw(200, 0, 0);
View 4 Replies
May 8, 2008
I am trying to write a script that animates images, movingthem smoothly and slowly across the stage. If I load the image inauthoring time and embed it on a movie clip, i have no problemincrementing the x position by 0.25 for example. But if a load theimage at runtime using a loader the image jumps from pixel topixel. For some reason it seems that I am not able to turn thepixelSnapping of
View 5 Replies
Jan 18, 2011
How can I do the same effect (moving continuously) as in the following link using images?URL...
View 1 Replies
May 3, 2010
Im making a little app in flash using papervision I want to make a regular movieClip show up in the same place as a papervision object. The coordinates seem like perspective is affecting the number displayed.
View 2 Replies
Apr 19, 2004
I'm trying to create the effect on the dreamers site [URL] during the main intro where all the kids are sitting in the theatre and the one kid is smoking. Anyone know how to create this effect that has different images move at varying speeds based on the mouse location to show depth.
View 2 Replies
Apr 19, 2004
I'm trying to create the effect on the dreamers site during the main intro where all the kids are sitting in the theatre and the one kid is smoking. Anyone know how to create this effect that has different images move at varying speeds based on the mouse location to show depth.
View 2 Replies
Apr 24, 2011
I'm trying to create a portfolio website, and I want my picture strip to move in and then become buttons. I have made them buttons, but once the strip stops moving I keep getting this message.
[Code]...
View 1 Replies
Apr 12, 2010
I am trying to figure out how I can control 9 different background images with 2 smooth moving sliderbars in three steps with actionscript.
Scenario:
slider 1, step 1 + slider 2, step 1 = picture 1
slider 1, step 1 + slider 2, step 2 = picture 2
slider 1, step 1 + slider 2, step 3 = picture 3
slider 1, step 2 + slider 2, step 1 = picture 4....
View 2 Replies
Nov 9, 2011
I have loaded some images through XML and attached into dynamically created MovieClips named mc0,mc1,mc2...etc.
_loader.removeEventListener(ProgressEvent.PROGRESS, onLoadingAction);
count++;
var img:Bitmap = Bitmap(e.target.content);[code]....
Everthing works fine. But it is shaking so that it was not looking good.How do I achieve smooth movement?
View 2 Replies