ActionScript 3.0 :: Move A Movie A Movieclip In A Trajectory?
May 22, 2009How to move a movie a movieclip in a trajectory? i.e, how to move a movieclip in a parabolic way using actionscript.
View 2 RepliesHow to move a movie a movieclip in a trajectory? i.e, how to move a movieclip in a parabolic way using actionscript.
View 2 Repliesthis is a piece of my code
PHP Code:
dirx1 = (Math.cos((-70)*Math.PI/180)*80);
diry1 = Math.sin((-70)*Math.PI/180)*80;
}
fire1.onEnterFrame = function() {
[code]...
it throws a movieclip at a degree of -70 and a power of 80, while applying gravity of 2 to the diry var anyway... i want to, instead of making the trajectory based on power and angle, make it based on a point on the screen (mouse click) so the bullet will end up at that point when i click that point, ive seen this in bowmaster or bowmaster 2 so i know it works for as2.
I have a canon, the user can see the force and trajectory and I want it to shoot and have the cannon ball thing go the height and distance it would in real life. I attached what I have so far, its just the canon and it lets you set the angle and force. It should give you an idea of what I mean if you don't know.
View 12 Repliesi have 2 movieclips: i want to move both of them but the second movie clip will only move if the first clip reach his final destination how do i do that?
View 2 RepliesOkay 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.
I load an image into a MovieClip. At a second time I want to move this image to another MovieClip.
View 1 RepliesI'm trying to make a movieclip move slower at a certent place in my movieclip. This means, that the speed needs to be lowered when e.g. showing af picture. Here is the situation. I have a movieclip running different pictures. E.g. the first runs for 115frames and fades out. Instead of runing 115 frames i want the movieclip to run 5 frames (picture fading in) and the stops or delays for 10sek and then goes to frame 6 from where the picture fades out. Where in the movieclip should i place this Action Script?
View 1 RepliesI am looking to move a movieclip (person) towards another movieclip(ball). I can do that fine but the ball is constantly moving and that gives me a lot of trouble.
View 6 RepliesThis may come across as beginner stuff: I'm working In ActionScript 3.0. I have a MovieClip called FloorStatusChanges and within it are two MovieClips called Floors and StatusChanges.The MC called Floors contains Three wireframe-looking floors(each floor has it's own MC).The MC called StatusChanges contains three buttons that have the Instance Names of FirstFloorButton, SecondFloorButton, and ThirdFloorButton.Within the FloorStatusChanges MC, I've set up a motion tween for these wireframe-looking floors to move into and out of the stage so that upon clicking one of the buttons in StatusChanges it would, in theory, cause this motion tween to happen. It has stop(); commands between every motion:Within the StatusChanges MC, there are 4 layers. 3 are for each button consecutively and 1 for the Actionscript. This is how they look:Here's the set of actions I've given for the first frame:
ActionScript Code:
SecondFloorButton.addEventListener(MouseEvent.CLICK, SecondFloorSelect);
function SecondFloorSelect(e:Event){
[code]....
I have made a movieclip and gave the frame this actionscript:
------------------------------------------------------------
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {[code]........
it moves fine and stuff but i was wondering how can i restrict the area in which the movieclip can actually move ? my flash file is 550px X 400px and i want to make it so that it can only move in 300px X 200px of the file if you understand ?
On the default page, I have scattered photos. Once "Clothes" is clicked, it contains a page flip. When the page flip is loaded, I would like for the scattered photos to hide. If this can't be done, then the page flip should be on top of the scattered photos. Right now it's not doing either. Reference: [URL]
View 15 RepliesI am working on an animated menu, and I have the animations for the submenus about how I like them. The only problem now is that you can work the menu in such a way that sometimes two menus are open at once. What I need as a solution is a bit of ActionScript that would work something like this on a button for Menu A:
on (rollOver) {
if Menu B or Menu C are at frame 15 (this is where the menu is fully expanded),
then have that menu gotoAndPlay(20) (where it will play till 25, clearing out the submenu).
}
I want to make a line, convert it to a movieclip and then put some as3 code that does this:When moving mouse only top of line follow the bottom of the line is always in its original position.
View 6 RepliesI got a movie clip, by motion i could able to move(motion) that around my stage.(500x350), but the same thing i need to do by actionscript.
View 3 RepliesIf I had a movieclip (_root.mc1.blah) and wanted to movie it to (_root.mc2) so I would end up with (_root.mc2.blah)
View 1 RepliesI would like to let a MovieClip to move from lets say _x 200 to _x 800. When the mc reach the _x 800 it should return to _ 200 and visa versa. I like to do this with AS instead of with motion tween.
View 2 Repliesi have a movieclip (mc1) that i am resizing with a tweening.prototype with easing effects and stuff... what i want to do is have another movieclip (mc2) to always position itself to the bottom right corner of mc1.. kinda like a mouse trailer but instead of mc2 following the mouse it follows the corner of mc1...
View 10 RepliesWhen using AS2 a mc when moved via AS would slide to the new position. I have some AS3 code, which when the left or right buttons are pressed moves the mc to a new position, but it just jumps to the new position instead of sliding.How would I alter the code so that it slides to the new position instead of jumping? I've searched everywhere and tried to add tweenLite but I really am stuck
Here's the code I'm using -
illleftButton.addEventListener(MouseEvent.MOUSE_UP , leftbuttonill);
function leftbuttonill(event:MouseEvent):void{
if (MovieClip(root).mainContainer.illustration.x < -40){
[code]....
How would I move a movie clip from a (non-specified) point, to a designated destination (in coordinates)? For example, move a movie clip named "Guy" to coordinates X=100, Y=100.
View 4 RepliesBasically, what I'm trying to accomplish is moving a movieclip towards the direction it's facing.I've been scoping around the net for different ideas on how to do it, but I've only found AS2 tuts.
What I've done already is making the movieclip rotate around it's own center when the user presses either the left or the right arrow-key.What I'm now trying to accomplish is to make the movieclip move forward to the direction it is currently facing when the user presses up and vice versa for pressing down.
I have a movieclip.Its current y is 0, and i want to move it to y 100How im currently doing it isonenterframe { Y += 2 }how would i do it that it starts off slow and ends slow but speeds up in the middle?
View 1 RepliesI've 3 different MovieClips that I need to move at the same time across the screen. (From bottom to top) What is the best way of doing this without using a tweening class like Caurina?
View 2 RepliesHow do I move a movieclip that is in a place of x and y screen by dragging the mouse? Did not want to use the startDrag because he actually drag the movieclip to the pointer.And it finishes removing the movie clip to the place it should be.
View 0 RepliesAt the start of my movie (its a game), you press a button that moves you to the second frame where the game starts when called by a function on the main timeline called startThisGame(). A symbol called "player" is spawned from a class called Player and when right or left arrow are pressed it responds by moving left and right. Problem: The "player" wont respond to key presses unless I first click anywhere on the actual game window, either in test mode or after publishing. This did not happen before and now it does.
View 3 RepliesI need to create a button inside MC1 that will send me to the frame2 of the main timeline, but to and to a specific frame in MC2, which only exists there, as I said.
If that is not possible, is there a way to create this button in the main timeline?
I have a movieclip called bar_mc that I would like to move when it gets to a certain time, I'm trying to use this code but need to move the clip the same time everyday but cant seem to work out how to change the code so that it works on just the time not the day. reason I dont want to use the day is because I need to move the movieclip 24 times a day rather than 168
ActionScript Code:
var my_date:Date;
var my_timer:Timer=new Timer(1000);
my_timer.addEventListener(TimerEvent.TIMER, onTimer);
[Code].....
I am building a time/date line and I have a slider that displays information when you slide over certain points on the line. I woud like the slider to start at the correct month when the movie starts. So I expect this would involve flash calling the date from the users pc and starting the slider at a pre determined position on the stage for that month.
View 11 RepliesWhat script do I need to make this:If I click 300px from the left, and 10px from top, that the movieclip move's to 300px from the left and 10px from the top. Sinned-B
View 2 RepliesI have a set of button for moving the movieclips up, down, left and right. And I wonder how to make it so that I can move the three movieclips together at the same time when I press the moving button .
View 3 Repliesi want to move a certain movieclip from a point to another , and i know this can easily be done with a few lines of code ...but just a few days ago i ran across some piece of code that you just entered the x and y positions of were you wanted it to go and the speed at which it should go there...i even saw a command were it would slide in to the position ,, slowing down the closer it got...
View 1 Replies