Moving A Movieclip Slowly
I have a movieclip in my flash movie that is set to drag on a mouse press. When it is released it snaps back to the specified x and y coordinates. I want the movement to be slow and not to fast. Is this possible?
Code: shania.onPress = function() { shania.startDrag(); }; shania.onRelease = function() { stopDrag(); shania.swapDepths(0); shania._x = 434.1; shania._y = 224.6; shania._alpha=20; };
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-16-2005, 07:57 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
AS3 Movieclip Moving Slowly
I have a game where the FPS are calculated on an On Enter Frame event...
and I have another event that listens for key presses (other for mouse events... but all are disabled...)
And I have game tiles loaded onto a movieclip in the following order...
Flex2Canvas.rawChildren.addChild(map);
map.addChild(thetilecliphere); <- that part is looped alot...at the start to generate the tiles
And then I go and press the down button, and move 'map'... and the game FPS drops from 40 to 10... so i moved the canvas, and it still droped... but nothing moved (strange), and then i went child by child moving them, and it moved again, but still the 10fps...
I tried cacheAsBitmap... and nothing... I would post the code, but with all the stuff inbetween it... it's like 700 lines long.... i'm giving a general over view... Is the problem based on the fact that I'm using the flex canvas to work off of?? Is there any way I can do my own 'canvas' like mc... that falls under the canvas, and before all the GUI? I tried adding children to the canvas and it didn't work.
Slowly Moving Smoothly - Moving Photos And Pixel Smoothing
So, I'm slowly....very slowly moving a small thumbnail across my stage. The problem is that when the pic moves over a pixel it looks choppy, I want it to look smooth. The border of it looks especially choppy, it's distracting from the site.
Is there a pixel-smoothing option for the stage? or some equivalent?
Does my question even make sense?
Please help.
Thanks
Moving MC From Right To Left Slowly
hi!
I have been trying to move my MC "logo" from right to left with the script:
for(bla bla bla){
_root.logo._x=_root.logo._x+100;
}
but my MC just sprimgs into position instead of gliding in.Can anyone help?
Thank you
Slowly Moving MCs ._x Position
hello,
I have a MC (line2) and when i click on different buttons, its x position changes.. the code below is what i am using... simple stuff so far.. how can i make it so that the line slowly moves to the new position, rather than just be there
Code:
_root.line2._x = 300;
Slowly Moving Mc Is Jerky
I am trying to move an image slowly across the stage but it looks jerky when it is slow. For testing I also replaced the image with a simple square shape and it still looked jumpy. The animation looks like it is jumping one pixel at a time.
During testing I alway put the frame rate at 30fps although I dont think this matters except when I tried it using the onEnterFrame.
I have tried using the tween class and set interval as well as onEnterFrame to move it and it looks OK fast but no matter what I do as soon as I slow it down it looks jumpy or jerky.
The effect I am looking for is to slowly move the image and then fade into another slowly moving image.
Here is a sample of a couple of the ways I have tried.
***********************************
this.attachMovie("img1", "imgOne", this.getNextHighestDepth());
imgOne.cacheAsBitmap= true;
imgOne._x= 0;
imgOne._y= 0;
import mx.transitions.Tween;
import mx.transitions.easing.*;
function movePic() {
var tw:Tween = new Tween(imgOne, "_x", None.easeNone, 0, -92, 10, true);
var tw2:Tween = new Tween(imgOne, "_y", None.easeNone, 0, -57, 10, true);
updateAfterEvent();
}
movePic();
***********************************
this.attachMovie("img1", "imgOne", this.getNextHighestDepth());
imgOne.cacheAsBitmap= true;
imgOne._x= 0;
imgOne._y= 0;
var nTimes:Number;
var nInterval:Number = setInterval( movePic, 100 );
function movePic():Void {
imgOne._x++
imgOne._y++
updateAfterEvent();
nTimes++;
if(nTimes > 100){
clearInterval(nInterval);
}
}
***********************************
Thank you
Greg
Exteranal Swfs Moving Very Slowly
In Flash 5 i'm loading external swfs into empty movie clips..The problem is that the animations inside them are playing very slowly.. Increasing the frame rate doesn't do anything, and if i shorten the tweens, it just makes things more choppy and sloppy looking, rather than smooth....
Slowly Moving Mc Is Jerky Or Jumpy
I am trying to move an image slowly across the stage but it looks jerky when it is slow. For testing I also replaced the image with a simple square shape and it still looked jumpy. The animation looks like it is jumping one pixel at a time.
During testing I alway put the frame rate at 30fps although I dont think this matters except when I tried it using the onEnterFrame.
I have tried using the tween class and set interval as well as onEnterFrame to move it and it looks OK fast but no matter what I do as soon as I slow it down it looks jumpy or jerky.
The effect I am looking for is to slowly move the image and then fade into another slowly moving image.
Here is a sample of a couple of the ways I have tried.
code:
this.attachMovie("img1", "imgOne", this.getNextHighestDepth());
imgOne.cacheAsBitmap= true;
imgOne._x= 0;
imgOne._y= 0;
import mx.transitions.Tween;
import mx.transitions.easing.*;
function movePic() {
var tw:Tween = new Tween(imgOne, "_x", None.easeNone, 0, -92, 10, true);
var tw2:Tween = new Tween(imgOne, "_y", None.easeNone, 0, -57, 10, true);
updateAfterEvent();
}
movePic();
code:
this.attachMovie("img1", "imgOne", this.getNextHighestDepth());
imgOne.cacheAsBitmap= true;
imgOne._x= 0;
imgOne._y= 0;
var nTimes:Number;
var nInterval:Number = setInterval( movePic, 100 );
function movePic():Void {
imgOne._x++
imgOne._y++
updateAfterEvent();
nTimes++;
if(nTimes > 100){
clearInterval(nInterval);
}
}
Thank you
Greg
Moving Mc Towards The Move Slowly Towards The Mouse
Hiya newbie here
I just want to know how to move a movieclip towards the mouse slowly.
i have used this code to get the mc to the mouse, but i am stuck on how i make it move slowly towards it.
please help
thanks
onClipEvent(enterFrame){
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Movie Clip Moving Slowly
hi all,
im just wondering , this always happens when i create a flash movie,, when 2 MC's runs together at runtime ,, the movie clips moves slowly ... can anyone give a tip about this?
thanks
Moving Mc Towards The Move Slowly Towards The Mouse
Hiya newbie here
I just want to know how to move a movieclip towards the mouse slowly.
i have used this code to get the mc to the mouse, but i am stuck on how i make it move slowly towards it.
please help
thanks
onClipEvent(enterFrame){
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Moving A Picture Slowly, But Smoothly... Ideas?
I have a .gif placed in a MC that I am using as a background for my flash movie.
I wanted the background to have a scrolling effect, so I added the following script to it's instance:
onClipEvent (load) {
_x = -100;
}
onClipEvent (enterFrame) {
_x += .5;
if (_x == -2) {
_x = -100;
}
}
This makes it so that the picture starts at -100, scrolls right until it reaches -2, then jumps back. Giving it a continuous scrolling look.
Anyway, I think it is a little too fast, so when I tried to slow it down some by changing the _x += .5; statement to _x += .25;, It does slow down, but it gets really jumpy-looking.
Is there any way for me to slow this down and have it still retain it's smoothness?
(I'm using Flash MX and this movie is at 30fps.)
Go here to see what it looks like now when it is set to .5
Thanks!
Lee
Carousel - Slowly Stops Moving On Boundaries
Hi,
I want the carousel to stop moving slowly when you get over the boundaries.
In the code below the carousel stops immediatly (speed 0):
Code:
this.onMouseMove = function() {
if (this._ymouse<20 || this._ymouse>150 || this._xmouse<20 || this._xmouse>780) {
speed = 0;
} else {
speed = (this._xmouse-centerX)/4000;
}
};
Thanks in advanced,
Bye Mario :)
MovieClip Run Slowly After Resize
Please help.
After resizing my MC(to 800x600 from 1024x768) with (_with and _height) to stage which contain an image than, effect(_alpha) applied to this MC runing too slow.
Unless resize work fine.
OnMouseOver MovieClip Move Slowly
Hello,
I am trying to create a slideshow and when the user hovers (rolls over) a down arror, the slideshow gradually moves up or down.
I've attached the file, does any one know I can get the slideshow of images to move slowley?
Cheers, Rob
Flash Component Loads Slowly Or Renders Slowly
Hi,
Does anyone have a problem with flash 8 components loading very slowly. I have a mainmovie page that loads other .swf files into a movieclip. The sub movie has got flash 8 components, basically, 4 buttons, 4 datefields, one combo box, one menu bar and one datagrid. When i load the sub movie into the mainmovie, the components flashes for a second and then shows the components. I use a moviecliploader as well to hide the loaded movie and only after it's loaded then show the loaded movie, still the components flash.
Any ideas as i have been trying to solve this for about 5 hours now. Any help much appreciated.
Thanks
Moving An Embedded Movieclip To Another Parrent Movieclip.
First the heirachy.
Code:
|----(MC1)
|
(_root)-----|
|
|----(MC2)----(MC3)
When I click on MC3 I need it to create a duplicate of itself inside MC1 so that it looks like this:
Code:
|----(MC1)----(Copy of MC3)
|
(_root)-----|
|
|----(MC2)----(MC3)
I can't use .attachMovie() since I need the script to be duplicated also. So I need to use .duplicateMovieClip() and somehow move the duplicate to the
How Do I Get A Moving Movieclip Stop At Another Movieclip
I got two questions, im using the movement code from the "RPG inventory and movement" tutorial. This is the code:
onClipEvent (load) {
moveSpeed = 19;
}
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown (Key.UP)) {
this._y -= moveSpeed;
} else if (Key.isDown (Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown (Key.LEFT)) {
this._x -= moveSpeed;
}
}
Is there anyway i can put something so the movieclip wont move through another movieclip with the tag "wall" for example. And one oter: How do i make it so that if the movieclip moves into another movieclip with the tag "exit" for example, it will switch frame?
How Do I Get A Moving Movieclip Stop At Another Movieclip
I got two questions, im using the movement code from the "RPG inventory and movement" tutorial. This is the code:
onClipEvent (load) {
moveSpeed = 19;
}
onClipEvent (enterFrame) {
if (Key.isDown (Key.RIGHT)) {
this._x += moveSpeed;
} else if (Key.isDown (Key.UP)) {
this._y -= moveSpeed;
} else if (Key.isDown (Key.DOWN)) {
this._y += moveSpeed;
} else if (Key.isDown (Key.LEFT)) {
this._x -= moveSpeed;
}
}
Is there anyway i can put something so the movieclip wont move through another movieclip with the tag "wall" for example. And one oter: How do i make it so that if the movieclip moves into another movieclip with the tag "exit" for example, it will switch frame?
Moving A Movieclip
i just want the movie clip to move when u press a button,
press LEFT key=movie clip slides left
etc.
Moving A Movieclip
i have 4 buttons, they are located next to each other, although not at equal intervals, their _x locations are:
A=30
B=80
C=110
D=190
i have another movieclip with an instance name of "dash". the original _x location of dash is 0.
here is what i need to do:
1. on rollover, of any of the buttons, "dash" needs to move to that button (example: i rollover C, "dash" should move to _x=110.)
2. on release, "dash" should stay above the selection.
3. on rolloff, if the button is not hit, "dash" should return to its previous location.
this needs to work between any of the buttons, A to D, C to A, etc.
thanks in advance for any help.
Moving Movieclip
How would I be able to hold down the left mouse button and move the movieclip until the button is released. I can get it to move, however, when I hold it down it carries out the operation once but doesn't continue to move when held down.
Sorry, im new to actionscript.
Moving A Movieclip
i want to know how to move a movie clip on the stage using buttons.
e.g. a button for left, button for right when the user presses these a movieclip in the background moves (movieclip moves right when left is pressed and left when right is pressed) if ya get what i mean!
so the user controls where they are looking on screen!
Ive got an idea for a project but need to know this before moving on!
Any help?
[F8] Moving A Movieclip
Hey there, I'm using Flash 8. Anyways, I'm having some issues with the code below. Right now the movie clip moves then plays halfway down. I don't want that. I want it to play, then move when I hit b1. So for example, when I hit b1, I want MC_Main to have already appeared, and played, then drop, and have MC_Photo move in, then when it's done moving, it can play, when MC_Main has dropped all the way. Am I on the right track or do I need to add some more code?
Let me know if that is confusing or not.
Again thanks for the help
PHP Code:
stop();
MC_Photo._visible = false;
MC_Resume._visible = false;
MC_Print._visible = false;
MC_Video._visible = false;
MC_GraphicD._visible = false;
MC_WebD._visible = false;
MC_Contact._visible = false;
MC_Main._visible = true;
b1.onRelease = function() {
MC_Photo._visible = true;
MC_Photo.play();
MC_Resume._visible = false;
MC_Resume.gotoAndStop(1);
MC_Main._visible = true;
MC_Main.gotoAndStop(1);
MC_WebD._visible = false;
MC_WebD.gotoAndStop(1);
MC_Video._visible = false;
MC_Video.gotoAndStop(1);
MC_Print._visible = false;
MC_Print.gotoAndStop(1);
MC_GraphicD._visible = false;
MC_GraphicD.gotoAndStop(1);
MC_Contact._visible = false;
MC_Contact.gotoAndStop(1);
//Movieclip GotoAndPlay Behavior
this.MC_Photo.gotoAndPlay("1");
//End Behavior
};
MC_Main.onEnterFrame = function() {
if (MC_Main._y < 550) {
this._y +=8;
}
};
b1.onRollOver = over;
b1.onRollOut = out;
b1.buttText.buttonText.text = "Photography";
function over() {
this.gotoAndPlay(2);
}
function out() {
this.gotoAndPlay(7);
}
Movieclip Moving
1st time post here...hehe...
can any1 give me a tutorial juz like this website?http://www.4thavenuejones.com/
i want like it moving the image...
Moving Movieclip With AS
Hi!
I'm quitre new with Flash and especially with AS. Allthought I have programmed another languages before. Well, I'm making simple animation, and I would like to move one symbol with action script. In my animation, ant runs to the left. Because this background must move to the right. Well, I have two problems. Firstly, how I can move backround symbol to the right? I tried something like:
earth.x+=4; and earth._x+=4;
after looking one example. However it won't work. Another problem is that earth's right side should appear from left when it is outside of stage's border so there don't appear white areas.
Example picture:
http://i10.tinypic.com/43gpbpg.png
As you can see, background appears from opposite side and follows itself. how I can do that?
Thank you very much! Help is appreciated
Moving Movieclip
What I'd like to do is have a movieclip slide into position when the user rolls over it and slide back when the user rolls off of it. This movieclip would house buttons that I could then click to navigate to different parts of my site.
When using the onRollOut action and onRollOut action for this movieclip I then lose the ability to target the buttons inside of this movieclip using an onPress function. From what I've read, it has something to do with button event capturing. Does anyone have code that will allow for a work around?
Thank you...
Moving Movieclip
What I'd like to do is have a movieclip slide into position when the user rolls over it and slide back when the user rolls off of it. This movieclip would house buttons that I could then click to navigate to different parts of my site.
When using the onRollOut action and onRollOut action for this movieclip I then lose the ability to target the buttons inside of this movieclip using an onPress function. From what I've read, it has something to do with button event capturing. Does anyone have code that will allow for a work around?
Thank you...
Moving A Movieclip In AS?
I noe this is very possible, I am just sooo dumb is AS
I want to rotate an object in AS because i think moving it manually is a waste of time
Thanks a lot!
-Dean
Movieclip X And Y While Moving.
Yellow again, I got a quick question , if I want to make a movieclip (for the sake of clarity we will call it mc1) match another movieclip's (mc2) x and y coordinates while mc2 is moving how would i do that?
Anyhelp is much appreciated, thanks in advance legion
Is Movieclip Moving?
im trying to make a function that tells me if my movieclip is moving
Code:
var thisPosition:Vector = new Vector(this.px,this.py);
if(thisPosition.x == lastPosition.x && thisPosition.y == lastPosition.y){
//movieclip isnt moving!
}else{
//inMotion = true;
}
lastPosition = new Vector(this.px,this.py);
but it doesnt work! how come? im using as3 btw
Moving A MovieClip
Question, I have a Movie Clip say McA and I insert another Mc called B into McA. McA has the registration point dead center. Therefore McB I believe has its registration point at the top left right. Therefore, how do I move the McB to be exactly over McA.
Assumption both Movie Clips are the same size, height=39, width=74. Also McB has a image in it. I tried using the _x & _y properties to align McB with McA but McB won't move at all.
I'm I missing something?
Moving A Movieclip In AS?
I noe this is very possible, I am just sooo dumb is AS
I want to rotate an object in AS because i think moving it manually is a waste of time
Thanks a lot!
-Dean
Movieclip X And Y While Moving.
Yellow again, I got a quick question , if I want to make a movieclip (for the sake of clarity we will call it mc1) match another movieclip's (mc2) x and y coordinates while mc2 is moving how would i do that?
Anyhelp is much appreciated, thanks in advance legion
Moving A Movieclip?
Lets say I have a circle mc on the root level, and on the same level, another mc thats a box..is it possible to duplicate the circle mc, and have it be a child of the box mc? im having a real hard time with this, can anyone help?
Moving Movieclip Levels
Can anyone help me out there?
I have six drag and drop buttons (button within a movieclip)all on the same frame. I need to know if there is a way to instantly upon pressing the button, to bring that button to the front so it will overlap the other buttons. (and vice versa if I were to click on any of the other drag and drops)
Right now the movieclips are layered (the ctrl, "down arrow" key, kind of layered)
any help would be really really appreciated.
Thanks
Moving Movieclip With Actionscript
I have a movieclip that sort of follows the cursor around. I want to have a button that you can click to stop it from following the cursor. When you click on this button I want to be able to take the movie clip from wherever it's at and ease it to a certain point (coordinate) in the movie. What would the actionscript be on the release of that button?
Thank you for any help,
Kyle
Moving A Movieclip Across The Stage
The script below moves a movie clip from the bottom to the top of the screen:
onClipEvent(load) {
// these values are initialised when this movieclip first loads
//maxY is the position at which we want to reset the _y position of the movieclip
maxY = 0;
//startY is set to the initial position of the movieclip
startY = this._y;
}
//the following script runs all the time (Ie: every frame even if the movie is stopped)
onClipEvent(enterframe) {
if (this._y >= maxY) {
// if the Y position of the movieclip is greater than the maximum required position
// then we move the movieclip by adding the value of 'speed' divided by our constant
// (we need to divide by a constant otherwise it will be too fast!
this._y -= _root.speed/_root.constant;
} else {
// when the movieclip reaches the max desired position we reset the Y pos to the initial value
this._y = startY;
}
}
I would like to move this movie clip from the bottom right corner to the left, then from the bottom to the top, and finally from the top left to the right corner all in one continous movement.
Can anybody help me please?
Help Moving The X Axis Of A Movieclip
I was wondering if anybody could help me or knows of a tutorial that shows how to move the x axis of a movieclip.
I am almost finished with a site and I have five main buttons at the top- Home - About - Services - Portfolio - Contact. Then I have placed a movieclip in the center of the stage with an image inside that has a width of 3740. This leaves 747 for each section. I need it to move over 747 for each section plus or minus and I know that from Home to Contact it will have to move 2992 but I think I can figure all that out as soon as I just figure out how to get it to move and set a speed.
Thanks in advance.
Check If Movieclip Is Moving
is there a way to check if a movieclip is moving? or isnt moving?
i am using an onClipEvent for tweening
thanks,
Moving A Movieclip Wih The Arrows
can anybody tell me how to make an object move from left to right and right to left when I press the right and left arrows?
I use Flash MX
Moving A MovieClip Thorugh AS
what im trying to do is when i press a button, i want the ball to move as if it were being tweened... but what it does with this code, is jump 25px... which makes sense, but its not what im going for....
PHP Code:
function moveImage(xDist, clipName) {
clipName._x += xDist;
speed = 5;
_x +=(clipName-_x)/speed;
}
push.onPress = function() {
moveImage(25, ball);
}
Moving A Movieclip, Is This Cpu Efficient?
I have a program that scrolls a MovieClip across the screen with the following code:
code: for(var i=0;i<100;i++) {
myMovieClip._x += 5;
}
I would like to know if using the Tween/Easing Class would make a more CPU friendly execution of this!
In the game I'm building, objects are dynamically moved around the stage in this manner. I'm wondering if I could improve the CPU load it inflicts...
[Help] Moving A Scaled Movieclip...
I have an movieclip which is scaled to 200% using the _xscale and _yscale properties. If an object WITHIN that movieclip is moved right 10pixels, will it appear to have moved 20 pixels?
[AS3]Moving And Playing A Movieclip
I'm trying to move a Movieclip with Keyboard presses and have it play as long as I am holding down the key. The code I have added below seems to move the clip but the Movieclip only plays the first few frames then pauses. I can't seem to figure it out. Any help is appreciated.
Code:
mclip.step=5;
mclip.pause= 1;
this.addEventListener(Event.ENTER_FRAME, listeners);
function listeners(e:Event):void
{
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
}
function keyDownListener (e:KeyboardEvent):void
{
if(e.keyCode==Keyboard.LEFT)
{
mclip.scaleX = 1.0;
mclip.pause=0;
mclip.x-=mclip.step;
mclip.gotoAndStop("walkingleft");
}
else if(e.keyCode==Keyboard.RIGHT)
{
mclip.scaleX = -1.0;
mclip.pause=1;
mclip.x+=mclip.step;
mclip.gotoAndStop("walkingleft");
}
}
function keyUpListener (e:KeyboardEvent):void
{
mclip.gotoAndStop("pause");
}
The movieclip moves but doesnt play completely.
Moving A Movieclip Across Stage
Ok I have tried for a month searching the internet for a script that I can adjust. What I am trying to do is build a nav bar similar to www.rbk.com.
PLEASE HELP! I can get the vertical bar to move with the mouse but I can not get it to stop at the button locations.
Here is the script I was using on the scene:
var Grn_follow = _root.Grn_follow_mc;
var speed = 15;
Grn_follow.onEnterFrame = function() {
//get the mouse position
var xMouse = _root._xmouse;
//get the distance between x
var xDistance = this._x - xMouse;
//now move the object
Grn_follow._x = this._x - (xDistance / speed);
};
And this was on the vertical bar:
onClipEvent (mouseMove) {
this._xmouse;
}
Or the other way I have it in actionscript is just thru the buttons...but I can not get the smooth transition from button to button that the above script gives me.
Ie:
on (rollOver) {
setProperty(this.Grn_follow_mc, _x, 10);
}
Am I doing something wrong? This maybe stupid easy for an expert but I am still learning. Blood sweat and tears my friends. Thanks again for any help!!!
Thanks,
Leo
PS forgot to tell you I am using flash 8.
[CS3] Moving Movieclip With Buttons
Hi all
I'm using Adobe Flash CS3 / ActionScript 2 to develop a site, the relevant part of which can be seen at http://www.pcmt.org/hidden/testsite/test.html
The black boxes underneath the 2x4 grid of icons are placeholder graphics for left and right arrows which move the icons above to the left and right.
The left and right buttons work, after a fashion, but I'm having difficulty controlling the motion.
As each button is pressed, I want to reveal one more layer of icons, and have the scrolling stop when the end of the list is reached. At the moment, one can use the buttons to scroll the icons off the screen.
Secondly, if the left / right buttons are clicked in very quick succession, the icons above do not display correctly - they're no longer centred in the mask above. Is it possible to have the buttons 'ignore' any clicks whilst the icons above are moving, thus ensuring that the icons always display correctly?
Finally, is it possible to have the left/right button disappear as appropriate when the left/right hand end of the menu is reached?
Here's the code I've been using to control the motion:
shirt_graphics._x=247;
shirt_graphics.onEnterFrame=function(){
cX=this._x;
difX=cX-XPos;
setProperty(this, _x, cX-(difX/2));
}
left_arrow.onRelease=function(){
XPos=cX+86;
}
right_arrow.onRelease=function(){
XPos=cX-86;
}
Any help would be greatly appreciated.
Thanks
Standard
[CS3] Moving A MovieClip With Keyboard
Hi all,
I'm trying to make a movieclip (with 3 frames) move using the left and right keyboard arrows. The third frame is when the image is still.
Also, do I need to create an additional .as file for the code or can I place it on the timeline?
I spent quite a bit of time searching the internets, but all the threads, tutorials and websites I found only teach how to do it in AS 2.0. I already read quite a bit regarding AS 3.0, but I still can't code it.
Here is the .fla file, but I removed most of the code because it didn't work.
Also, could you recommend a good beginners AS 3.0 book? All the books recommended here are a bit too advanced for me right now.
Hope you can help me out.
[F8] Moving Movieclip With A Mouseclick
Hello all, here's a little backstory on what im trying to accomplish. Im currently making a game that has one of those old-skool Fallout maps (a world map where you click somewhere and the "you" marker moves there) that im trying to replicate.
I already have the scripts ready for map interaction (using onhit here). But i was wondering if someone could help me with a script that works this way:
1. I have a movieclip (the character)
2. When i click somewhere on the map i want this movieclip to move there. Not instantly but moving over the screen to that point where you clicked.
3. I also want there to be passages that when the movieclip hit that
movieclip (named hit for example) it stops dead and doesn't move (will be used on the map for mountains and such) and the player has to click somewhere else to move it that path (im assuming this will be something like onhit: hit - speed=0 something but im not a good scripter and it would had to be worked into the script :P
4. ok this one is kinda optional but would be great! If it's possible to have it worked in the script that when the clip doesn't move (and is stationary on the map) the movieclip stays on frame 1 but when the movieclip is in motion (and moving across the screen) the movieclip is on frame 2 (and reverts to frame 1 when it's not moving anymore and so no)
And thanks ALOT for any help it's GREATLY appriciated
Thanks
Horizontal Moving Movieclip
I have a movieclip that I am moving behind a mask to achieve a panning effect. I am able to move my movie clip onRollOver and stop onRollOut. So far so good, except that I have no boundaries or margins on my movie clip so when I keep my mouse on my button, my movieclip continues to move indefinitely forever. Can someone please tell me how to set boundaries on the left and right or how to limit the scrolling to an X -1000 and X +1000?
Here is the code I am using. Any help would be appreciated.
Code:
left.onRollOver = function(){full.onEnterFrame=function(){this ._x+=30}}
left.onRollOut = function(){full.onEnterFrame = null}
right.onRollOver = function(){full.onEnterFrame=function(){this ._x-=30}}
right.onRollOut = function(){full.onEnterFrame = null}
|