Cant' Stop It
Hell everyone, the below script takes what is a raindrop and progressivly increases the number of movie drops up til 200. Problem is I cant get it to stop !
I tried another if statement if(raindensity==200){ stop();} at bottom ; yada yada...... even else statements, unloading the movie ,taking it off stage -its just keeps on going. Im sure that what im doing is a syntax problem. can anyone help?
onClipEvent(load){ _global.rain_density = 1 } onClipEvent(enterFrame){ if (rain_density < 200){ _root.attachMovie( "rm", "rm" +_global.rain_density, _global.rain_density, {_x:0,_y:0}) _global.rain_density = _global.rain_density +1;
} }
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-03-2006, 07:12 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Actionscript Function At A Specific Frame (stop Looping)
I want to stop an effect at a specific frame but I dunno how.
Do I have to put something in the code?
I'm confused.
Or just tell me how to stop it from looping.
Edit:
Is it possible to attach this to a movie clip? Then i can stop it or use onEnterFrame and then escape();
I actually have no idea what I am talking about. /Edit
Here is one of the code I borrowed:
MovieClip.prototype.placeInSpace = function(id) {
var ratio = this.focaldistance / Math.sqrt(this[id].z * this[id].z);
this[id]._x = this[id].x * ratio;
this[id]._y = this[id].y * ratio;
this[id]._xscale = this[id]._yscale = 1000 / this[id].z;
}
MovieClip.prototype.randomPlace = function(id) {
var radius = this.rmin + (this.rmax - this.rmin) * Math.random();
var polar = 2 * Math.PI * Math.random();
this[id].x = radius * Math.cos(polar);
this[id].y = radius * Math.sin(polar);
this[id].z = this.zmin + (this.zmax - this.zmin) * Math.random();
}
Here's the other code cause I can use two in my movie:
function mover() {
// Move the particle over time
this._y += this.speed;
this._yscale += 10;
this.speed++;
if (this._y>500) {
this._y = 0;
this.speed = Math.random()*10;
this._yscale = 100;
}
}
function starField(x, y, n) {
// Generate a starfield of specified dimensions with n stars
for (var i = 0; i<n; i++) {
var star = this.createEmptyMovieClip("star"+i, i);
var dot = star.createEmptyMovieClip("dot", 0);
star._rotation = Math.random()*360;
star._x = x;
star._y = y;
dot.lineStyle(0, 0xFFFFFF, 100);
dot.moveTo(0, 10);
dot.lineTo(0, 15);
dot.onEnterFrame = mover;
dot.speed = Math.random()*10;
}
}
starField(275, 200, 100);
[F8] Movie Plays > Stop > Reverse > Stop > Play
I am fairly new to involved action scripting. I have successfully scoured flashkit threads for years to get my answers but this one has been driving me crazy for the past couple days. I have tried numerous solutions but none of them do exactly what I am trying to do.
I am creating an online portfolio that I want to control with two buttons that will play forward on release and stop at every piece unless the user is pressing and holding down - I also would like the scrolling animation to play in reverse on press and stop at every piece unless press and hold which happens to be skateboards in this section. I am posting the .fla for this section. This is what I have been able to accomplish so far. I moved everything into the main timeline from a movie clip because I could not get that to work at all. Should I move it back to movie clip? I also want it to stop at the first board.
here is the code I was able to peice together that just plays continously without stops.
Empty movie clip on second frame.
PHP Code:
onClipEvent (enterFrame)
{
if (_root.goBack)
{
_root.prevFrame();
}
else
{
_root.nextFrame();
}
_root.frameNo = "Frame : " + _root._currentFrame;
}
Forward button.
PHP Code:
on (press)
{
_root.goBack = false;
}
Reverse Button.
PHP Code:
on (press)
{
_root.goBack = true;
}
I have only done basic stops; goToAndPLay, getURL and such I am a little out of my league here but I started the ball rolling and would like to make this work as I intended. Any help making this do anything close to what I am describing would be much appreciated
How To Make The Wings Of A Fly Stop When The Flash Movie Stop?
Hello,
I made a simple "Fly Flying" flash animation. The wings of the fly are moving up and down while the fly is flying from one location to the other. My problem is:
The wings of the fly are still moving up and down when the fly is landed on the ground. I tried to add a stop(); action script at the last frame. However the wings are still moving even the movie is stopped.
How can I make the wings stop moving when the flash movie is stop? Please download and take a look at my flash file (fly_flying.fla):
http://space.uwants.com/batch.download.php?aid=313219
Thanks and best regards
Alex
How Can I Stop Flash From Looping And Stop On The Last Frame
I am having a problem with looping. I created a flash file and published it. I only want it to play through once and stop on the last frame. I can't get it to stop, it keeps looping through and playing the movie.
I have tried to add a layer that has some script in it with a start and a last tag on frame 1 and frame 310 there is 315 frames total.
the action script was
<code>
// this was in the first frame
ifFrameLoaded ("last") {
gotoAndPlay("start");
}
//this was in the second frame
gotoAndPlay(1);
//this was in the last frame 315
stop ();
</code>
your help is greatly appreciated.
skj
Cannot Stop Movie Clip - This.stop() Confusion
Hello,
In my pong game when someone scores a goal I want the ball to pause in the middle of the screen, wait xx seconds and then randomly move.
Code:
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
This calls function wait that simply uses this.play(); to allow the ball to move again.(See below)
Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
However I cant EVER get the ball symbol to stop no matter what I do.
Ive included all the code attached to the clipevent for the ball below.
Im thinking it must be due to the nested loops or somethings, very very confused
Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
onClipEvent (enterFrame) {
//Kick Off, play whistle and select random direction from 4 diagonals
if (a == 0) {
_root.kickoffwhistle.start();
//Use variable to ensure random numbers are generated only once per game
var randNumber1:Number = Math.pow(-1, Math.floor(Math.random()*2));
//-1 ^1 or ^2 = 1 or -1
var randNumber2:Number = Math.pow(-1, Math.floor(Math.random()*2));
//move it on the y axis at -1 or 1 & //move it on the x axis at -1 or 1
this._y += this.randNumber1;
this._x += this.randNumber2;
++a;
//set a trigger to increment so only actioned once.
}
if (randNumber1>0) {
this._y += this.yspeed;
//move it on the y axis at the set speed
} else {
this._y -= this.yspeed;
//move it on the y axis at the set speed
}
if (randNumber2>0) {
this._x += this.xspeed;
//move it on the x axis at the set speed
} else {
this._x -= this.xspeed;
//move it on the x axis at the set speed
}
// Ball(this) collides with PL1 and ball travelling upwards then deflect off randomly {
if (this.hitTest(_root.P1footballman) && this.yspeed<0) {
// Define boundaries for collision detection
var pl1bounds:Object = _root.P1footballman.getpl1bounds(_root);
this._x = Math.round(Math.random()*(pl1bounds.xMax-pl1bounds.xMin))+pl1bounds.xMin;
//Revert direction of ball by using formula below
this.yspeed = this.yspeed*-1;
//Randomly play miss sound effect if ball in goal area
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
if (this.hitTest(_root.cpu) && this.yspeed>0) {
var cpubounds:Object = _root.P1footballman.getcpubounds(_root);
this._x = Math.round(Math.random()*(cpubounds.xMax-pl1bounds.xMin))+cpubounds.xMin;
this.yspeed = this.yspeed*-1;
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
//Roatation properties of the ball
i = getProperty(this, _rotation);
setProperty(this, _rotation, i+5);
//Rotate ball i degees per frame
_this.rotation = i;
//Player Scores routine
//If ball object is beyond defined CPU goal area
if (this._y<75 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.P1footballman.score++;
//add1 to the cpu score
_root.playertxt = 'PLY: '+_root.P1footballman.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
//Return to kick off position
this._y = 315;
this._x = 275;
a = 0;
//Stop ball in correct position
this.stop();
//5 seconds then calls function "wait" to use this.play() to move ball
var myInterval = setInterval(this, "wait", 5*1000);
}
//CPU Scores routine
//If ball object is beyond defined Player goal area
if (this._y>470 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.cpu.score++;
//add1 to the cpu score
_root.cputxt = 'CPU: '+_root.cpu.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
}
if (this._x>620 || this._x<5) {
this.xspeed = this.xspeed*-1;
//if it hits an edge inverse the xspeed
_root.bounce.start();
//Play bounce side effect
}
if (this._y>470 || this._y<75) {
this.yspeed = this.yspeed*-1;
//if it hits the top or bottom of pitch inverse the yspeed
_root.bounce.start();
//Play bounce side effect
}
}
How To Stop MC At Same Time As Sound Stop?
Hi and thanx for u trieing to help me.
I have used this code to play a sound from the library.
with (song_link) {
sound1 = new Sound(song_link);
sound1.attachSound("inga");
sound1.setVolume(100);
sound1.start(0, 0);
}
and when the sound stops i would like to stop a MC that loops.
if there is any way to have an if command in the MC that waits for a variable to be sended and then stops.
or to set some kind of countdown when u start to play the sound that tells the MC to stop.
i would be very glad if u could help me!
Stop Movie - Don't Stop Sound
Hello,
I'm making a intro for somebody's site. The intro plays a loop. At the last frame I made a stop script. But I want to the muis (a loop) to play on and on. So the music won't stop when the movie stops.
Can somebody help me?
Tnx & greetz, Big_Boss_Man
Stop Sounds When Stop Film
Hi. When I open my flash movie in the Flash Player (I have MX) and play it, it works fine. But if I make a breake (stop the playback), the film stops, but the sound still goes on. I have seen animations where sounds and the movie stop if I stop the film. How can I do it. Thx, leu
If I Stop The Sound I Want To Play It From Where Is Stop :)
hi all
i want a button if i cilck on it the sound will stop and another button if i click on it the sound will continue from where it is stoped is it possible in flash or not
and the sound where is the best place i place it ( movie clip - main frame - action ????
thanks
if any one can give me an open file to be clear or the code
How Can I Stop THIS Movie? This.stop() Does No Work?
I try to stop a small movieclip writing
onclipEvent(Enterframe){
if(_root.myvar==1){
this.stop();
//this._visible=false
}
}
It becomes invisible if I use the second line. But it does not stop if I use the first line.
What's the problem??
Thanks
Strange Bug....won't Stop At Stop Action
My movie isn't stopping when there is a stop action. I don't know if its a bug in my site or if its a bug with flash MX. Here is the file home.fla. The error occurs when you click on one of the buttons under the Profile heading. If you look at the Profile Scene you'll see I have stop actions placed at the end of each labeled section. For some reason the philosophy section keeps repeating itself and won't stop even though there is a stop action. Can some please take a look and let me know what I can to fix this. Thanks!!
Movie Won't Stop On Stop Command ?
Hello again. I have a movieclip following a motion guide. At the end of the guide, a window comes up with some text. On this frame, on it's own seperate layer, I have a stop command. What is suppossed to happen is after reading the text, you click on the window, it dissappears, and the movieclip follows another motion guide. For some reason though, when I output the FLA, it blows right past the stop command. I have tried making the stop command multiple frames, and I have double checked that there is no other command overriding the stop on that frame. I have no clue. Any ideas? Thanks,
(I would post the file, but it's so large it's killing my G5)
Movieclip Won't Stop On Stop Command?
Inside a movieclip (track) I have a ball on a motion path. At the end of the first motion path, a box comes up and the movie is suppossed to stop on it. For some reason, it keeps going right on to the next motion path. The stop is on it's own layer, and the weird thing is, there are two other stop commands on the same layer, at the beginning and the end of the movie, which both work. I have tried everything I know. Please help. Thanks,
-A
_root.stop Doesnt Really Stop
Hey guys,
I have a pretty complex game im working on..and when you win the game, it sends you to the 4th frame on the root timeline.
This shows the win message and such...however, it keeps automatically sending them from the 4th back to the 3rd frame. I have been searching thru the flash for hours to find something that is doing this, but there is nothing!
Is there a way to like override all other things and have a FULL stop?
I cleared the intervals (but none of them have anything to do with changing frames) but nothing works.
Any help would be amazing. Sorry I can't post the example, as its a HUGE complex flash file.
I pretty much am looking for something similar to _root.stop that actually stops EVERYTHING.
Thanks!
Goto And Stop Doesnt Stop?
hi there..
i have stupid problem again..
thats very basic and i dont knwo what the hell is wrong and its driving me crazy!
ok here it is.. im using
on (release) {
gotoAndStop("main");
}
it goes back to main labeled frame stops around 3 sec.. then plays the whole movie.. again! and again!
i changed it to frame number like
on (release) {
gotoAndStop(45);
}
still same! even there is a stop(); action on frame 45(main)
what is that?!
what am i doing wrong?
thanks..
Stop Scene Loop Without Stop();
I have an interactive flash application that I'm building, but it's gotten kinda large (~200k) because of one large png file. So, I want to build a preloader for it, but I seem to have some difficulty getting it to a) stop looping back to scene 1, or b) look good if I use stop();
for some reason, the folowing scene's moving elements look crappy if I use stop(); in it's first frame in order to stop it from going back.
I don't want scene 1 to continuously reappear, but stop messes with the moving elements in scene 2.
Any novel suggestions? Thanks in advance for even reading this.
Goto And Stop Doesnt Stop?
hi there..
i have stupid problem again..
thats very basic and i dont knwo what the hell is wrong and its driving me crazy!
ok here it is.. im using
on (release) {
gotoAndStop("main");
}
it goes back to main labeled frame stops around 3 sec.. then plays the whole movie.. again! and again!
i changed it to frame number like
on (release) {
gotoAndStop(45);
}
still same! even there is a stop(); action on frame 45(main)
what is that?!
what am i doing wrong?
thanks..
Making A Stop Button, Or Telling A Button To Stop A Streaming Video
Hello,
I've searched the forums and tried to find an answer to this question, but most of the posts go unanswered or are way beyond my understanding.
I'm using a form based application in Flash professional 8.
I have a .flv video of a movie trailer that I created from Quicktime. I intend to stream this video.
I also have a button called "Trailer". When I click on the "Trailer" button, I see the .flv video I created along with the play/pause control skin that I added in the import video wizard. I press the play/pause button, and the movie plays.
This is as I had expected it to be.
Now, when I want to go to something different, for example clicking a "Photos" button that displays a slideshow, the video continues to play.
Is there a way I can tell the "Photos" button to stop the streaming video?
I've searched the forums, and found a few answers, but I don't really understand them. I added them to the script of the "Photos" button anyways to see if they did anything, and every time the video still kept playing.
Here's what I've tried so far:
------------------------------------------
button.onPress = function (){
player_mc.clearVideo();
}
Where player_mc is the instance name.
-------------------------------------------
Adding a stop component, but this isn't really what I want. I'd like the "Photos" button to stop the movie without the user having to hit a separate stop button.
-------------------------------------------
.stop() and ._visible=false;
I don't really understand this.
-------------------------------------------
removeMovieClip("component_mc");
-------------------------------------------
instance.stop()
From what I understand this is only for adding to a keyframe to stop a movie that's looping, and not for what I would like to do. Is that correct?
-------------------------------------------
I would greatly appreciate any help, not only just for me, but for any other newbie who may run into this problem.
Thanks!
Timing Stop Go Stop Go
I want to create a portion of a page that is like a slide show with a few (10 or so) pictures that show for a few seconds, then disapear, and move on to the next, then loop. Is there a more efficient way to put a delay between the pictures other than adding like 100 frames for each one? I was looking at the setseconds and getsedonds ... would that work? and if so, how? by the way, I cannot lower my fps because I need quick animation else where.
Stop Sounds Causes Flv To Stop Too
Hey Hey!
Got a minor issue that I just can't seem to figure out. I've added piece of background music and created a simple piece of script to stop and start the music, should it irritate the user.
All works fine, however when I'm playing an flv (imported to stage and streamed) the stop function causes the flv to stop playing. It makes no sense to me.
Here's the code for the variable
Code:
var themeSound:Sound = new Sound();
themeSound.attachSound("soundtrack")
and the code for the On the button
Code:
on(release){
with(tracks){
gotoAndStop('on')
themeSound.start();
audiofx_state = 1;
}
}
and the code for the Off button
Code:
on(release){
with(tracks){
gotoAndStop('off')
themeSound.stop();
audiofx_state = 0;
}
}
The audiofx_state I'm using to deactivate the stop and start buttons as I have a small movie clip that changes text from on to off etc.
So as you can see, nothing complicated here. I've never tried to do this before and any help would be appreciated.
**EDIT**
I work fast and found a way around this problem, but I'd still like to know why the way above doesn't work.
To get around the problem I loaded the mp3 file for the background music from and external source rather than the library.
Code:
var themeSound:Sound = new Sound();
themeSound.loadSound("sounds/theme.mp3",true);
themeSound.setVolume(20);
themeSound.stop();
Code:
on(release){
if (audiofx_state == 0){
with(tracks){
gotoAndStop('on')
soundStarted = !soundStarted;
audiofx_state = 1;
}
themeSound.start();
}
}
Code:
on (release) {
if (audiofx_state == 1)
{
with (tracks)
{
gotoAndStop('off');
audiofx_state = 0;
}
themeSound.stop();
}
}
Help: Using Stop() Does Not Stop Movie
Hi,
I'm new to Flash, and have created a movie that I'd like to stop on a certain frame. I've used stop() before in another .fla which worked ok, but currently it doesn't seem to stop this movie at all.
I've created a layer for actionscript only, and through the first part of the movie I use some actionscript to pause the playback - this code is:
Code:
stop();
startTime = getTimer();
this.onEnterFrame = function () {
currentTime = getTimer();
if(currentTime-startTime > 2000) {
play();
}
}
This code works fine, and stops the playback then restarts after 2 seconds.
I placed a stop(); in the same action layer when I reach the main part of the movie, but when I test the movie or publish it, it goes past this point and then eventually loops.
Does the stop() call have to be done in any particular way?
Thanks in advance, especially if I'm asking a stupid question!
Swapping Buttons W/ AS...play To Stop/stop To Play
Hi,
I'm looking for how to swap buttons with actionscript. If my FLV is playing, display the stop button. If it's stopped, display the play button.
Here's my AS so far.
Actionscript Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play("intro.flv");
stopButton.onRelease = function(){
ns.pause();
_root.bulletlist.stop();
isplaying = false;
}
playButton.onRelease = function() {
ns.pause();
_root.bulletlist.play();
isplaying = true;
}
rewindButton.onRelease = function() {
ns.seek(0);
_root.bulletlist.gotoAndPlay(1);
if(isplaying){
ns.seek(0);
}else{
ns.seek(0);
ns.pause();
}
}
Could I get some pointers or a good link?
Thanks!
How To Stop An MC?
Friends:
When I roll-over an MC I want that MC to stop. I know one way to do this is putting an invisible button on the top this MC and give an actionscript such as:
"On Rollover
With MC
GotoAndStop (1);"
WHere at frame 1 it would be a stop.
But I want the MC to stop exactly at the same point than going to frame 1. Is there a way to do this? Also an invisible button on top of another button----will it work?
Hope I am clear,
Thanks,
FK
Stop That Mc
ok, probably a stupid question for all you guru's out there but here it comes: let's say you have the following script attached to a button:
on (release) {
test._y += 40
}
where test is a movieclip...each time you click the button, the movieclip will go down but i want the mc only go down once no mather how many times you click the button.
One at the time!
Why Won't It Stop When I Tell It To?
k, i have NO clue why this isn't working... after my preloader, i want it to go to the next scene and STOP... but it won't stop for some reason, it just keeps playing. Here is the .fla, plz check it out and tell me wuts wrong.
http://www.ronfez.net/Hummercash/test.fla
Thanks,
.//chris
Stop All?
I've got a flash presentation that has multiple movie clips playing at the same time.
Does anyone know a way I can stop ALL the movie clips and then restart them without having everything on the main timeline? Kind of like a "stop all sounds" action, but for movie clips?
Any help asap would be appreciated.
Thanks.
STOP
I'm trying to create a movie with actionscript. I've created buttons that when the user clicks it a text will appear, my problem is how i can get the timeline to stop when it is finished showing the text.
Hope somebody can help me with this...Thank you in advance!
ADM
It Just Won't Stop
I created this simple movie in Flash 5... I threw it into my Dreamweaver doc and uploaded. It just keeps playing over and over.... I would like for this to just play once. Keep in mind I am new to this so be very detailed if there is any kind souls out there willing to help me.
Stop Go..
I got one time line with 100 frames, on the 50 frame i'd like to stop and afther 60 seconds to continue playing.
i'm trying with this script but with no success
time = getTimer();
endtime = 6000;
if (time==endtime) {
}
play();
any help?
How To Stop This?
Hello,
i have this code (letter is a MC and shuffle is a dynamic text variable:
now = setInterval(change, 200);
function change() {
letter.shuffle = chr(random(25)+65);
}
i want to stop the function when the shuffle is equal to a variable named for example targetLetter.
I also would like to choose the letters which can be used in random changing. I would like to use only all "BIG" letters, "#" and the numbers "27".
Thanks,
Miguel
MC Won't Stop
Here's the situation. I have 3 MCs. I want MC one to be draggable and hitTest against MC2. When this happens I want MC3 to go to a frame and stop.
I have MC1 dragging, and the hitTest works (which pleases me because it's my first one), but MC3 plays all the way through.????
Here is the code:
on(press){
startDrag (this, true);
this._alpha =50;
}
on(release){
stopDrag();
this._alpha =100;
}
onClipEvent(enterFrame){
if (this.hitTest("_root.space")){
testspot = _root.bar._currentframe;
_root.bar.gotoAndStop (testspot + 25);
if (testspot > 101)
_root.test.gotoAndStop ("error");
}
}
p.s. Source file is attached.
My Car Won't Stop
Hello all.
I am creating an RPG game (my first) and I have set up a simple collision detection for the boundries and for the pursuing cop cars. The problem is that, when I hit the boundries, my car stops but if I hold down the UP key, it continues to push through them. Does anyone know how to actually kill the forward motion entirely?
Here is the script for the Purple Caddi that needs to stop:
onClipEvent (enterFrame) {
//Collision Testing
if (_root.carmov.hitTest(_root.copmov)){
speed = 0;
}
if (_root.carmov.hitTest(_root.bound1)){
speed = 0;
}
if (_root.carmov.hitTest(_root.bound2)){
speed = 0;
}
if (_root.carmov.hitTest(_root.bound3)){
speed = 0;
}
if (_root.carmov.hitTest(_root.bound4)){
speed = 0;
}
//This code will advance the car forward.
if (Key.isDown(Key.UP)) {
speed += 2;
}
// This will make the car stop fast
if (Key.isDown(Key.SPACE)) {
speed = 0;
}
// This will make the car go backwards
if (Key.isDown(Key.DOWN)) {
speed -= 1;
}
//The car will start to slow down after the speed of 25
if (Math.abs(speed)>25) {
speed *= .6;
}
// This will change the angle of the car
if (Key.isDown(Key.LEFT)) {
_rotation -= 30;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 30;
}
// This will make the car move
speed *= 1;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.move.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
}
Thanks all.
Stop Following Me
Gday guys
In my movie i have two vertical rectangles, and each has 5 buttons on it.
When a button is rolled over, i have a block fall from the top and slow down and hover over the button.
I had it working great for my first vertical rectangle but when i set up the second, things went wrong.
Currently, when ever a button is hovered over both blocks fall from the top and move in unison.
I have given both block instances different names......... and the code is below:
onClipEvent (load) {
delay = "2";
}
onClipEvent (enterFrame) {
with (this.servslider) {
_y += (_root.yspot-_y)/delay;
}
}
and the code assigned to each button is:
on (release) {
_root.gotoAndStop("video");
}
on (rollOver) {
_root.yspot = "50";
}
on (rollOut) {
_root.yspot = "0";
}
As my knowledge of scripting is limited i had a freind help me. However i have a feeling that the code is wrong. I don't understand why i have given each block an instance name when it is not be called by the button.
Any suggestions would be great.
Thanks
Chris
It Won't STOP
Hi everyone im making a flash website, i think! and all ive got so far is a piece of script activated by a button which sends the playhead to a certain frame where a new piece of text appears, this works fine. BUT i want the clip to stop once the text has slid in and stopped, so i put a "stop();" script on the keyframe where the text stops, but when i click the button, the gotoAndPlay works but it ignores my stop(); command, WHY!!?
any help much much appreciated!
Cheers
Will
Stop();
I'm new to Flash and actionscript and am having a problem that I am sure is very simple. I just can't work it out. I have a movie and within that movie I have several movieclip symbols each with multiple keyframes. I want the movieclip symbol to stay on frame1 (named start) until a specific event occurs then gotoAndStop on one of the other named keyframes. My problem is, despite my attempts to try and make the symbol movieclip stay put until an event occurs, and my adding stop() in everywhere i can, it just keeps looping. Please help me stop it! It's frustrating me no end!
Stop
Can someone tell me what could possible override the stop(); command?
i have a simple movie that consist of 2 scenes, at the end of scene 2 there's a stop command but when i test run my flash it just ignore the stop and the playback head would go right back to the beginning to scene 1, i have other stop command in different parts of the movie too but just not the one at the last frame, can anyone explain this to me?
thank you very much.
MC Won't Stop :( HELP
I've made some sort of slider, that when you click a button it begins to slide, but i want it to stop during te sliding movieclip...A simple stop doesn't help....???
Is there someone who can check out my .FLA please i'm getting realy crazy over this....
Stop Mc
okay, i have a mc its a box, i want to move it along the screen until it hits the x coordiante 200, i can get it going, but i don't know how to stop it, this is what i have so far
onClipEvent(load) {
setProperty(this, _x, 5);
setProperty(this, _y, 135);
moveSpeed = 5;
}
onClipEvent(enterFrame) {
this._x += moveSpeed;
}
what would i put after
this._x += moveSpeed;
to get it to stop at 200 ???
How Can I Stop The Car
hi all i have a car that move by the keyboard (up-down-right-left)
and there is place in the flash if the car hit this place a question will appear for the player
i want when the question appear / the car stop from movement and when i answer the question / the car can move again by the keybord
this is the code on the car MC
------------------------------------------------
onClipEvent (load) {
// declare and set speed variable
speed = 10;
}
onClipEvent (enterFrame) {
// move up, down, left, or right
if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) {
_x -= speed;
_rotation = 270;
}
if (Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) {
_x += speed;
_rotation = 90;
}
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) {
_y -= speed;
_rotation = 0;
}
if (Key.isDown(Key.DOWN) && !Key.isDown(Key.UP)) {
_y += speed;
_rotation = 180;
}
//
// move diagonally
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.DOWN)) {
_rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.DOWN)) {
_rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.UP)) {
_rotation = 225;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.UP)) {
_rotation = 135;
}
//
//
}
onClipEvent (load) {
moveSpeed = 1;
}
}
------------------------------------------------------
this is for movement
---------------------------------------------------------
onClipEvent (enterFrame) {
// now check for collisions
hit = false;
for (var i = 1; i<=10; ++i) {
if (_root.m.hitTest(_x+x, _y+y, true)) {
// it hit one of the other cars
hit = true;
break;
}
}
if (hit) {
stopAllSounds();
_root.play();
}
}
thanls alot
Stop Use Of Tab Key
I have a form, I don't want my users to be able to tab in the form as other stage elements are selected if they tab, and a nasty yellow box appears around movie clips etc.
Can I 'void. or 'null' the tab key? Or is there another solution.
Thanks
mr mooch
How To Stop It?
This handler is from a tutorial on Flashkit. It moves a MC based on the location of the mouse.
onClipEvent (enterFrame) {
//x movement
mx=_root._xmouse;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}
moveSpeedx=dx/10;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
}
My question is, how can you stop the movie clip at a given area of your main movie? (so it dosnt run off to the edge.) Ie: set up boundries.
Don't Want To Stop Now....
I have received some very good feedback, but cannot seem to finish up the image scrolling effect located here(after intro)
http://www.henrithompson.com/Corpora...roup/home.html
Also, I'm trying to do the rollover text effect shown on the bottom navigation.
Stop
I am trying to make a title screen in my movie where u can select scenes and credits. But whenever i get to the title screen, after it reaches the end of the frames it is displayed it loops back around and plays again. Is their anyway I can stop the movie from plays without people having to push a button?
To Stop
How can i make a flash presentation stop?
It's ok but as soon as its into a .swf format it loops, and then after uploading it onto a website, it loops again? is there a way to stop this?
Stop
I have a flash animation, with some text wiping in from the left.. I was wondering if one (on the 2nd layer I have i have some text that reads 'Click Here To Enter' ) if i could make that fade in... and also how do you stop the loop? Everytime I make an animation and test the movie, it continues to loop when I only want it to play once. Can anyone help?
Stop N Go.
How do you make the frame stop for like 3 seconds, then play using actionscript? Can anyone help me out? It would be greatly appreciated
Once I Pop, I Won't Stop
Hello everyone,
I am trying to get a pop up to open centred in the screen, with no scroll bars etc, from a button pressed in a flash movie. I have done a serch in the help section and have found some previous posts on the subject. But, i am having trouble getting it to work!!
Maybe i am editing it wrong. Could some one show me how its done??
Thanks for any replies,
Tom
Why Won't It Stop?
So here is some code
_root.createEmptyMovieClip("horz",1);
horz.lineStyle(2,0x333333,100);
horz.moveTo(20,470);
horz.lineTo(620,470);
horz._alpha = 0;
horz.onEnterFrame=function(){
if(horz._alpha<100){
horz._alpha+=5;
}
if(horz._y<450){
horz._y-=5;
}
}
stop();
my problem is that i want the line to appear and rise slightly.......obviously Im doing something wrong. The line moves up but it doesn't stop......what am I doing wrong??
thanks, please help
Is There Anyway To Stop
what must do
sourcetec company has developed last version of swf decompiler
it can convert swf to fla
what can do for copyrights?
flash will be die
__________________
shahbaz
How Do I Stop A MC?
i want to have the movie clip there, but stopped. wht script do i put on that frame?
|