ActionScript 3.0 :: Making A Movie Clip Rotate In 3D Space By Clicking And Dragging
May 19, 2009
So far my logic seems fine for half of the experiment, however, not the other half:[URL] What I'm trying to accomplish is when a user holds down the mouse and drags it across the stage the movie clip will rotate in 3D space horizontally. That works, however, when the mouse is released the movie continues to rotate along with the mouse position. When the movie clip is clicked again then it will stop rotating, but it cannot be clicked and dragged a second time. The link above explains it the best. Also I want to make it so the movie will start to rotate when the mouse is down anywhere on the stage and not just the mc itself.
[CODE]....
View 6 Replies
Similar Posts:
Jun 10, 2009
im making an intereactive map and i have certain areas in the map where you can click and a video pops up so you can view real footage of the area. I just need help making the video pop up like how to import it and whatnot.
View 1 Replies
Jul 18, 2011
I'm making a project, So I've got several questions..
-How do I make the Movie play or pause by the click of a keyboard or a mouse button?
-How do I Open another SWF within the SWF (loadMovieNum doesn't work anymore )
And last question is How do I move the "video app" I actionscript'd and make it larger . Here's the code I used to put the "video app".
Code:
var camera:Camera = Camera.getCamera();
camera.setMode(550,400,60,true);
// setMode(videoWidth, videoHeight, video fps, favor area)
// Now attach the webcam stream to a video object.
var video:Video = new Video();
video.attachCamera(camera);
addChild(video);
View 1 Replies
Jan 31, 2009
So I have an array of eight mcs arranged in a circle around a larger mc and I want to make it so the user can click and drag any one of the mcs in the array and it will cause them all to rotate around the larger center mc. I can rotate one clip around using an ENTER_FRAME listener but since I want them all to rotate and not until the user clicks and drags.
View 0 Replies
Apr 5, 2011
how to imitate a reflection of a movie clip in a "mirror." I don't know if I should have the initial movie clip on custom cursor or have it set to drag... but either way I don't know how to make the second clip the "reflection follow along. Obviously it would need to follow at a slightly offset pattern so that you would be able to see both clips (or majority of them) at the same time. It's for a school project that is due at 9am tomorrow so time is of the essence!!
View 4 Replies
Apr 26, 2004
I wanna to restrict some area in a movie of dragging a movie clip. eg . if there's a square (or a mazed shaped area) in the movie. a movie clip cannot entered inside the square while dragging. but it can be dragged rest of the space.
View 1 Replies
Jan 31, 2004
I'm making a movie that makes a baseball cap rotate as long as a button is pressed. How can I do this?
View 2 Replies
Jan 18, 2009
I am new to action script (using AS2). I have a symbol (a button that looks like an arrowhead). I've used the code below to drag the arrowhead around the stage (where "arrow" is the symbol's instance on the stage)
But, I want the "arrowhead" to only be able to be dragged along a particular path -- picture a curved line that looks like a smile. SO, the user can only drag the symbol along that curved path.
[Code]...
View 1 Replies
Apr 1, 2011
what im doing is the user drags the lego piece from the tray and drops it on the red square and the next piece arrives to do that again and again. The issue is that sometimes it screws up and doesnt go to the next step or goes backwards in steps like its hitting invisible pieces. heres a link to the project in action on my [url]......
The code I am using to drag and drop is attached in a text file to check out if needed.
View 3 Replies
Jul 31, 2003
I created a button that duplicates a movie clip, I want the user to be able to drag the duplicated movie clip. Right now, it duplicates the movie clip but when I try to drag it, it moves the first movie clip (the one being duplicated) instead of the one which was duplicated.
View 6 Replies
Oct 19, 2009
i've built a little game, where the user can drag and drop objects on a canvas. there's a button wheren the canvas turns black, and the objetcs (images) become white, like a photographic image. What I'm trying to do without sucess until now, it to make the draggable objects infinit, so the user can drag as many objects as he can.
View 1 Replies
Jul 5, 2009
I could code in movie clip by clicking on movie cilp on the stage but in As3 I could not do . Is this restricted to code on movie clip ?
View 7 Replies
May 30, 2007
What action script would i need to make a button in one movie clip goto and play a frame in another movie clip? Im not very good at flash but i've been trying my usual codes but it dont work..
View 2 Replies
Jun 30, 2011
I'm working up a flash file that will eventually be controlled by the Kinect. So I've hidden the mouse and put a startDrag on a custom cursor. The problem is that I can't get a reliable result for a hover/over state when the cursor is over a movieclip. It only registers the over state sometimes and when it does, it's very brief, even if you hold the cursor over it for a long time.The problem seems to have something to do with the drag or the enter frame listener. It's like it can't process fast enough to realize when it's over the buttons.
ActionScript Code:
stop();
import GlobalClass;
[code]......
View 0 Replies
Jul 2, 2009
I have created this swf that allows me to drag my movie clip around with easing effects.However, if I drag it too fast, my movie clip will actually goes out of my "flash".PS: I actually got this script from a user in this forum. Sorry about that. Hence, i left the credits there.)Is there anyway where I can set the boundaries where the movie clip can be dragged to? I've came across a website where the effect of dragging within a specific area is exactly what I desired.Also, I'm using AS2 and here it is.
//Tutorial criado pela Cabana Cro: www.cabanacriacao.com
//Visite tambm o Cabanoblog: www.cabanacriacao.com/blog
_root.myMC.ease = 5;
[code].....
View 1 Replies
Apr 26, 2004
I was wondering what the best way is to play a movie clip while dragging a button inside a separate movie clip. Example: I'm creating a children's book in Flash form. Some childrens' books have movement using a pull tab on the side of the page. I have created two things for one of these pages:
A) The pull tab movie clip consisting of a button inside of it. Its code is as follows:
on (press) {
startDrag(toggleDrag2,false,596.5,118.0,666.5,118. 0);
}
on (release) {
stopDrag();
}
This way (and it works), the pull tab cannot be dragged along the y axis, and its movement along the x axis is restricted.
B) A movie clip with a symbol in it that has a motion tween, 75 frames, a stop action and key frame on each of the 75 frames.
[Code]...
View 9 Replies
Jan 19, 2005
We all know how to drag a movie clip: my_mc.startDrag(target,[lock, left, top, right, bottom]) But does anyone know how to drag/restrict a movie clip to a 45 degree angle?
View 5 Replies
Feb 4, 2004
does anybody know a way to use a the mouse to move a movie clip in one frame without dragging? what i'm shooting for is moving a map in the opposite direction of the mouse (mouse moves left, map moves right, mouse moves up, map moves down) and continues to move. not just one jump, but real motion. i've thought of initializing a getTimer after the mouse moves past a certain point and of moving the map after the mouse rolls over a hidden mc.i have only one stopped frame to do it in. it must be action script....
View 6 Replies
Feb 4, 2004
Does anybody know a way to use a the mouse to move a movie clip in one frame without dragging?
what i'm shooting for is moving a map in the opposite direction of the mouse (mouse moves left, map moves right, mouse moves up, map moves down) and continues to move. not just one jump, but real motion.
i've thought of initializing a getTimer after the mouse moves past a certain point and of moving the map after the mouse rolls over a hidden mc.
View 6 Replies
Aug 25, 2011
I'm making a little engine for a platform game, then plan to make the game, so far i have this[url]...
the box rolling is just an animation, but i'd like to know how i would make it rotate in a similar fashion using actionscript.
View 1 Replies
Feb 7, 2010
My project has a center-registered movie clip with a z-axis setting of 850 that I need to keep centered on the stage at all times, including when the stage is re-sized.Code like this for centering 2D objects doesn't seem to work:[code]My guess is that I need to convert the movie clip back into 2D space somehow, center it using the code above and then change the z-axis back to 850.
View 4 Replies
Jul 17, 2011
I want to rotate a movie clip with the mouse and I have this code:[code]Neither looks like what I want. The first image is okay until its rotated, and the second is blurry but looks better than the first when its rotating.So I have two questions.Is there a way to get better image quality when my image is rotating with out using a bitmap?Can some one give me a code example that changes the frame in the symbol based on the position of the cursor to the symbol?
View 1 Replies
Nov 20, 2010
I have a button on the stage called 'play_btn' and a movieclip called 'movie_mc'. The movieclip has a stop on it's first fame so that it doesn't play on the main timeline. I want to use actionscript to have the movieclip play when the button is clicked.I know i need to do some kind of movie_mc.gotoAndPlay('2') on the button or something like that.
View 1 Replies
Mar 15, 2011
I have a frame-by-frame animation. I want to be able to click and drag on the stage back and forth and traverse through the animation. I.e. I want to click and drag from left to right to make the animation go forwards and right to left to make the animation go backwards. How would I achieve this? I am making an assumption that there will be some maths involved in calculating mouse position and traversing to the correct frame, but how would I do this?
View 2 Replies
Jun 8, 2007
I am playing flv files on a site. The way I am bring them is via the import video from the library (not using flv component). I am loading the videos via using netStream. So far so good. Everything works fine. I want to be able to scrub through the video by clicking and dragging left or right on the video itself. I plan to make the mouse cursor turn into a symbol that has a left and right arrow when you roll over the video hence letting you know that you can click and drag left or right to forward or rewind through the video. IS this possible? If so, how can I accomplish this?
View 5 Replies
Jan 22, 2010
I would like to use a movie clip such as a rim from a car and rotate it on its x axis centered and then move it along the screen according to how much of the screen has loaded.here is what I have so far sorry it may be a little messy:
stop();
//rotate the rim
rim_mc.addEventListener(Event.ENTER_FRAME, rotateRim);
[code]....
NOTES: the function rotateRim works correctly rotating the rim the var xpos provides me with the correct position i would like my X position to be and traces it out perfect upon test if trace is coded for it.
View 1 Replies
Feb 11, 2010
Basically what I'm trying to do is make a sundial-style clock animation. I'm using AS2 in Flash CS4. I'm still quite new to Flash so my AS know-how is slightly limited...
I want to get the time from the user's computer (I'm using getHours) and make a line (movie clip) rotate to a certain angle based on the hour. Eg. 1pm = 13 degrees, 2pm = 26 degrees and so on. This is the script I have so far and all it seems to do is rotate the movie clip to 90 degrees.
[Code]...
View 3 Replies
May 13, 2010
I'm working on a tank game for my Flash class that has a cannon that's supposed to rotate with the mouse. Unfortunately I can't get the rotation to work properly.
Firstly the cannon does not follow the mouse in full 360 degrees and does this weird rubberbanding "bounce" back to a previous position. Secondly when it does follow it does so in the opposite direction in which the mouse is moved.
The cannon is a movie clip and nothing is put on the stage (this is done by the code itself). Everything is located in the library and all the coding is done through AS files.
My experience with coding in flash is minimal, the past couple of weeks being my first exposure to it, just to give you an idea where I stand. Below is the code for cannon.
package
{
import flash.display.MovieClip;
import flash.events.Event;
[Code].....
View 3 Replies
Jun 7, 2010
I'm working on a tank game for my Flash class that has a cannon that's supposed to rotate with the mouse. Unfortunately I can't get the rotation to work properly.Firstly the cannon does not follow the mouse in full 360 degrees and does this weird rubberbanding "bounce" back to a previous position. Secondly when it does follow it does so in the opposite direction in which the mouse is moved.The cannon is a movie clip and nothing is put on the stage (this is done by the code itself). Everything is located in the library and all the coding is done through AS files.My experience with coding in flash is minimal, the past couple of weeks being my first exposure to it, just to give you an idea where I stand. Below is the code for cannon.
package
{
import flash.display.MovieClip;
[code]......
View 1 Replies
Oct 17, 2011
I'm just trying to remove a movie clip from the stage upon double clicking
[Code]...
View 1 Replies