ActionScript 3.0 :: Location Of Movieclip On Guide?
Aug 14, 2010
I have a bouncing ball movie clip that is being controlled by a guide layer. As the ball bounces I am rotating both the guide layer movieclip and the ball movieclip.
I need to find out where the ball is in relation to the stage. When I look at the balls x and y values they are in relation to the guide layer movieclip.
Is there a way to relate the location of the ball to stage coordinates as it rotates?
I'm trying to get a movie clip to follow a guide layer using action script. One thing that I have to do is "Create a movieclip and put it on a guide layer. Have it go along the path."
I'm trying to get a movie clip to follow a guide layer using action script.one thing that i have to do is "Create a movieclip and put it on a guide layer. Have it go along the path."
I posted this question a few days ago but didn't get a response, so I think perhaps I put it in too specific a context. I thought I'd try again and couch the question in more general terms this time. Unfortunately I can't move on with my work until I get this issue solved!
What I need to do is find a way to see if there is a MovieClip at a particular spot. So, say I have a random point and a bunch of random MovieClips. At this random point, there may be any of the MovieClips or there may not. I won't know what these are in advance. I need the ActionScript to tell me if there is ANY MovieClip at this random spot - and, if there is, what MovieClip it is.
I'm creating a history timeline and I would like to make sure that when the dragger on the scrollbar is on a certain time period, the movieclip is on that time period as well. Is there a way to have the dragger to listen for when it reaches a specific time period on the scrollbar and have it align the movieclip appropriately?
I am working on a flash file that imports xml data. This data gets run through a for loop and each xml child gets its own movieclip called menuItem. Then the various instances of menuItem are randomly placed on the stage. However, they always overlap to some extent. I don't want this.
So, how would I make sure they don't overlap? I looked at the hitTest function but it seems to require 2 different movieclips to check for the collision. I only have one movieclip with multiple instances.
I am trying to make an object tween from its starting location to the location of a mouse click. I have a script, but it has a very annoying ease to it.I would LIKE the object to mantain a certain speed during while traveling from its starting location to the mouse click location.
I created a simple button that displays an error messeage: "error opening 'url" when I test the movie, but does play and opens in browser after publishing. However, it won't open in the browser in a different location. I pasted the html code in a web page but it doesn't work there nor opens in the browser in a differnet location from where it was originally published and saved. Why is that?
I've set up an associative array and then loop through each object in the array to animate it.Later on, however,I have a function that will manipulate these objects.How do I set up a command in the loop that will track the location of each object for later use in the next function, as each of the objects will continue to move around the stage until user presses key to send them to another location? (the final location for the tween is known, but not it's original location as it's free to move around until the tween function is activate).I'm looking into getChildIndex, but can't find enough info to understand how this works and whether it's what I need.
My problem is that I have a moveiclip (called "clip") and I have other movieclips on that stage that are "branches", and those branches are made up of branch parts. These branch parts are in a movieclip called (branchpart) and some of these have been placed on the branch stage. When I am on the clip stage and I try to get the location branch[i].branchpart[j].x and ranch[i].branchpart[j].y,this location is given in the coordinates of the branch stage, not the clip stage. These branch parts are being moved in complex ways with respect to one another, so I am hoping that I can simply access the location on the clip stage of a single part without having to deconstruct the whole branch.
I want to code a button to duplicate a movieclip instance and I want it to move to a random location within certain boundries. I can duplicate it okay but i can't figure out how to move it.
Code: moviclip.swapDepths(movieclip._y); and it worked perfectly.
but I decided that I wanted to continue the development of the game in AS3 (so that it will be more up to date and I could learn the new syntax), and I found the equivalent to swapDepths is setChildIndex. so I followed the new rules and came up with this code:Code: setChildIndex(character_mc, character_mc.y);but, sadly it does not work the same. the game becomes extremely laggy and almost unresponsive, but becomes normal again if I remove the code. So, my question is how can I add a similar code for this to work properly.
Here is my setup, I have an MC with a line, this line is tweened to move to the right, using a custom easing tool, it has a very elastic animation to it. It then, with similar elastic effect, moves back to the left. I also have an MC with a box placed directly right of the line. What I want to do is get the box to contract then expand based upon the x location of the line mc. My reason for this is that the elasticity of the animation for the line would make it very difficult for me to do this manually get the effect I desire, so I'm assuming theres some simple property I can use that calls the location of x then sets the proportions of the box based upon that.
I've creating a site that has a long horizontal line of fullscreen background images. Currently, moving the mouse left and right scrolls the images right and left.
I also have left and right arrows also for cycling through the images. I have several arrays with various bits of data about the images to help with the cycling. 1 array contains all the widths of the images Another contains all the x positions of the containerClips within image_mc.
The images are in a mc like so mcholder.image_mc.containerClip0 mcholder.image_mc.containerClip2 mcholder.image_mc.containerClip3 ....
mcholder is on the root.
What I would like to do, is instead of continuous scrolling left and right, I only want the user to be able to scroll about 20-30px past each image, (I'm guessing based on the current image_mc._x
When a user clicks an image it tweens into place and onComplete function stores the current image_mc._x value in a currentImageX var.
I'm not sure how to this to limit my left and right scrolling when not clicking.
supposing there is a movieclip in stage.. let's say its a circle with an instance name of "theCircle"..
the circle has to move / go to / animate to a random location on stage every 5 seconds... basically, the circle should move to the random location, stop and wait for 5 seconds, then move again to another random location.. again and again...
the code below is untested and incomplete.. but it is what i am trying to do... how i should go about this...
ActionScript Code: var randomXPosition:int; var randomYPosition:int; var positionTimer:Timer;
[Code]....
on the moveCircle function, i can simply set the X and Y of the circle equal to randomXPosition and randomYPosition... but that would just change the location of the circle, not move it.. i am trying to make the circle animate towards that location at a constant speed..
When I click on the button, it should bring me to a specific location which is inside the MovieClip, and that works. However, from inside that MC, I want to click on the same button, it should bring me on the main time line. How to do that? I am making of a variable (boolean) here. Is there something wrong in my code? (see path.fla)
(b) How do I remove a movie clip? (see path2.fla) When I clik on the square_btn, it brings me to a location inside that movie clip where there is an oval button. When I reach that oval button, I want the square_btn to me temporarily removed on that page.
How can I check if the stage contains a movieclip on a specific x and y location on the stage?I'm building a colour-guessing game. The purpose is to walk a path through a generated field of hexagons, each assigned a random colour (yellow, red, blue or green), based on what soundfile you hear. So if you hear "yellow", you have to click a yellow tile etc.But because I want it to be a path, and the colours of the tiles are randomly generated, I have to check which colours border the currently active tile. I literally have no idea how to do this. I thought this might work but it doesnt:
if ((this.tile.y == (event.currentTarget.y - 64)) != null) { //add the colour of this tile to array }
I want to align some text to a path but I want it so that the each letter in the text follows the path and goes around curves and stuff. I don't just want a block of text following the path. This is what I am getting no
I have a simple problem, i have only the basic knowledge of AC3 like making simple tweens and doing some if else.
But as you can see, i have a triangle and a motion path. And lets say i need it to tween with an easeIn to the x location of my mouse, so the y location remains on the path, how would i do that?
i am using CS4 on a PC, and I have created my motion guide layers as I normally do, created a path, but when I scrub the playhead, the symbol just goes from point A to point B without follwing my guide. Also they are not snapping to the guide. I have not done a motion guide in a while, what am I missing here. Also where is the pallete to turn on object orienting?
I received a Flash project from an outside source. In it I found that some library items had these grey, dashed guide lines. It seems like they are used for assigning resize boundaries or something. Anyways, i can't reproduce them in my own library elements nor can I find any information on them.
I'm a beginner in Flash-AS, and I have been spending a lot of time on a (simple?) problem, still I didn't find anything that helps me. Here it is: I would like to place (via ActionScript) an object (let's say a ball) along a curve (free-shaped). The position of the ball is defined by a percentage in relation to the length of the curve : for example, 0% or 100% put the ball at the start or the end of the curve, 50% put the ball exactly at the middle of the curve... I don't need any animation, I just want to place the ball at the initialisation.
Using actionscript I'm drawing a line. For the record let's assume it's shape is completely random. Can I use the line as a motion guide for another graphic? If so how? Can I convert the line to an array of Points somehow?
I know there are a ton of AS masters around, and am wondering if you ever used this book, did it help?I can't wait until I get it... my AS up until now has been half assed and improper.