ActionScript 2.0 :: Get X Position Of A Drawn Movieclip
Jul 31, 2009
If i draw a movieclip on a frame (root) as such:[code]This will draw a simple square from position 20,20 on root. Now if i trace penName_mc._x i would expect it to give me the distance from the root origin i.e. 20 however it always produces 0. My questions are:
1- Why doesnt it consider x as 20?
2- Is there no way to determine the x of this newly created movieclip from the origin? (besides drawing from 0,0)
View 2 Replies
Similar Posts:
Oct 3, 2009
I am having a problem getting color value of MovieClip's color on stage. This movie clip contains simple colored square drawn by Rectangle Tool.[code]...
View 0 Replies
Oct 7, 2009
How would it be possible if draw a square, then put movieclip to move in it. It would move when rotate another movieclip..
View 0 Replies
Oct 22, 2003
I have some text placed on the 'canvas' in Flash. I also draw some stuff in an onEnterFrame function on the main timeline. The stuff I draw in the onEnterFrame gets placed behind the text I have on the canvas. I'd really like to have the stuff I draw in front, but I don't know how to accomplish this.
View 1 Replies
Dec 27, 2007
I am using an external custom class to draw xml driven shapes in a movieclip. take a look at [URL] for a better idea of what I am working on. I am looking to turn each shape (which would be a booth) into a button...so that I can click each booth and have some info come up about it. I am having a hard time calling the array from the main movie.
View 1 Replies
Nov 19, 2009
I added a Menu_mc on my stage. Initially, this should be at the center of the stage and when I click on it, it will tween on the upper left corner of the browser. However, when I resize the browser, the Menu_mc goes back to the center of the screen.
I have tried separating a different actionscript file where it is specifically for initialization of the object and another one for resizing. And then when I call it on my main AS file it goes like this:
Code:
// Add the symbols to stage
var Menu_mc = new Menu_MC();
addChild(Menu_mc);
[code]...
But it seems futile.
View 6 Replies
Jan 19, 2012
I'm making a program that lets the user draw shapes on the screen with the mouse. When they're done they press a button to finish. The user is only allowed to draw on a certain area of the stage, to control this on the timeline i have a movie clip that takes up all the space the user isnt alowed to draw in.When the user presses the button i want the programe to check that the shape the user drew isnt touching the moiveclip. I want it to do this without taking the border of the movieclip into account so i cant use hitTestObject()
heres what i have so far:
//------------------------------DRAW SHAPE------------------------------
private var shape:MovieClip = new MovieClip();
[code]....
View 2 Replies
May 13, 2010
I'm hoping someone can solve this headache. Basically, I want a movieclip to move to the position of each of my buttons from any position along my x axis. Therefore, the movieclip needs to 'flip' to face the way it is traveling.At the moment I have the movieclip moving to the mouse x axis when I ROLLOVER the button and stop following the mouse when I ROLLOUT but the code won't flip the movieclip so I must have something wrong...
btn.addEventListener(MouseEvent.ROLL_OVER,followCa t);
btn.addEventListener(MouseEvent.ROLL_OUT,stopCat);
btn02.addEventListener(MouseEvent.ROLL_OVER,follow Cat);
btn02.addEventListener(MouseEvent.ROLL_OUT,stopCat );
[code]....
View 0 Replies
Jul 3, 2009
setting a position of movieclip called red x and y position within a movieclip called background
Code:
background.redsquare.x = 300;
background.redsquare.y = 300;
comes up with TypeError: Error #1010: A term is undefined and has no properties.
setting a position of movieclip called red x and y position withen a movieclip called background
Code:
redsquare.x = 300;
redsquare.y = 300;
This works fine but how can that be when surely you must access the red withen the background rather then just accessing red?
View 3 Replies
Nov 3, 2009
lets say i have a sprite on the stage and one movieclip inside it. now i want to tween or just set that movieclip x and/or y position according to stage position. so for example i want to set mc.y = - 100; (by which i mean -100 to stage, not sprite which mc is in.)
View 2 Replies
Feb 3, 2010
What i'd like to do is have a menu/site map that adjusts when you click on a certain icon. For example, I have a AS3.0 flash file with, say, 5 keyframes with 5 buttons that are in different positions on each key frame. The buttons are set to gotoAndPlay the various keyframes. I can set up a tween that links frame 1 to 2, 2 to 3 etc. but what I would like is a tween from, say, 1 to 3, then 3 to 5, then 5 to 1 - basically in a random order rather than sequentially through the key frames. I could set each of these tweens up individually but the site is for a portfolio that I would like to keep adding to and to do this individually would mean an ever increasing amount of tweens.Basically, is there a way to get a 'MovieClip' to move from Position A in keyframe 1 to Position B in another keyframe without a set of tween frames? I'm sure this is simpler than I am making it sound but I don't seem to be able to work it out.
View 1 Replies
Jun 27, 2006
using the following jumpTo script as a guide how do I write an if statement for a function that will basically ask "if the movieclip is at position 3 stay there, otherwise jumpTo position 2"?
Code:
var bg1x = new Array(0, -1280, -1014, 0);
function jumpTobg1X(number) {
gradientNav_mc.newX = bg1x[number];
}
I have tried a bunch of if/else statements but I can't get it working. I can't figure out how to write it properly. I tried something like this:
[Code]...
View 2 Replies
Jan 26, 2011
Okay I have a script in which I have added an image to the stage. It is absolute centered. I then have another with is on top but much bigger. I would like the big image to move opposite of my mouse position on the smaller image. ie: cursor is on bottom left corner the bottom left corner of the larger image is in the same spot. And the same thing for any other area.
I have tried many different ways but to no avail. I have done research but no one has been able to give me a solid answer. Anyone know of a way to accomplish this. Keep in mind this it needs to work regardless of the image size.
View 1 Replies
Feb 10, 2010
I have a movie clip called "myMC". I set its x value as such:
[AS]
var myMC:MovieClip = new MovieClip();
addChild(myMC);
myMC.x = 100;
[Code]....
I know I could proboly acheive this with a math equation but is there a function that can get the exact global position of "myShape"? So that I can position another movieclip or sprite around that movieclip?
View 3 Replies
Feb 10, 2012
is it possible for me to give a movieclip the same position as another movieclip. meaning they will be on top of eachother and when one moves the other moves as well.i know you can do it with the mouse:[code]It would be a great way to cheat the program as im having some problems, but this would fix it. the 2 movieclips though is in a class and the other is on the stage.
View 4 Replies
Sep 20, 2009
I want to know is that a way to get position of MovieClip A in MovieClip B.Let say in MovieClip B (MovB), I have an MovieClip A (MovA) moving around, and I would like another MovieClip C (MovC) to follow the MovA moving around inside MovB.
I tried below,
MovC._x = MovA_Instance._x;
MovC._y = MovA_Instance._y;
It get the position, but not the correct 1.
View 2 Replies
Nov 15, 2009
yesterday i got solution from murphy that to load the xml value in a duplocate movie clip.now i have done a math class to make it xml value in best fit in my screen.for the referance i have attached the source files 1.fla 2. xml and 3. uiDesign imag
View 4 Replies
Jan 22, 2009
I need to get the position of a movieclip, specifically it's X position.
How can I get this and assign the resulting number to a variable?
View 1 Replies
Jun 5, 2010
i need a movieclip (let's name it "MC1") to be exactly at the same position as another moviecilp("MC2") which is moved with the arrow keys.MC1 has to be always at the same position as MC2, even when it's moved with the keys. How can i do this? I already have the code for moving MC2, but i can't get MC1 to be in its position. Where do i have to put the code in the frame, in MC1, MC2? and ... WHAT CODE?
View 1 Replies
Feb 15, 2011
i have a movieclip (a square - 50x50). I need this square placed on multiple _x and _y values.Ex:I need my square to be displayed at _x = 50, _y= 100, also at _x = 250, _y= 100, at _x = 150, _y= 150 and so on. _x and _y should be a fixed value, not a random one. It would be also great if I could take x and y values from an xml.
View 10 Replies
Mar 16, 2009
I've made an image slider in flash and need it to slide out at it's current position before changing scenes.
The code i'm using is -
onClipEvent(load) {
_root.newXpos = 0000
speed = 10
[code]...
I need the '_root.newXpos = 0000' to tell the movieclip to stay in the X position it is currently in (it will be different each time as the user can move the movieclip via buttons, so a simple Xpos = 0000 won't do)Alternatively, I've tried adding -
on (press) { _root.newYpos = 476.2;
if (_root.Ypos =476.2);
gotoAndPlay ("Pxcotos", 1);
}
on a button but the scene changes before the movieclip has a chance to slide out.
View 4 Replies
Jan 13, 2010
I've made an image slider in flash and need it to slide out at it's current position before changing scenes. The code i'm using is -
[Code]...
on a button but the scene changes before the movieclip has a chance to slide out. Is there anyway of telling the actionscript to wait before jumping scenes between the code?
View 2 Replies
Apr 5, 2010
I have 4 movieclip in the stage. Its instance names are mc_1, mc_2, mc_3, mc_4.
To change the x position of this movieclip I can use the below AS 2.0 code. It is working fine.
for (i=1; i<=4; i++) {
eval("mc_"+i)._x += 10
}
I like to know how to write this statement in AS 3.0.
View 4 Replies
Dec 6, 2011
I want to play video clip when it is dragged into the timeline I created. I handled the timeline and drag/drop part but I need that clip to play when button is clicked on. So I need to make my function determine the x position of the movieClip and play it if it is on the certain x value.
View 3 Replies
Mar 11, 2011
I'd like to be notified when a MovieClip changes position, regardless of whether the position was changed by my code, or by the built-in drag operations.
View 2 Replies
Oct 14, 2011
I am having a container mc with 5 children mcs. children names mc0,mc1....mc4.
cont.getChildByName("mc"+Number(cont.numChildren-1)).x =
cont.getChildByName("mc0").x - 20 *1.2;
after this re-position process.. I want to set the last item position as 0 and so on. How can I do this?My target is to attain a circular movement.like
[mc0][mc1][mc2]
[mc2][mc0][mc1]
[mc1][mc2][mc0]
[mc0][mc1][mc2]
View 2 Replies
Nov 7, 2010
I have this XML that I want to use to set the position of movieclips placed dynamically on the stage but I am having a hard time figuring it out.This is what I have in my XML:
ActionScript Code:
<STARS>
<STAR XPOS ="93" YPOS = "44"> </STAR>
[code].....
View 6 Replies
Nov 9, 2010
In my swf Application, I can change var's movieclip:background color, text, drag- swf, image into the movieclip ( WYSIWYG method ).in the end, I send via xml to php page all the movieclip var's, and to sql database.
I need also, send by the xml, the position of the movieclip to php file.( The reason is: I want to display just this moveclip with all the change vars in a new browser page ).
I dont know how to write this xml in my Actionscript2 -position of the movieclip.[code]..
View 0 Replies
Mar 30, 2011
i have a 5 box of movie clips on the stage then a shuffle button on the top corner.
when i click the shuffle button, the 5 movie clip will exchanges places. (X Position only)
View 6 Replies
Aug 20, 2011
var a:MovieClip = new A();
var b:MovieClip = new B();
stage.addChild(a);
[Code].....
I try to get x position but it doesn't work ,what could I do?
View 1 Replies