Display Position Of X And Y Of Object
Apr 19, 2009
hey guys i have 6 moveable objects, what i want is to be able to click a button and a text field appears that displays the x and y co-oridinates off each object, is this possible and if so is there a way also i could have another button where the user inputs the numbers he wants from x and y and the objects will go to that posisition
View 1 Replies
Similar Posts:
Oct 26, 2011
I have 2 possiblities. It looks like these are the same (or I'm wrong). Which is better and why?
var quest1:DisplayObject = FrameCanvas.baseCanvas.addChild(app.questionmark1); //
quest1.x = posX; //
quest1.y = posY; //
or
app.questionmark1.x = posX;
app.questionmark1.y = posY;
View 1 Replies
Feb 15, 2012
A display object container on the stage has some bitmap images of sizes 50x50 arranged in a order one by one. Now if i click on any of the thumbnail image (bitmap) the entire container should move and position itself so that, the bitmap image clicked is placed in the center of the stage.
View 1 Replies
Jan 31, 2010
If I create a rectangle with 100px width and 100px height and then rotate it, the size of the element's "box" will have increased.With 45 rotation, the size becomes about 143x143 (from 100x100).Doing sometimes like cos(angleRad) * currentWidth seems to work for 45 rotation, but for other bigger angles it doesn't.At the moment I am doing this:
var currentRotation = object.rotation;
object.rotation = 0;
var normalizedWidth = object.width;
[code].....
View 4 Replies
Mar 6, 2008
Is there any way to test if a display object has been added to the display list?
View 9 Replies
Jan 22, 2012
can I resize a display object (container) without its contents (children) are resized?
For example, in the following code when I resize the green square, red is also resized. I wanted to resize only the green.
ActionScript Code:
import flash.display.Sprite;
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0xff0000);
[Code].....
View 3 Replies
Feb 16, 2011
I'm trying to trace the path of an object by using setPixel on the object's position every frame in a BitmapData/Bitmap pairing. These pixels aren't showing up normally and I suspect I have a fundamental misunderstanding of the BitmapData class. Here's what I'm doing:
public var contrailBase:BitmapData;
public var contrail:Bitmap;
private var contrailColor:uint;[code].....
Using this code, the red pixels don't show up. If I initialize contrailBase to 0xFF000000 instead then I get a black screen on which the red pixels DO draw, but I need the bitmap to be transparent except for the contrail. What am I doing wrong?
View 2 Replies
Mar 4, 2011
What's a simple way to detect if a display object is currently on the display list?
View 1 Replies
Aug 14, 2009
Can you make one Bitmap Object (I'm using an external jpg) or something similar, and then display it many times simultaneously without creating a separate object each time?
Also, would they be easily removed or hidden?
I've got a little checkmark jpg graphic loaded here, but I'm not sure how to go about using it in many places at once.. I can only display it in the one place at any one time...
I'm thinking there might be a way to load the picture once, then use its bitmapData elsewhere in new display objects somehow, without needing to reload the image over and over?
View 3 Replies
Feb 9, 2009
It's my understanding that a display object cannot be in the display list more that once.So if I add something to the stage shouldn't a second addition of the same object replace the first? for instance:
[code]...
there should now only be one "myDisplayObject" on the stage.
View 3 Replies
Jun 11, 2010
I'm stuck thinking about the best way to go about setting a line segment's position, I have a class Line(length, angle, previous) being called from a class Polygon. Right now I have:
public class Line extends Sprite {
public function Line(length:Number, angle:Number, previous:Line = null) {
if (previous != null) {
this.x = previous.end.x;
[Code].....
View 1 Replies
Nov 3, 2009
I am using Macromedia Flash 8, trying to show the detail positioning of mouse pointer in button through video tutorials but following errors appears:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
import flash.external.ExternalInterface;
[code].....
View 2 Replies
Feb 9, 2010
how I can change the X and Y positions where the ContextMenu displays. I know you can do it with the display() method, but not sure how to implement it. My code, so far:
ActionScript Code:
var my_cm:ContextMenu = new ContextMenu();
my_cm.hideBuiltInItems();
[Code].....
View 2 Replies
May 28, 2010
I'm having issue regarding the display when using Safari on MAC, I can see my menu and the display is correct. However it doesn't position correctly on Firefox on MAC. The menu just position above what it supposed to be positioned.My flash size is: 1440x750Using Firefox 3.5 on MACI'm using swfobject 1.5, on my html I have that:
Code:
<script type="text/javascript">
var swf = new SWFObject("gallery.swf", "mymovie", "100%", "100%", "10", "#000000");
[code]......
View 6 Replies
May 6, 2005
actionscript and was trying to display a movie clip's x and y positions in dynamic textboxes. I can make them display the mouse's x and y positions but need to get it to say the movie clip's
View 2 Replies
Jun 27, 2011
How can i cast a object to another type? in AS3 i tried putting (objectType) infront of the variable but it doesnt work, below i have added objects of fishes into the child, and i am getting the fishes back out when mouse down is triggered, and then calling the fishes what to do. however i cant call the method of the custom class fish because it is a displayobject.[code]...
View 1 Replies
Jun 17, 2011
I have a difficult question to explain. I have a class file that loads an external XML file, parses the main nodes into an array, then creates a movie clip instance for each of the main nodes and creates text fields inside of the movie clip instance based on the child nodes in the XML.
Each movie clip instance that is added dynamically has a movie clip embedded in it that acts as a tab. I update the dynamic text of this embedded movie clip based on the name of each main XML node.
Now where I am getting stuck is that I have attached an event listener to each tab movie clip that is inside of each dynamically created movie clip. What I want to do is when the user clicks this tab have that movie clip move to the top of the display list on top of all the other dynamically created movie clips. My problem is that I don't know how to get the references correct.
When I create the movie clips dynamically I store the objects in an array. The problem appears to be that the event is fired for a movie clip inside of the dynamic movie clip so I don't know how to reference the parent movie clip. Maybe it is something else but I don't know how to make reference to the main movie clips that I want to swap.
I hope that makes sense. My main question is how do I use the swapChildren or setChild functions when the movie clip clicked is located within the movie clip I want to change in the display list as well as the fact that this movie clip was created dynamically.
[Code].....
View 7 Replies
Jun 17, 2010
I want to display checkbox or button at the same position based on user role. How can I do this. I cannot give x and y position same for both radio button and button as I will not know the location in my application. Is there any other way by which I can display only one component based on boolean value.
Sample code:
<mx:HBox x="272" y="93" width="300" borderThickness="2" borderColor="0x000000" borderStyle="solid">
<mx:CheckBox label="CheckBox" visible="{role}"/>
<mx:Button label="Button" visible="{!role}"/>
[Code].....
View 1 Replies
Oct 29, 2009
I am wondering about the x, y position of objects. I place a shape at a the bottom of the stage, but then when i check its x, y coords its at 0, 0. Is this correct? so when i start to move it it starts from where i want it on the stage (at the bottom) but the x,y coords are starting at 0,0 also.
View 1 Replies
Feb 3, 2009
The following code works fine when mouse is pressed at any position on the screen ,object moves that position...but what if I want the object move that position at a certain speed..say+10 using setInterval...I mean I want my object move slowly to any position I click on the screen..[code]...
View 4 Replies
Nov 20, 2009
I want to do something which is probably pretty simple but I've got absolutely no idea how to do it!What I want is for the Alpha value of an object (movie clip) to change depending on the x position of the mouse. So when the mouse is at 0 the alpha of the object will be 0%, and when it's at 100 the alpha will be 100%
View 4 Replies
Jun 3, 2010
I came across a problem where my flash timer keeps changing position as the browser window is resized or if the user scrolls down the page the timer will move with it?It also changes position on different monitor screens.Is there an easy way without too much code to position it at a certain position on my page :[URL]As you can see its too low and should be in line with 'Comming soon'Im also using Dreamweaver if that makes a difference.
View 2 Replies
Aug 29, 2010
I have built a site in AS2 and would like to know the position of a ball so that I can move a sign to it always.The whole website is in AS2, but I think I have written an incomplete code below for AS3. I need it for AS2 because the whole site is in AS2. The get position of ball is wrong, but I just wanted to throw in some ideas eg.
Code:
// get position of ball
ball_mc.addEventListener(<what goes here?>, ball_pos);
function signMove(Event:MouseEvent):void{[code]..........
View 3 Replies
Apr 14, 2011
I'm using sensors in a Box2D project. On a collision with a sensor, I'd like to know the sensor's position in the world. I'm detecting the collision with a contact listener, but the sensor's position is always 0 0.
From my code: (edit, added the whole class)
public class MyContactListener extends b2ContactListener {
public var onSensorEvent:Function;
override public function BeginContact(contact:b2Contact):void {
if(contact.GetFixtureA().IsSensor()) {
var ud1:GameEntity = contact.GetFixtureA().GetBody().GetUserData();
[Code] .....
View 1 Replies
Feb 3, 2009
The following code works fine when mouse is pressed at any position on the screen ,object moves that position...but what if I want the object move that position at a certain speed..say+10 using setInterval...I mean I want my object move slowly to any position I click on the screen..
PHP Code:
onClipEvent (mouseDown) {
this._x = _root._xmouse;
[code].....
View 5 Replies
May 26, 2010
My Question is how i deduct the position of the hitTest Objecti mean to say which angle he hit X Y and after hiting it must be goo that angle
here is my code
import mx.transitions.Tween;
import mx.transitions.easing.*;
[code]......
View 4 Replies
May 9, 2009
I started using Flash again after a "brief" hiatus (the last time I used it, Flash was on it's MX version ).I am trying to create an animation in which I can move across the stage a simple object (a circle, a square or a star, for example) using buttons (left, right, up and down)This was fairly simple using AS 1, even when I was no expert. The thing is that those simple ways are no longer working with AS 3.I spent a few hours doing some research until I found this nice tutorial on this same site:
Code: http:[url]....
I followed the tutorial, and all was working nicely, but when I attempted to do the animation from scratch, it simply didn't work .I even used the same names for all the objects and instances, but still nothiing.
View 1 Replies
Sep 24, 2009
i made a full flash site and ill be adding new stuff, so my plan is to make a button that sends you to a determined position, for example a menu; when you click in "About" section the whole page scrolls along with the scroller (vertical) to where "About" section is, i dont know if i can give an instance name to a movieclip or any object so when clicking the button the stage scrolls where the object or movieclip is, is this posible ?
View 1 Replies
Feb 28, 2011
Code:
var myArray = [];
myArray[6] = new myClass();
[code].....
View 4 Replies
Oct 28, 2003
I am trying to get this an object to go from position A to B and back, in infinity!!I only get the object to go from A to be B and then it stops. The code is in the MovieClip actions.
Here is the code..
onClipEvent (enterFrame) {
this.onEnterFrame=goRight;
goRight=function(){
if (this._y<250) this._y+=1;
else this.goLeft;
} goLeft=function() {
if (this._y>50) this._y-=1;
else this.goRight;
}}
View 2 Replies