ActionScript 2.0 :: Pausing A Function - Enemies To Stop Moving?
Mar 1, 2006
I'm making a game where if you hit something, an .swf appears over the game. During this time, I want the enemies to stop moving. The enemies are set up to move randomly onEnterFrame. I've tried deleting the onEnterFrame, but it doesn't appear to be working.
View 2 Replies
Similar Posts:
Sep 7, 2004
here's what I have going on so far--I have a movieclip that's acting as a continuously scrolling text field, and want it to stop scrolling onMouseDown.
here's my code right now:
[Code]...
View 2 Replies
Feb 25, 2010
as from title above, minimap where enemies spawn and can be shown on the minimap and enemies warp like player_mc do. ps: i'm new to this forum. attached files below
View 0 Replies
Nov 2, 2010
im currently making an "AS3 beat em up" ala streets of rage or double dragon.Currently i have my character moving and a few animations done and i am trying to figure out how to make attacks work.I have some "basic" animation for his attack, but im not sure how to get it to work correctley.What happens is, if you press control (the attack button) whilst the character is walking he just keeps moving and is stopped on the attack frame.I want the character to stop moving if the attack is pressed and once it is released start moving again.
hero.gotoAndStop('still');
var left:Boolean = false;
var right:Boolean = false;[code].......
View 2 Replies
Mar 10, 2011
When I'm watching larger videos (> 15 min) on the internet via flashplayer or divx, after some minutes, the video quality begins to decrease (like the video starts lagging). When I now press the pause button and resume the playing after a short period of time, like 10 seconds, the video quality is again like normal for another couple of minutes, but then the video quality again decreases, so I have to pause again for some seconds.
My question is, from a software design point-of-view, why does the pausing stop the video from lagging? I thought it could be because the software gets time to refresh its caches, but I would be really interested in the correct answer.
View 2 Replies
Sep 4, 2010
I am having a problem restarting a function I have stopped using delete this.onEnterFrame a panel scrolls on the x based on mouse position. here is the code
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;[code]....
then on a button click I want the scrolling to stop and be able to be restarted on click from within a child movieclip.
View 1 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
Nov 30, 2009
I have an interface set up with a tile list and a media player.
Based on the function I have below, the tile list loads and the media player begins to play the first video in the tile list. I want to change that in the function so nothing plays first, but only when the user clicks a thumnail in the tile list, is that possible from within this function?
// add Listener for item selection.myTileList.addEventListener(Event.CHANGE, listListener);
// Select the first video.myTileList.selectedIndex=0;
// Detect when new video is selected, and play itfunction
[Code]....
View 2 Replies
Oct 5, 2010
I have beginner's skills in AS3 and have been trying out a sample script in Flash CS5 to create an animation. The script works fine, but I am not sure how to give the user the ability to pause the animation by clicking on the screen and then resuming the animation by clicking again (if this toggling is even possible for a click event handler to do). Is there a way to pause/continue a function by clicking the player screen?
View 10 Replies
Jun 3, 2007
I have a thumbnail gallery and i want each thumbnail to appear 1 by 1 rather than appear all at once.At the moment i have a for loop that creates each of the thumbnails.
[Code]...
View 3 Replies
Jun 15, 2010
I have a hitTest function that keeps checking if two objects contact each other. I'm currently using the following code:
function checkOverlap():Void {
if(doorHit.hitTest(player)){[code]....
The message1 MC has a bunch of links that do stuff within the message1 MC, but because the interval keeps running it keeps resetting the message1 MC. Is there any way to pause the interval for as long as the player MC is in contact with the doorHit MC then unpause it when the two MCs are no longer touching? I've thought about making it so that message1 is already on the stage but outside the viewable area. The hitTest function would then move the message1 MC back and forth. But, I want to figure this out so I can also pause functions when the movie moves to a different frame then unpauses when it comes back to the frame with the hitTest. So, is there a way to make this work?
View 10 Replies
Jan 1, 2012
what wrong with the functin 'stopFish' Without this function the fish in the tank swims but when I add it, it doesnt anymore. I just want the fish to stop swimming after I clicked it and start swimming after another click.
View 1 Replies
Apr 5, 2010
im using this code for my movie to pause for a certain time and then it play every after 5 seconds
stop();
var nInterval = setInterval(Play, 5000);
function Play() { clearInterval(nInterval); gotoAndPlay(_currentframe+1);}
[code].....
View 8 Replies
Nov 19, 2009
Im going to attatch the fla on here...I am also going to give you the script viewable here...im completely a beginner so i made my self notes
also this is not all my coding im just learning off of it to create my own project... What coding would i use to tell the mc to stop scrolling once it reaches a certain x coordinate? for example x=0 (left side of stage) or x= -484 which is when right side of picture is at right side of stage... and can i setup math for it to automatically determine the correct x coordinate (based off mc width) to stop at?? if there is easier scripting to do the same....fill me in
oh and x is off of the stage typically...this is panoramic pics im scrolling
[Code].....
View 2 Replies
Jun 13, 2010
ok here is the scene
_root.playa
_root.playa.feetMC
_root.corneria
_root.corneria.limitsMC
[Code]...
View 3 Replies
May 11, 2010
I have this code where I want edge_btn to move to the left side of the stage, but I can't figure out how to get it to stop. It just keeps going. Also, I have edge_btn rotating the entire time in the beginning of the timeline.
[Code]...
View 0 Replies
Dec 13, 2006
I am making a new site, and was making buttons that looked a little similar like this buts on the left) and wanted that to do with Actionscript.I followed a tutorial on Kirupa on moving stuff with actionscript
Code:
onClipEvent(enterFrame) {
speed = 30;
[code].....
View 5 Replies
Nov 11, 2010
I am making something like a slot machine and the main number (a movieclip placed in separate layer) moves vertically continuously.I made a button and how do I make the main number movie clip stop moving after pressing the button?Our office has Flash CS3 and all the actionscripts are manually written.
View 1 Replies
May 22, 2009
I am using a magnifying glass as part of my portfolio but when I click on another section and this loads an external swf above the main movie, because you can still see the main movie below, you can see the magify glass still moving as you move the cursor above?any ideas how I can stop the magnify glass moving while i am on the external swf above?
View 29 Replies
Apr 8, 2011
how to get the textbox to stop moving after i set the textbox location with the first click.
[Code]......
View 1 Replies
Apr 7, 2011
I have a ball moving around the screen, position updated on ENTER_FRAME. My problem is that there is a considerable amount of flicker going on. I have thought about using something like TweenLite to move the ball but as the position is being updated frame-to-frame I don't think that will work.[code]...
View 2 Replies
Oct 9, 2011
I want to stop the movieclips movement when it hits a wall (another movieclip). The example below works, but after the collision the movieclip 'blocks' all movement to the left...
For now the example with the leftArrow key;
variables to check the key, if it's hitting the walls and if it's moving or not:
var leftArrow:Boolean;
var speed:int = 10;
var hitting:Boolean;
[Code]....
View 2 Replies
Feb 21, 2009
I am a beginner to AS and I am having trouble here: I want to move a dog across the stage. I have two frames one with a movie clip with a dog animated like it is walking and the second frame he is standing still. I want to take him to the end of the stage and stop him when he gets to frame 2.[code]...
View 1 Replies
Jun 6, 2011
I am trying to limit the area in which the character (mcMain) can move I want to be able to keep it in an area (mcBuilding) I also have another area (inwhich the character is not supposed to get to) (mcBackground). (Also I want to be able to to make a dynamic text box that starts at 100 then decreases by 5 when the enemy (mcEnemy) hits mcBuilding and also that it gets removed)
View 1 Replies
Mar 18, 2009
I have a movieclip moving around on key presses and I was wondering what is the best way to stop it moving off the stage? I was thinking of putting hit tests around the edges but wondered if there was a better way?
View 1 Replies
Feb 8, 2010
I am trying the get the center movie to stop remaining centered with the scaling movie when It gets less than 200 pixels of the left hand margin. x.200 and stop being centered on the y axis also at 100 pixels y.100 Here is the current code I was trying to write that is positioned on the object: Just avoid the comments, just left them there for reference to what's in my movie. Also need an if statement made for the y axis. (explained earlier)
onClipEvent(load){
this._x = Stage.width + 250;
this._y = Stage.height/2;
// This function will Position the object in Place
[code]....
View 1 Replies
Jun 27, 2010
Currently I'm trying to make a basic game (using AS 2) but I'm having trouble getting the basic physics to behave. I have a ball which is supposed to fall until it touches the ground. It can also be dragged around the screen by the cursor.I want the ball to fall only if it isn't being held, but for some reason the condition isn't working properly. No matter how I structure the condition, the ball still falls even when it's being held (in fact I can move it from side to side, it is still being held even though it's falling downward).I've tried putting this on the ball to make it fall conditionally:
Code:
onClipEvent(enterFrame){
if(hitTest(_root.ground1) == false){
[code].......
View 2 Replies
Oct 26, 2011
I have the following code on Home Page which contains some tween animations. When I move to About page and immediately come back to Home page again (before all the animations on Home Page done animation), I see some animations are still in the middle of completion. Actually I should see the animation from starting when I go to Home page from any section.
Code:
var timeline3:TimelineMax = new TimelineMax();
timeline3.append(TweenMax.fromTo(Home_mc, 1, {x:1000, y:0, alpha:.8}, {x:0, y:0, alpha:1,
[code].....
View 1 Replies
Nov 10, 2003
lets jsut say like were randomly moving a moveclip around how do i click on it and stop it?
View 3 Replies
Oct 11, 2004
i need a movement script that makes an object move to where i want it to then stop. i cant seem to find a script for this anywhere.
View 4 Replies