ActionScript 1/2 :: Background Will Stop Following Mouse / When Press And Let Go Of UP
Sep 16, 2011
[code]the code works, but what i want is the opposite, what this does is makes it so when i hold down UP key the background will move according to my mouse.But i want it so the background will stop following the mouse when i press and let go of UP, so i dont have to hold it.
View 3 Replies
Similar Posts:
Sep 19, 2011
Currently i am using this actionscript to move my bg:
onClipEvent(enterFrame){
if(!Key.isDown(Key.UP)){
Mouse.hide();
this._x =-_root._xmouse+400;
this._y =-_root._ymouse+200;
}
}
This makes it so the background will follow my mouse, and when i press up key it will stop following, but when i let go it will still follow, i want it to stop perminantly even after i lift my up key without haveing a new frame involved.
View 2 Replies
Feb 1, 2008
I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly.
The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either.Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3.
View 9 Replies
Jun 17, 2005
i have an object that i want to drag and drop with the same event.Something like on press start drag and on press again stop drag. I'm sure it's pretty simple with and if and else statment but i can't find how to do that...The best i have done so far was this:
[Code]...
View 4 Replies
Nov 9, 2010
In AS3 how do I stop a repeating key press?I just want to press a key once and something happen.My code you hold the key down and the action repeats.
private function getkeyDown(e:KeyboardEvent):void {delete dict[e.keyCode];} private function getkeyUp(e:KeyboardEvent):void {dict[e.keyCode]=true;} private function check_keys(){....if (dict[Keyboard.DOWN]==true) { myplayer.movedown(mybackList); ...
View 1 Replies
Dec 1, 2009
I'm having the worst time figuring this out... Here is the movie I made: [URL] and I want it to stop, then when i press that circle, continue with the animation. right now i have a stop(); on frame 19 the button is named myBtn I have tried all kinds of myBtn.onRelease = Play() but when I do that, i get errors and it no longer stops...
View 7 Replies
Jul 11, 2011
I'm looking for some help regarding stopping sounds in Actionscript 3. Basically I'm making an interactive story game, basically a quiz game. On the main menu I have a narrator talking. What I basically want to do is have the track stop playing when you press the play button. I have the soundtrack playing already and the play button too. I just can't figure out how to get the sound to stop when I press the play button and it goes to the next scene.
[Code]...
View 2 Replies
Apr 8, 2003
well i'm trying to get this object to move on the press of a key (keeps moving if you hold it down) and stop when you release it, but all i'm gettin, is when you press it, it moves on forever and never stops....
View 12 Replies
Aug 7, 2003
I want to be able to stop a function from running by the press of a button. Is there such an inbuilt function? Like "stop function(myFunction);" or something..?
View 5 Replies
Mar 13, 2009
There's no problem in my computer at work on this issue. When I press on something that is draggable, it's dragged. When I realease it (or realease it outside), it stops being dragged. But it does happen in my boss' computer! what a coincidence! It happens to be something related to very quick double clicks. Sometimes, the draggable movieclip gets stuck to the mouse movement even if it has been released. Is there something to take control on this? or is it any issue from an old version of the flash plugin?
View 2 Replies
Apr 29, 2004
i'm trying to write the code for a flash animation which uses different movie clips and buttons.all the movie clips are in the same layer but i've written code to make all but one invisible when the animation loads.
dance._visible = false;
harmonica._visible = false;
violin._visible = false;
i've then got buttons which are supposed to make the movie clips visible, but then disapear again after the clip has played.i want to be able to press one button to have one clip start playing, but then i want to be able to press another button which stops that movie clip and starts a new one playing.this is what i came up with but it doesn't work
on (press) {
violin.stop();
harmonica.stop();[code]....
this script is from one of the buttons which is supposed to start the movieclip harmonica and stop violin playing.i've got the same code for violin but the other way round.when i press a button it works fine and plays the clip which then disapears (leaving a default clip which plays all the time visible) but pressing buttons to interrupt the clip and play another one don't work properly. the movie clips don't stop and reset when they are interupted. they kind of pause instead. when i go to play a clip that has previously been interrupted it starts from where it has been paused and not from the beginning
View 4 Replies
Apr 27, 2004
I have two arrows that control an animated movie clip that has words scrolling vertically. When you click on one arrow it plays the movieclip forward, and when you click on the other arrow it plays the movieclip backward. I want you to have to keep clicking on the forward arrow to have it continue animating through the different words. I've place stop actions at the points I want the movieclip to stop animating but when you click the forward or backword button it never stops and just plays through the whole thing. [URL]
View 6 Replies
Jan 6, 2003
on (press) {
/:klick = 1;
}
what does the /: do?? why is it necessary? couldnt u u use a _global.klick instead? (when i tried to change to global i used trace to see if it worked and the global doesnt get any character set when i press mouse..why is that? )
View 2 Replies
Jan 22, 2008
I have attached my fla. I want rotate the mc by Mouse drag. But its get some of the jerk.
View 1 Replies
Apr 3, 2010
i made a small game. the player needs to press as past as he can on the mouse before time runsout.
well, i want to send the score of the player by post (php)
i have read alot of guids but i didn't mannaged to do thise, so i came here.
[Code]...
View 1 Replies
Apr 26, 2009
i'm habing abit of problem with this code, its supposed to play pause and stop, the problem being that when i press stop then play it only plays from the last pause and not the beggining how to get it to play from the start after the stop button is pressed
[Code]...
View 1 Replies
Nov 2, 2010
i've imported a flv video file to Flash for the intro and i create skip button to go next frame..but when i press skip..it stop at next frame but the sound of intro still playing.
View 3 Replies
May 18, 2004
i want to capture a <tab> press on a frame action, not a mouse. how do i...
[Code]...
View 3 Replies
May 26, 2004
Before I start I would like to point out Im new at actionscipt. I want to move an object from a to b on a mouse press using actionscript to ease out. The only threads I can find involve huge scripts I know it should only be a couple of lines!
View 1 Replies
May 18, 2004
i want to capture a <tab> press on a frame action, not a mouse. how do i...
key.TAB = function(){
that's what i have to start..
View 3 Replies
Aug 1, 2004
I have a MC that follows the mouse. I want to do so the MC will smoothly/softly stop when i stop moving the mouse. Is it hard to code, And it would be very nice if someone could do some code for it
View 2 Replies
Aug 5, 2009
I would like to create an image sliding effect using next and previous buttons. For example the sliding images on the homepage here: http:[url]....I know this is not in flash, but that's the effect I'm trying to create using flash.
I followed the help quoted below. However, when I press the Previous button to rewind the timeline, the movie clip does not stop. For example, if I am on image 3 in the slider and press the previous button...instead of going to image 2, it slides all the way back to image 1 without stopping.
Quote:
ActionScript 2:Notice how, in the link to the example, all of the images/slides are the same size. Create a few of those before you begin.
1. Convert each image/slide to it's own Movie Clip, so that you can go always go back and adjust them if needed....as well as other useful reasons.
2. You only need 2 layers for now, Actions & Container. On frame1, add a stop action to the frame on your actions layer. Then, place all of your Movie Clips on the stage, on the Container layer. Line them up horizontally, edge-to-edge. Select them all and convert to a Movie Clip named "container".
3. On the Container layer, Insert A Keyframe > move the Container Movie Clip to the left so that the next slide is now in place on the stage > Right click in between the two Keyframes and choose "Create Motion Tween". You should have the animation from slide 1 to slide 2 now. Repeat this process for 2 -3, 3-4, 4-5 ......(don't worry about the reverse!)
4. We need to create buttons to go to the next and previous slide. Make a new layer called Buttons. Create 2 buttons, one for Next and one for Previous. These can be Movie Clips OR Buttons, just place them on the stage give one an instance name of "next_btn" & "prev_btn" (no quotes) for the other.
5. All that's left is to add some actions to a few frames on the Actions layer.
a) Add a stop action to every frame where the slide will be static (still), you should already have one on the first frame from step 2.
b) Now here's where the magic happens. If we test the movie now, the slides will just play and over. So add this code to the frame 1 on the Actions layer:
Code:
stop();//already have this stop action, just add the below
this.onEnterFrame = function(){[code]....
View 1 Replies
May 13, 2010
i am using this on Mc
onClipEvent(enterFrame){
diffx = _root._xmouse - this._x ;
diffy = _root._ymouse - this._y ;
[code]....
View 1 Replies
Jun 5, 2010
how to stop spray when the mouse is stop
import com.greensock.*;
import com.greensock.easing.*;
stage.addEventListener(MouseEvent.MOUSE_MOVE,spray Flowers);
[Code]...
View 9 Replies
Nov 13, 2010
I have a sound clip that I'm loading externally into my flash file. The code I'm using looks like this and is placed in the as layer on the first frame,
var mySound:Sound = new Sound();
var myChannel:SoundChannel = new SoundChannel();
var myTransform = new SoundTransform();
var lastPosition:Number = 0;
mySound.load(new URLRequest("introaudio.mp3"));
myChannel = mySound.play();
[Code]....
View 14 Replies
Jul 17, 2011
I'm running FMS 4 Dev on my win XP SP3 machine, also running flash cs5 professional on same machine. I get the server admin screen to come up and it says it's running. I'm using a tut book on FMS and trying to run the first script in the book. It's long but I'll add the script at the bottom so you can see what i'm doing. In the server app folder I placed another folder called vid2 with nothing in it just like the book told me to do. I wrote the script line for line out of the book. When I test my movie it lays out my video window and buttons. It diplays my ugly mug on the screen. when I press the record button it does nothing. when i press the stop button the output window shows me an error of "#1009 can't access properties or methods of a null object". I assume that this is telling me I do not have a net connection.
when I types in the example it had an IP address in the code.How do I know the correct IP addy to my dev server? If I'm doing development and testing on the same machine do I even need to know this? 2) How will what I'm doing now differ from leasing space from an FMS provider?
the script:
package{ import fl.controls.Button; import fl.controls.TextInput; import flash.display.Sprite; import flash.net.NetConnection; import flash.net.NetStream; import flash.events.NetStatusEvent; import flash.events.MouseEvent; [code].....
View 2 Replies
Mar 18, 2009
Im trying to animate a scrolling background which is simple enough. I dont want the background animation to scroll when the game is first loaded, I only want it to begin scrolling after the play button is clicked.
Ive used stop(); command in the first line of the MovieClip instance that is the back ground.
Some things I have tried
- Coding in flash to scroll the background, add a check to see once the background reached a certain x.position on the stage, it would addChild the same instance, where it originally was located and repeat the scroll process. I couldnt get this work, but would be intersted to see how you guys would approach it.
-Tried using a gotoAndPlay(2); in the movieclip last key frame to repeat the process. This causes the animation to chop up. I tried using this several diffrent ways, I could get it work at one point. But the background would scroll before the button was even clicked, I couldnt figure out a work around.
View 3 Replies
Oct 29, 2009
I'm trying to stop my back groun from scrolling when it reaches end of the back ground .it's not working....
var sceneTwo:Number = sceneTwoSprite.width-stage.stageWidth; var negate1:Number = Math.abs(sceneTwoSprite.x); var difference2:Number = Math.abs(sceneTwo);
if ((sceneTwoSprite.x)+sceneTwoSprite.width <= stage.stageWidth) {
sceneTwoSprite.x == stage.stageWidth + difference2; }
View 11 Replies
Mar 2, 2012
I am trying to make a horzontial flash scrolling background and I cant seem to get it to stop at the last frame.
[Code]....
View 15 Replies
Aug 28, 2009
again fixed, now all i need to know is how to pause the background, and then have it continue playing when the "aim" animation is finished.
heres the AS2.0 of the actions: // set counter
counter = 0;
fire_button.onRelease = function(){
[code].....
View 4 Replies