ActionScript 2.0 :: Moving A Ship Out Of .as File With Mouse?
Dec 5, 2010
I've been trying to move a ship for a game with my mouse out of a .as file, But the ship just won't budge!
ActionScript Code:
class Ship extends MovieClip {
function onEnterFrame() {
[Code].....
View 9 Replies
Similar Posts:
Apr 23, 2010
Been making a site and came across a problem. I want to have a ship movieclip follow the mouse slowly and rotate and flip on horizontal axis according to the mouse potition. I've been looking on this Here's the code on the timeline I got so far but it just makes the movieclip follow the mouse;
Code:
ship_mc.onEnterFrame = function() {
var xMouse = _root._xmouse;
[code].....
View 2 Replies
Apr 22, 2007
I want to know how i can moving my scene by moving a mouse over them.
to understand what i want exactly ckeck this link :- [URL]
View 1 Replies
Aug 24, 2009
[URL] when you have not clicked on all five dots, and you take the mouse of the stage, the interactive line should be deleted(graphics.clear(); ), and the little animation from the start should come back. my idea is to have a counter that ++ every frame, but when the mouse is moving on the stage the counter is constantly sett to 0. when the counter is, for example, 50 the animation i visible. do anyone have any methods that don't give the 50(for example) frame wait? and i would also like criticism and ideas on the rest.
View 7 Replies
Dec 4, 2008
why i am getting spurious mouse_out events when moving the mouse down or right but not up or left over a Sprite?
View 3 Replies
Mar 19, 2010
hi i m new to flash and i want make a site in which the back ground moves with mouse just like URL...
View 1 Replies
Apr 24, 2009
Anyway, the "flier_mc" won't turn fully toward the mouse. I tried a few things, but it just keep turning away at some point.i can finally remove the pesky edge to edge teleport.
View 2 Replies
May 23, 2011
I built a slider that has two identical horizontal MC's nested end to end inside another MC so when you move the mouse left and right over the MC it slides right and left in an endless loop. My problem is that to stop the slider from moving, the mouse must be in the exact center of the MC and if a person moves off the slider somewhere to one side or the other, it keeps sliding. What I would like to do is set it up so that wherever the slider is when the mouse moves off of it, it simply stops moving. I was thinking maybe an _y parameter would do it (the MC is 18 px high) but I'm not sure how to code this.
Here's what I'm working with:
onClipEvent (enterFrame) {
xcenter = 467.5;
speed = 1/15;
[code]....
View 1 Replies
Nov 25, 2009
I have four buttons on the stage. Each one shows a block of text when when the mouse is rolled over it (the text is on the Over frame of the button's timeline). The problem is that some buttons get shown on top of the text. How do I make it so that when the mouse is placed on a button, that button is moved on top of all the others so that the text appears over all the other buttons?
View 5 Replies
Nov 25, 2011
I'm making a catching game and I only wanted the falling objects hit certain area on my catcher. My catcher is a girl with mouth open and I wanted the falling objects to hit only the mouth, not any other parts of her body like arms. So I made two objects, the full girl and just the mouth. How do I make the two objects (movieclips) move around with the mouse?I tried to embed one object into another but it didn't work....
This is actionscript I wrote so far:
package {
import flash.display.*;
[code].....
View 6 Replies
Sep 5, 2010
how do i trace the mouse is moving as3. ive place a movieclip on stage as i thought i needed one to write the code. as wasnt sure.
movieclip.addEventListener(MouseEvent.MOUSE_MOVE,m ouseMoving);
function mouseMoving(event:MouseEvent):void
{
trace("mouseMove");
}
View 3 Replies
Aug 9, 2011
I'd like to control a mc movement on_x direction (or _y) when the mouse mouves horizontaly (or verticaly). So when I mouve the mouse to the right the mc mouves to the lefht and it mouves to the right when the mouse moves to the lefht. It's for a window effect.
View 8 Replies
May 24, 2005
What I'm trying to build is what you could call a scrolling drawing board - just like a drawing board but when the mouse comes close to the edge of the window, it scrolls and lets you continue your drawing. I have no problem creating a drawing board with API, but i can't make it scroll. Usually when i want to scroll a background image i make it move along with the mouse when the cursor is near the edge of the window (for example, if the mouse's coordinates are above a certain number, the background image starts moving in one direction so it "scrolls" in the other direction). So i wanted to do this with the movieclip of the drawing in a drawing board (make it move according to mouse's coordinates near the edge of the window), but when i scroll i have to stop the mouse at the edge of the window because i cant go any further :p so the drawing moves but it stops drawing. Or maybe what i need is some way to draw even when the mouse is not moving.
View 5 Replies
May 24, 2003
Is it posssible in actionscript to see if the mouse pointer moves out from the movie?Or trace the mouse coordinates when it is outside of the movie?
View 1 Replies
Apr 11, 2009
like photoshop cs3 has, flash cs4 also... and probably some others...
a textfield which acts like a button and when you press and hold down the mouse and move up or right the value increases and when you move down or left value decreases.
how to do this the most efficiently... on a mouse_down how would I track where the mouse is moving and how much it has moved in what direction so i can ajust the value in the textfield?
View 8 Replies
Apr 16, 2011
I would like to make a similar effect with car movement found on that site:
[URL]
i assume that there will be something to do with "_x = _x+_xmouse" but how do i define the boundries and what about the wheel movement? Or maybe it would be better to do this as a MC and if x of the mouse is less than x of MC then prevFrame, if its more then nextFrame ? Have no idea how to put it all together
View 3 Replies
Jul 1, 2004
trying to make a MC to change s x location according to the mouse position. Les say that the Mc moves to x=100 when the mouse_x is > 300 and y < 200. and moves back when the mouse goes back.
View 9 Replies
Jun 19, 2009
what I'm trying to do is get the MC:glide to rotate towards MC:ship.
Code:
var theX:int = ship.x - glide.x;
var theY:int = (ship.y - glide.y);
var testVision:Number = Math.atan2(theY,theX) * (180/Math.PI);
[code]....
but that's not what I want. What I want it to do is make glide rotate TOWARDS ship, not always face it. I would also like for it to rotate, depending on which way is faster, clockwise or counterclockwise.
View 2 Replies
Aug 2, 2009
I have a ship on stage but I can't move the ship with keyboard
Code:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
[Code]...
View 2 Replies
Jul 8, 2009
I recently made a simple Flash file with video with an alpha channel and three simple buttons. It's a site tour video, and there's a button in the lower right to exit the tour that takes you back to home page. When you move over the "Exit Tour" button, it transforms in size slightly to highlight it. However, PC users are telling me that they can't see the word "Tour" on the button, only "Exit" until you move over the button, then they can see both words. The button functions perfectly on a Mac. Also I've been told that the video often appears choppy and sluggish on PCs, and not Macs. I'm encoding and streaming on flash media server - 400kps, CBR with alpha channel encoded, size 880x512. This is put on a stage size of 980x667 in Flash - is this is just too big of a window for streaming to handle? I have attached some files for reference.
View 1 Replies
Sep 29, 2010
I have a question about moving and animated player symbol to the mouse location on a MouseDown event. Right now I have it set up to do an easing so that I can control how fast the player moves to the location. Problem is that it is done with easing. I don' t like the easing because the velocity of starts really fast and then slows down before it reaches the mouseX and mouseY location. I would like just a plain ol' stroll from the player location to the mouse location on the MouseDown event. Here is my code:
[Code]....
View 8 Replies
Feb 9, 2011
Here is the code that I have, I know that these are the basic elements wihc I need to use, individually they work but together they don't
on (press) { this.startDrag(); } on (release) { stopDrag(); } }
this._y+= this._ymouse/4; this._x+= this._xmouse/4;
So what I am trying to do is to get the object to move slower than the mouse but finish moving wherever I let go of the click. So far I can get the object to move with the mouse without clicking and dragging at a slow speed but I cant get the drag to work at a slower speed, it will move as fast as the mouse moves.
View 1 Replies
Jul 14, 2011
It involves the player clicking on a moving movieclip which is boucing up and down on the screen. I started off using a 'mouse down' (not click, because the player must move the mouse before releasing it) event listener attached to the actual mc itself but this seemed to be horrendously innacurate. It LOOKED like I was clicking on the mc but was reacting as though I had missed completely. On the rare occasion that it actually detected a mouse down I thought I was some distance away.It seems that the object itself may be updating its position in memory before updating its position on screen if that makes sense? Has anyone had this issue before? Is there an easy way around it?
As a little test I used trace to output the calculated distance (using Point.distance(..)) between the mouse and the movieclip, most of the time it was returning values of between 70 and 90 pixles when I was definitely not that far away.
View 6 Replies
Feb 13, 2009
i am trying to find out wether the mouse is moving to the left or to the right but i reckon by storing the old mouses location and updating the new postion and store this in a varaible if thats possible
to update and check the mouse x and y postition on the stage saw i can locate
wether the mouse is moving to the left or to the right .
mouse old postion to the mouse new postion
example by using a variable
mouse_old_xpos. _xmouse
mouse_new_pos
this want i tried
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
mouse_oldxpos = _xmouse;
mouse_newrightxpos = ""
[Code].....
View 7 Replies
Oct 26, 2009
Im trying to move a movieclip only in X, deacourding with my mouse movement...i use this code... for when i enter frame....
addEventListener(Event.ENTER_FRAME, animFlor);
function animFlor():void{
speed = ( 400 + mouseX - this.x) * 0.004;
[code].......
View 3 Replies
Dec 17, 2009
My first post in Actionscript.org. but I'm a long time visitor / fan. I'm moving a object with mouse but using some easing values. means it will follow the mouse slower.
Here is the file.[URL].. How can i check hitTest in this situation. even if i do it normally...the object is passing the collision object simply before stopping..because its being moved with mouse..
[Code]...
View 0 Replies
Sep 15, 2010
It seems i cant find a solution to this simple problem! All I want to check is when the mouse has stopped moving? I know you can check if it is moving (onMouseMove) but cant find a way to check to other way around?
View 2 Replies
Jan 4, 2011
i got 5 bubbles on my stage and each is moving from the bottom to the top. additional i want to be able to push the bubbles with the cursor.this is working, but only on 1 bubble ...
ActionScript Code:
function image_move(e:Event):void {
for(var i = 0; i < bubbles.length; i++) {
[code]....
View 0 Replies
Aug 6, 2011
The player rotates to the mouse when you click somewhere and moves there. The problem is sometimes when you click on a corner the player rotates towards where you clicked but sometimes starts moving sideways.
View 3 Replies
Nov 30, 2005
On this site:[URL].. you navigate by moving your mouse over the picture.
How is that effect done?
Have anyone seen a tutorial och fla-file somewhere?
View 4 Replies