ActionScript 3.0 :: Track Y Coordinate, Then DoSomething?
Nov 12, 2009
I am trying track to see if mouse is between 0 and 200 pix in the Y coordinate, then do an if statement.
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition);
// I use this to track readings.
function mousePosition(event:MouseEvent) {
[code].....
View 3 Replies
Similar Posts:
Dec 23, 2010
I am faced with a dilemma. I am writing components with nested components. What sort of coordinate system scheme should I implement? I want to be able to pass points to the components without having to worry about where the origin is in absolute terms. At the same time, I want to have some sort of encapsulation when it comes to origins and stuff. Is there any sort of guideline to follow when it comes to nested components and such?
View 1 Replies
Mar 31, 2010
I have 3 square. smallest square s3 is inside s2. s2 is in side s1. each is 10px larger [code]how can I find the coordinate of child in its parent's coordinate system?
View 1 Replies
Mar 1, 2004
Why doesn't this code work correctly for the onRelease?
createEmptyMovieClip("MC", 1);
MC.loadMovie("MC.swf", "_root.MC");
MC.onrelease = function() {
trace("hello world");
[code]....
Creative minds have always been known to survive any kind of bad training.
View 13 Replies
Mar 1, 2004
Solve one problem. Still have another. Why doesn't this code work correctly for the onRelease?
createEmptyMovieClip("MC", 1);
MC.loadMovie("MC.swf", "_root.MC");
MC.onrelease = function() {
trace("hello world");
};
Creative minds have always been known to survive any kind of bad training.
View 13 Replies
Nov 6, 2009
Im having a little bit of trouble trying to make a button give me different results based on what frame the main timeline is on. I am trying to get a button to go to a different link based on what frame the main timeline is on. If I am on frame 5 It will trace back "4" .. that is fine but other frames trace back the frame number and also 4.
frame 2 click of button traces back 1 and 4
frame 3 click of button traces back 2 and 4
frame 4 click of button traces back 3 and 4
frame 5 click of button traces back 4
[code]....
View 8 Replies
Oct 14, 2011
I have written 3 classes classA, classB and classC.how can I refer to class A's doSomething method. ie to get output "classA.doSomething()"
View 4 Replies
May 26, 2009
i have a mapMC on the stage and 6 buttons. i need to be able to make the buttons move the mapMC to specified coordinates. the coordinates are set and will never change. i also need an easing from one location to the next. i guess i'll go ahead and throw in a bonus question for any of you aces out there. lets say location "A" is at x=200, y=400. i would like the mapMC to get there and scale 120%. so a button that gets pressed will go to its coordinates and scale acordingly. i can see that this could be script heavy, but for some reason not too difficult.
View 1 Replies
Jul 13, 2011
I have a movieclip with a drag function, and after each drag I want it to trace the x position. I tried the following code but it always outputs 0.
ActionScript Code:
sliderMC.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToPosition);
function fl_ClickToPosition(event:MouseEvent):void
[Code].....
View 5 Replies
Apr 20, 2009
to get the position of a movieClip in the x axis, we use: trace(movieClip.x);is there an alternative for ".x"???
View 3 Replies
Oct 8, 2005
first have a look at this: [URL] It loads "auto" coordinates from php file, and makes the "auto" move after timeinterval. It is needed tht it could load infinate coordinates, but i fail to do it. If u change setProperty(auto, _x, kord ) to setProperty(auto, _x, x2 ) , it works, but as u can see only with one coordinate.
View 9 Replies
Jul 28, 2009
[URL]
If you drag the map, it moves even beyond the edge of the map so the map eventually gets dragged off the screen. Is there any possible way to stop the map moving any furthur than its boundry?
The source is here - [URL]
View 3 Replies
Jan 28, 2012
When I use 3D rotation tool, there is an option called global transform, if it turned off, the object would rotate by its own axes, this is exactly what I want. How can I do rotatation like that with AS3 code? Is there any property if changed then rotationX/Y/Z would rotate object by its axes?
View 4 Replies
Mar 17, 2010
I would like to base one component's x and y cooridnates according to another, I tried using the binding notation but it doesn't seem to work
[Code]...
View 1 Replies
Oct 18, 2010
I've usually designed Flex applications myself but this time I'll need a designer to assist with skinning the application. I've worked with this designer for a while, and we could work well on an HTML/CSS environment. He can't code, he sends me sliced PSDs which I could convert to clean code. But I'm not sure how to have him assist me with Flex UI as he's not familiar with the components.How do you guys interface with designers for your applications?
View 2 Replies
Nov 7, 2010
I have a problem when one B.swf file is loaded to another A.swf file.A.swf file size is 400x400.B.swf file size is 100x100.B file has a movie clip (MC) which is animated and position of this movie can be from Y:-100 to Y:200. B file is loaded into the center (X:150, Y:150) of the A file.When B file is loaded, then animation starts. I have a problem: I can see animated movie clip B out of B screen scope (for example: when B.swf file movie clip has _y = -100 I still can see that movie clip in A.swf). I am expecting that movie clip will not be shown if Y position becomes negative
View 1 Replies
May 25, 2011
I have a flash application and I use papervision3d library. I put my objects to the scene, no problem but I also want to show the coordinate axes (x,y and z) to user. Is there any way to show these axes?
View 2 Replies
Jan 6, 2009
our collaborators misposition the registration points of MCs.Here's the deal: we need to recover the REAL MC's coordinates (not the ones based on registration point). Is it possible? How? I've tried some code already (like getBounds and getRect functions) but all of 'em consider the registration point.
View 4 Replies
Jul 27, 2009
I'm trying to make a 2d birds eye map for my user to move around it, and the map moves around instead of the user MC because I always want the user to be in the middle.
Problem is I load the map into an instance of a blank movie clip on the stage from a jpeg on the server, but I want to be able to put items on the map that the user can interact with at certain coordinates, after the map has been loaded, from some gifs I imported into the library as bitmaps.
I can't seem to find a function that will let me load the bitmaps into the MC that already has the map in it though, is it possible to do it that way? If not then any recommendations?
View 1 Replies
Nov 27, 2009
I have enemies being dynamically spawned from a Class. They are constantly moving but I need them to shoot at the player when their X is the same as the Players. I have the enemies being put into an array for collision detection
View 1 Replies
Nov 7, 2010
I have a problem when one B.swf file is loaded to another A.swf file.
A.swf file size is 400x400.
B.swf file size is 100x100.
B file has a movie clip (MC) which is animated and position of this movie can be from Y:-100 to Y:200.
B file is loaded into the center (X:150, Y:150) of the A file.
When B file is loaded, then animation starts. I have a problem: I can see animated movie clip B out of B screen scope (for example: when B.swf file movie clip has _y = -100 I still can see that movie clip in A.swf). I am expecting that movie clip will not be shown if Y position becomes negative. how I could prevent B.swf files movie clip appearing on A.swf file?
View 2 Replies
Jan 16, 2012
I am wanting to take the average x co-ordinate of several movieclips, mc_01, mc_02, etc. using arrays. That is, I would like to sum all the x co-ordinates and then divide by the number of movieclips.
View 1 Replies
May 11, 2010
I am currently in the process of creating a scroller that would take in movieclips comprised of images and video. It will continually scroll to the left, and the animations and video will play at a certain point on the stage.
The problem I am encountering right now is how to place the movieclips on the scroller. my first thought was place them in the actual movieclip, but then you can't access them on stage.
My second thought was to assign their x coordinate to a certain part of the scroller and just increment the x coordinate with the same system to make it look like it was attached. The only problem with that is I would need to track the scroller's x coordinate so I would know when it gets to the middle of the stage (so I could play the video inside of the smaller movieclip at that location.)
track a movieclip's x coordinate like that? could I run through it and trace, and then act on that trace? I'm so confused.
Will my first attempt at this work? Is it somehow possible to access movieclips within a bigger movieclip and treat them as if they were on stage?
View 1 Replies
Feb 27, 2005
How would i make it so that i can make something move at an x/y coordinate and have it move there with ease?
View 1 Replies
Dec 11, 2006
I have the following code below hard-coding the x/y coordinates of 8 movie clips. I am trying to write some code that will generate this so that it will accomodate any number of content clips so that I do not have to go back in and create new x/y corrdinates for additional clips.[code]
View 3 Replies
Jan 11, 2007
Is there a way to use an loadMovieNum code at the beginning of a frame and make it load at a specific x and y coordinate? When I use this code it doesn't work...
[AS]
loadMovieNum("bodyline.swf", 5);
this._x = 43.3;
this._y=130;
[/AS]
It changes the coordinates of the main background image, not the position of the movie it just loaded. I tried something like this....
[AS]
loadMovieNum("bodyline.swf", 5);
"bodyline.swf"._x = 43.3;
"bodyline.swf"._y=130;
[/AS]
View 3 Replies
Aug 7, 2007
I am loading a swf into my website using loadMovie on level 1 (which i am not sure is the best way) and it shows up in the upper left hand corner by default i guess. how do i give it the coordinates so that it appears where i want it to.
View 1 Replies
Oct 20, 2009
I do not understand how coordinate systems and movieclips work. When I add a movieclip to the stage and set it's position I expect it to appear there. If I have a movieclip with it's center in the middle, and I add it at 0,0 to my stage I expect it to appear in themiddle.nstead when I add a movieclip to my stage the stage gets bigger... even though the movieclip I added doesn't extend past any bounds of the stage. When I try to make an object tween from one position to another it works half the time but as i add and remove children it begins to fail because the coordinate system is constantly changing.
How can I enforce a static coordinate system on my stage? Or how can I be sure that when I make a tween to move a movieclip from point A to point B that point B won't move around in the time that it's animating?t seems with flash that every time I encounter a problem I am boggled by how little sense it makes and how hard it is to find any information about it. I must be doing something terribly wrong.
View 6 Replies
Nov 18, 2009
I have added 20 movieclips to x and y coordinates inside my stage. Some of them are outside the flash bounds.I want to have buttons that simulates next and previous. How can I make the clips move in a motion? I can set the x coordinate for the clip but the motion is to fast.
View 2 Replies
Nov 23, 2011
I am working on a project where I have 5 equal sized panels inside of a MC that uses the following code to load the MC: ( it slides into place in the viewer window)
onClipEvent (load) {
targetx = 650.0;
delay = 8;
[Code].....
What I would like to do is ALSO move the panels with left and right arrows that act independently of navigation buttons. So that if you were on panel 2 you could advance to panel 3 or back to 1. Can I assign AS to the arrows to move the MC a specified distance left or right?
View 8 Replies