ActionScript 2.0 :: Make A Movieclip Face Another Movieclip?
Jan 22, 2009
I have found scripts to make them face the mouse, but when I try to tweak them to face another movieclip, they don't work.
For examples purpose make the MC: arrow face the MC: target.
View 14 Replies
Similar Posts:
Sep 17, 2009
I'm making a top down shooter and I'm encountering some interesting code lag with the function I'm using to make the player face the mouse.
Code:
//The function is called through a ENTER_FRAME listener.
//mX & mY are the current position of the mouse.
public function facePoint(mX, mY){
if(this.visible){
this.rotation = (-Math.atan2((this.x - mX),(this.y - mY))) * 180 / Math.PI;
}}
If I hold down two movement keys and then spin the mouse around the character really fast, it builds up some kind of buffer that sends the character out of control for a few seconds, even after you've released the keys. Just discovered that reducing the quality to low removes the issue entirely... so its a graphics problem. How to avoid this?
View 1 Replies
Oct 5, 2011
Working on a maze game. When the leftkey is pressed the movieclip (char) should turn 90 degrees to the left.
char.scaleX *= -1;
However, the most important thing is that the character doesnt go through the walls of the maze.And I think thats my problem for implementing the code above.Because it doesnt work properly when i put in here;
if(!mazehit) {
char.y += speed;
char.scaleX *= -1;[code].....
View 1 Replies
Feb 12, 2005
rotate a movieclip to face the mouse location
View 1 Replies
Oct 7, 2005
I have a problem with the rotating cube tutorial (link below):
[URL]
I'm trying to give an action to each face of the cube. I would like to make it a menu with 6 buttons (one per face)I want to launch a movieclip each time i press a face.
View 14 Replies
Mar 13, 2004
I'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 Replies
May 9, 2010
This 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]....
View 0 Replies
Nov 19, 2010
How do I make a MovieClip targetable even if it is covered by another MovieClip?
View 4 Replies
Jan 30, 2011
I want to be able to have my ketchup cursor and click on the buns and the buns go to the ketchup frame and vice versa with the mustard, but if the ketchup is already on then it would go to the frame with both mustard and ketchup.I would post my code but I dont really have much to post except the basic eventlistener function. I have googled it a million times and cant seem to find what im looking for.
View 6 Replies
Oct 17, 2006
What is the code to make a movie clip button....when pressed...open or plays another movieclip...example.i have a button..and its a movie clip with roll over and rollout effect..once pressed...how do i make it link to an outside movieclip.
View 6 Replies
Jul 17, 2011
I am trying to make a reference to a movieclip instance that is in another movieclip.
Here's the deal: I have a main timeline for different pages of a website...then within that I make all of the art on each page into a movieclip so I can do animations every time that main timeline frame is called to, yet still keep my main timeline clean.
Within one page's movieclip I have a few buttons that I want to use to go to other pages by referencing them on the main timeline.I have been using this: (home_about is the about us button on my home page, and frame 31 is on the main timeline).
home_about.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_6);
function fl_ClickToGoToAndPlayFromFrame_6(event:MouseEvent) :void
{[code].............
Since this home_about is within another movieclip,I get the access of undefined property error. Do I need to change the code I've pasted above or add in variable definitions to fix this?
View 1 Replies
Jan 13, 2009
Few days ago I uploaded my flash face morphing application and now I'm thinking of writing an article about creature process.URL... anyone curious about how I made it?
View 5 Replies
Dec 24, 2011
How would I go about doing this but not directly like 360. like lets say my mouse is to the left of the character the character would than face its left frame I made for him like lets say his left frame is frame 2.
View 8 Replies
Jan 21, 2011
I have one character which can face several directions: t, b, l, r, tl, tr, bl, br.The type of camera is top-down 2d
T stands for Top, which is when he is looking to the top of the screen
B = Bottom
L = Left
R = Right
The character can look to other directions, like the Top-Left of the screen, which is tl
How do I calculate which direction he should look to if I only have one variable, rotation?
View 1 Replies
Aug 16, 2011
I have my as2 code for my game im making so far the char can jump and move left and right. make him face the mouse like lets say my mouse is to the x- of my character than I would want his left facing movie clip (which I havent made yet) to be facing that way etc. where I could start heres what I have:
Actionscript Code:
onClipEvent (load) {var ground:MovieClip = _root.ground;var grav:Number = 0;var gravity:Number = 2;var speed:Number = 7;var maxJump:Number = -12;var touchingGround:Boolean = false;}onClipEvent (enterFrame) {_y += grav;grav +=
[Code].....
That's the movement code that lets me move left and right and jump with gravity
View 2 Replies
Jan 17, 2011
I have a movieclip in my library. I want to be able to make it appear on stage and be moved to where I want it to be. I will need up to 18 instances of this single movieclip
View 1 Replies
Jul 15, 2007
Is there a way to make a MovieClip reflection using fully actionscript 2?
View 5 Replies
Feb 22, 2009
I have 2 movieclips i want to make the gray movieclip follow the black moveclip that draged by mouse
i attach the project
View 3 Replies
Apr 8, 2009
I have a simple thin line, I want it to be 100% wide so it fills in the entire screen in width.
View 2 Replies
May 29, 2009
All I want to make a grid with movieClip. But I can't make no matter how much time I have used exploring and trying. I have 2 movieClips and button
1 - mc_main
2 - Row
Both movieClips are linked to classes. mc_main is on stage its a small dot. When I press button a new instance of Row should be attached to mc_main and should append.
PHP Code:
package{
import flash.display.MovieClip;
import flash.events.*;
public class Main extends MovieClip {
public function Main(){
[Code] .....
View 21 Replies
Jun 14, 2009
I've looked and looked but i cannot find any way of using as3 scipt to make a movieclip follow a path.
View 3 Replies
Nov 11, 2010
im trying to make a For loop that when run will create a movieclip containing 3 text boxes (title, summary, date) for each one of the XML items. Am i way off here?
Actionscript Code:
function onLoaded_2(e:Event):void{ xml_2 = new XML(e.target.data); xml_2.ignoreWhite = true; var il:XMLList=xml_2.channel.item; for(var
[code].....
View 1 Replies
Dec 6, 2011
How to make trail behind movie clip. I suppose it should be some kind of duplicate mc function but dont know how to write it. For example there is rectangle (mc) on screen when I click on it should move to the left but it should leave copies of itself behind it with different opacity, closer copies should be more visible and they all should fade out (I mean trail not main rectangle), it should look like circular animation which are often used in some flash video players where rectangles are rotating around center point but they aren't all same opacity.
View 2 Replies
May 25, 2010
How would make a movieclip and get it to drag. What code would I use?
View 2 Replies
Oct 14, 2010
I am working in a game development.What I wanted to know is whether we can create a movieclip from two different movieclips at runtime.
View 5 Replies
Oct 21, 2010
CS3 used to have this nice autorotate function where you could make a MovieClip spin - great for vehicle wheels and the like. Has this been deprecated in CS4? Can't seem to find it...
View 3 Replies
Nov 4, 2007
I'm just trying to simply make a movie clip draggable (it was all oh so easy in AS2!) I'm getting "1120- access of undefined property "waves_mc"). Yes, I have the clip named waves_mc.
View 9 Replies
Jun 17, 2009
I'm using flash 8/actionscript 2, I'm trying to load or make an existing movie clip appear on the stage.
Here's my script:
var shopBT:movieClip;
shop_btn.onRollOver = function(){
shopSUB.attachMovie("shopSUB", "shopSUB", getNextHighestDepth());
shopSUB._x = shop_btn._x + 5;
shopSUB._y = shop_btn._y;
}
View 9 Replies
Jan 10, 2010
I have an object on the stage (with an instance called mcBlackboard) that contains two buttons.
I'm trying to make these buttons link to pages on my site but I get the following error(s):
1120: Access of undefined property buttonAboutUs
1120: Access of undefined property buttonFAQs
My guess is that it's not finding the buttons in the movieclip (since the script worked fine when the objects were on the stage).[code]...
View 7 Replies
Jan 12, 2010
I've got an assignment where I have to make one movieclip disappear when it is hit by another. I used to be able to do this in AS2 but now I'm at a loss.
View 6 Replies