ActionScript 3.0 :: Determine Which Way A MovieClip Is "facing"?
Apr 19, 2011
I have a MovieClip with an image in it that is designed to animate and move in a certain direction depending on which way the MC is "facing." To that extent, yes, there is a "front" to the MC.
However, I am at a loss for how to determine which way it is facing. Use of scaleX does not work as if I innately put the MC in my work area before the coding and flip it, scaleX will always be 1. Attempting to throw in a hidden MC within that MC and determining if its X value is greater or less than zero didn't work either, because THAT number will always remain the same.
For some additional info, the MC is designed such that 0,0 is in the BOTTOM left corner, at which point the image within the MC is facing left. Flipping it so 0,0 is in the bottom right makes it face right.
I cannot, in any way, shape or form, use a variable within the MC to say which way it is facing either, as there could be a dozen of this same MC active, only with different instance names, at a time. The only way I could use a variable within the MC is if I could determine which way it was facing anyway, which is exactly what I'm trying to do here.
View 2 Replies
Similar Posts:
Mar 24, 2009
I have a swf file that is 7367KB. I would like to reduce the size of the file. How do I go about figuiring out the respective sizes of my movieclips?
View 2 Replies
Apr 17, 2011
I have movieClip (in as3) and I'd like to know is this movieClip playing now
View 2 Replies
Dec 27, 2011
I am trying to create a scenario where I can have two or more movie clips interact with each other to determine the distance between themselves. I found a script online where it does two movieclips however I need it to do more than two, possibly up to about a dozen. That is the first part. The second part is that I need to be able to select one movieclip and for it to become the "master" and then the other clip determine there distance from the "master". I hope I am explaining this correctly. I have attached the fla file which has the script in it for two movieclips, and then I have modified to add the other clips but not sure of the coding to make it work.
View 5 Replies
May 2, 2006
I have a movieclip with a dynamic text box inside it that gets filled with content from an external source. It scrolls up contstantly and is masked, this works fine. I would like to know how to determine when the movieclip's bottom is beside/parallel to the mask movieclip's top. Basically, I want to find out when one movieclip is beside another.
View 6 Replies
Dec 1, 2011
i am using the menu sample for some project. I have tried to add more e.g. menu 4 without the drop down, however, i am facing a lot errors with AS when i add it
View 2 Replies
Sep 28, 2008
I am using this script to rotate one mc (cloud) around another (grass), but what I can't seem to figure out is how to change the rotation of "cloud" so that it is always facing the center of it's orbit
Code:
var radius = 1200;
var degrees = -120;
onEnterFrame = function (){
[Code]....
right now I am just using "cloud._rotation += 1;", but it obviously doesn't rotate the correct way.
View 1 Replies
Jan 23, 2012
i know when you are developing for desktop when you use get camera you can pick which camera you want to use in the flash file, im developing for ios and wondered how i would get camera the front camera working on an app.
View 2 Replies
Mar 22, 2012
I have some movieclips like this one: game_mc.substage_mc.rightHand and inside the rightHand i have a thread_mc like this:
game_mc.substage_mc.rightHand.thread_mc
Ok so here is the thing, i need to access the thread.x and thread.y position related to the stage or substage_mc i donīt really care, but if i do this[code]...
View 3 Replies
Mar 28, 2009
Okay this is always something that's puzzled me. If I create a movieclip, place that clip on the stage, then inside that movieclip, create another movieclip, how does flash determine the coordinates of that second movieclip in relation to the stage. The reason I am asking this, is that I have a large movieclip which contains a number of other smaller movieclips. When a user clicks on one of the smaller movie clips, I need the larger movieclip to move so that the clicked movieclip is now centered on the stage.
I figure that this would be easier to know if I knew how to calculate the distance which the second, smaller movieclip is from the center of the main stage in x and y coordinate values. Am I making any sense? If not I'll try to explain again.
View 14 Replies
Aug 5, 2010
I have a MC that can be moved around with the arrow keys. When a person presses the left key I want the object to face left and perform an animation for as long as the left key is pressed. When the left key is released I want the animation to go back to it's starting frame but the MC should still be facing left. I want the same thing for the other arrow keys, but the animations will be different for each direction (for example: walk right, walk left, walk away from you, walk towards you).
View 7 Replies
Feb 3, 2009
Basically after adding an object on stage (using actionscript), it will be situated at a random rotation angle using:
this._rotation = Math.random()* 360;
After that, I want my object to move in the direction that it is facing, (using onEnterFrame?). How do I do that?
View 0 Replies
Dec 2, 2011
I want to know if there's a way to make a symbol move the direction it's facing.I have a character which rotates when you press Left/Right:
if(Key.isDown(Key.LEFT))
{
_rotation -= 15;
[code].....
View 6 Replies
Dec 14, 2009
I've got a movieclip which follows a predefined path (like in those tower defense games). Normally the mc changes the direction it faces with Math.atan2 method and then rotates the movieclip, but because this game is in a tilted view( in stead of directly from the top) I need it to change the frame in the MC according to the direction it's facing.
Is it possible to read out Math.atan2 method data, and then change the frame the MC is displaying, according to this data? I used [URl]...on-and-realism as a base for this game. If Math.atan2 method
View 1 Replies
Dec 12, 2010
What's wrong with my code?
function moveJoeOne():void
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);[code].....
I've got two different instances of two different MovieClips on the stage of the fla. Visually they're identical but one is facing left and one is facing right. When the file runs, the one that's facing left appears on the stage while the one that's facing right is set to be invisible. What I'm trying to do is have the one that's facing left go invisible when the right arrow is pressed and for the one that's facing right to appear in it's place and accept further input from the right arrow key. When I run the file, the one facing left moves just fine. My problem is that when I press right, the one facing left disappears and the one facing right appears in it's place but it just moves once and stops.
View 2 Replies
Sep 17, 2010
I have this code to add my missile to the screen PHP Code:
[Code]...
it adds right where my character is but I cant seem to figure out how to get the missile to actual move in the direction the character is facing. heres how it looks [URL]
View 1 Replies
May 29, 2011
I am trying to place leaves in a circle to create a flower with code. I run into some problems.Is it possible to rotate the leaves so they all rotate in the direction of the center of the flower? And is it possible to calculate how many leaves can fit around a certain circle radius without to much overlapping?
View 1 Replies
Jul 10, 2009
I am facing "Acces of undefined property" . Here I have two movieClip "ImgNavig" and "Image
Code :
ImgNavig.loadImage("imgs/bureau.jpg");
var Image:MovieClip;
[code].....
View 9 Replies
Sep 27, 2010
I want to update a row in mysql when a user uses an application with flash. And when they exit that application, I want to change the row to reflect that the user has left. Is there a way to do this easily? Currently, I'm thinking of writing a connection manager with sockets.
View 1 Replies
Oct 7, 2009
i am trying to make a photo gallery so when people click on a thumbnail it expands to full screen, my problem is i have lots of pictures and i want to determine which one has been clicked. i thought i would use the e.target in a simple if statement like this:
[Code].....
in this picture one and two are both on the stage with instance names of picture and picture2.
View 3 Replies
Mar 18, 2009
I am creating 6 rectangles through a loop like this:
var target:Array = new Array();
for (var i:Number = 1; i < 7; i++){
target
= new Sprite();
target.graphics.lineStyle(0,0,1);
[Code]...
View 6 Replies
May 4, 2009
We generate a LOT of swfs where I work. We've got a group of people managing putting the swfs into our asset management system. These people do NOT have flash or anything adobe. However, they need to be able to determine the AS setting on the swfs. Is there a tool (preferably cheap or even free) that can be used to determine the Actionscript level of a swf?
View 11 Replies
Oct 22, 2009
I need to know how to tell when I've reached the end of video. I seem to recall there's a command new to flash 10 that will let you know without having to track the total bytes used or time elapsed or anything complicated like that.
View 4 Replies
Dec 3, 2009
I'm loading texts from an external file and horizontally scroll the texts accross the screen with the following tween:
slideXTween = new Tween(txtField, "x", None.easeNone, txtField.x, -txtField.x*3, 70, true);
How do I find out when the tween is done and start loading another external text file or show a static/dynamic movie clip on the screen?
View 10 Replies
Jan 31, 2010
Is there any way via Actionscript that I can have a swf determine what URL it's hosted under? For instance, if I put my swf on this site, I want it to behave one way and on another behave completely differently. Make sense?
View 7 Replies
Apr 19, 2010
Is there an easy way to determine whether a swf is being tested in the IDE?
Have a number of params that change whether I'm working in development or production .. it's getting tiresome changing them .. i'ld be nice if I could do it programatically ..
View 3 Replies
Sep 4, 2010
I'm trying to trigger functions when a mc is on a certain frame, but the code I have doesn't seem to be working.
I have this code on the main timeline
function test (e:Event){
if (test_mc.currentFrame == 6){
trace("test_mc.currentFrame == 6")
}
}
And then in the test.mc itself, on frame 6 I have this code stop();
I've given it an instance name on the stage and it's not giving me any errors, but it's also not giving me any results.
View 1 Replies
Oct 8, 2010
I'm trying to use NetStream events from an FMS 3.5.4 server but am having trouble. I'd like to simply know when a video is playing, buffering, or idle. I know about Play.Start and Play.Stop, but these can mean the video is playing, or the video is buffering. Buffer.Full and Buffer.Flush can occur when a video is paused, playing, stopped, seeking, etc. I'm scouring over every event I get, but I really see no good way to determine what the exact state of a NetStream is at a given time.
View 1 Replies
Aug 5, 2011
We have a set of FMS's deployed on Amazon's EC2. One of the things we want to be able to do is automatically detect when we should start up another FMS instance. To do that, I've been looking for metrics I could measure on the local FMS box to help me identify "transition" points, e.g., when we should add capacity or remove excess capacity.
I ran some load testing to find out where the capacity limits of a particular box, but ran into a couple of problems[code]...
View 9 Replies
Jul 9, 2010
I need to swap a JSP form with a Flash form should the user have it installed. I know there is a JavaScript option, but don't want to use this as that cuts out people who have Flash but not JavaScript.
View 1 Replies