Stop Actionscript
i have a movie which is playing in another frame, say 750, and it controlled by actionscript.. basically it's a loading bar showing people the amount of time a program loads onto a computer.
This is in a larger presentation where the user can press 'p' for pause/stop and 'space' for play.
But when the user hits 'p' the mc does not stop or pause.. goes to the end of the clip (actionscript).
How can i control outside of this clip? I hope this make sense.
this is my actionscript at frame 750 -> 846
Code: // loading bar actionscript var maxNumber:Number = 100; var count:Number = 1; var load1:Number = setInterval(lb, 25); mclb1.loader._xscale = 1;
function lb():Void { mclb1.loader._xscale = count; mclb1.percentage.text = count; //trace("count is " + count); if(count >= maxNumber) { mclb1.loader._xscale = maxNumber; mclb1.percentage.text = maxNumber;
//trace("frame is " + _root._currentframe); mclb1.onEnterFrame = function() { mclb1.loader._alpha -= 5; mclb1.percentage._alpha -= 5; mclb1.percent._alpha -= 5; if (mclb1.loader._alpha <= 0) { mclb1._visible = false; mclb1.percentage._visible = false; mclb1.percent._visible = false; delete mclb1.percent.onEnterFrame; delete mclb1.percentage.onEnterFrame; delete mclb1.onEnterFrame; //trace("frame is " + _root._currentframe); clearInterval(load1); } };
} count++; }
and this is part of my code on frame 1 for controlling the timeline
Code: if(_root._currentframe >= 750 && _root._currentframe <= 846) { //stop mainvid trace("in lbmc's"); _root.mclb1.stop(); _root.mclb2.stop(); }
Since the mc is not actually a timeline driven event i can't stop it like this. Thanks.
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-13-2006, 01:58 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);
Stop Actionscript
I originally thought that I had to unload this movie. But I've been thinking about it and I don't think thats the case (since I've tried every unload command possible). Here is the actionscript thats inside my emptymovie clip (it draws lines and hides the mouse). How can I stop this actionscript at one point?
_root.createEmptyMovieClip ("vector", 1);
with (_root.vector){
_root.star.hide();
vector.onMouseMove = function() {
mousex=_xmouse;
mousey=_ymouse;
linegood = (mousex >=70 and mousey >=30) && (mousex <= 630 and mousey <= 310) && (mousex >=70 and mousey <=310) && (mousex <=630 and mousey >=30);
if (linegood) {
Mouse.hide();
_root.vector.clear()
//Draw Line
lineStyle (5, 0xFFFFFF, 100);
moveTo (345, 170);
lineTo (mousex, mousey);
Thanks in advance!
STOP ACTIONSCRIPT
I have a main.swf file that a child.swf nests inside by clicking a button. the child.swf contains some actionscripts which is running all the time. i want to stop all actionscript functions in child.swf and restart it by clicking a button that exists inside the main.swf. Is there any code to stop a nested actionscript functioning?
Note: the child.swf actionscipts run without any need of mouse triggers. they just run when the nested movie loads.
ActionScript Stop
I need some code to put on a Frame inside of a MovieClip named "Hibernate" that will stop all of the ActionScript in the _root
Please Help! Thanks In Advance!
How To Stop An Actionscript
Hi,
I have a Flash movie with two scenes, the first titled "Then" and the second titled "Now."
On Frame 1 of the "Then" scene is the following script, which generates snowflakes. I want the snow to quit when a button-release moves the action to Scene 2. Nothing I've tried has worked. Any suggestions?
Thanks!
Bill
__________________________
amount = 100;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*2+.2;
thisFlake.increment = -0.025+Math.random()*0.05;
thisFlake.radian = 0; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y += this.yspeed;
if (this._y>=mHeight) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
};
}
Stop Actionscript
I have this large MC that moves around, scales and rotates. Here's the script I am using to move it around.
ActionScript Code:
//Movement
onClipEvent (enterFrame) {
Ysquare = this._y;
Ydiff = Ypos-Ysquare;
Ymove = Ydiff/3;
this._y = Ysquare+Ymove;
Xsquare = this._x;
Xdiff = Xpos-Xsquare;
Xmove = Xdiff/3;
this._x = Xsquare+Xmove;
//Scale
yFit = this._yscale;
yFitDiff = size-yFit;
yAlt = yFitDiff/2;
this._yscale = yFit+yAlt;
xFit = this._xscale;
xFitDiff = size-xFit;
xAlt = xFitDiff/2;
this._xscale = xFit+xAlt;
//Rotate
Rot = this._rotation;
RotDiff = rotate-Rot;
Deg = RotDiff/3;
this._rotation = Rot+Deg;
updateAfterEvent(enterFrame);
}
However after the first time it moves around it starts to slow down all my other animations. I think it might be still moving so slightly that you can see it but it's affecting everything else. Is there a way to tell it to stop once it reaches the spot I tell it to go to? Thanks!
Stop Movieclip With Actionscript?
Hello,
This is the situation. I have a movieclip of 52 frames, which are all labelled, so I can use them in scripts.
I placed the movieclip in a scene, and want the movieclip to run once and then let stop it at a certain frame.
Is there any actionscript I can use?
Hope that there's someone with a solution.
Greetz
Rik
Actionscript Stop And Go From A Button
Hi Guys
I've got a movieclip that contains a series of images side by side. When the user clicks on a menu button I want to have a scrolling effect that takes the user through the remaining images to the requested image.
Is there a way in which this is achievable?
Is it possible to have a gotoAndPlay command on the button that runs the targeted movieClip, stopping on a specific frame (all requested from script within the button) as opposed to putting any stop commands within the movieclip itself?
Thanks
Phil
Stop Sound Using Actionscript
I'm using this code to play my sound:
yourButton.onRelease = function():Void {
if (!soundIsPlaying) {
mySound.start(0, 1);
soundIsPlaying = true;
}
Is there a similar code to stop the sound to, or should I just use the stopAllSounds function?
Start And Stop Actionscript
I need the actionscript code for my Start and Stop button for my movie clip in flash cs3. the clip will be stopped at first and only needs to move when i hit the start button and stop when I hit that....
thx in advance
Stop Actionscript From Running
hi there,
First of all I have to say that these forums are an amazing help for my flash projects and i got alot of answers to my problems here.
But here's my current problem:
In the project i'm working on i want to make an animation that switches between frames after a certain time.
So when the counter reaches 0, it goes to frame 2 and starts playing that animation. But the actionscript I have in frame 1 keeps running when i'm in frame 2. I've looked everywhere but i couldn't find out how i can stop the actionscript from running.
Any help would be appreciated, i attached the code from my first frame in the post.
Zyrax
p.s Sorry for any grammer / typo's , english is not my native language
ActionScript Code:
aantalLetters = 200;
minSpeed = 1;
maxSpeed = 4;
displayTime = 10;
countDown = function () {
displayTime--;
if (displayTime == 0) {
_root.gotoAndStop(2);
}
};
vliegText = function () {
//this._x += Math.sin(this.spread);
this._x = this.spread;
this._y -= this.speed;
if (this._y<5-Math.random()*50) {
this._y = 420;
this._x = 250;
}
};
for (i=0; i<=aantalLetters; i++) {
var mc = _root.attachMovie('text', 'text'+i, i);
mc.onEnterFrame = vliegText;
mc._alpha = 50+random(50);
mc.spread = i*2.5;
mc.speed = minSpeed+Math.random()*(maxSpeed-minSpeed);
mc.gotoAndStop(random(15)+1);
}
timer = setInterval(countDown, 1000);
stop();
How Can I Stop An Actionscript In Flash?
I want to put this into action script code: after exit frame stop actionscript. I am creating a game and i put this flash file before the game http://ffiles.com/flash/actionscript...rain_1366.html but after i press the play button i still see the action script taking effect and the blur bubbles take place through out the whole game. Can someone please help me Thank You.
Stop this Actionscript on exit frame:
an example would really help alot
How Can I Stop An Actionscript In Flash?
I want to put this into action script code: after exit frame stop actionscript. I am creating a game and i put this flash file before the game http://ffiles.com/flash/actionscript...rain_1366.html but after i press the play button i still see the action script taking effect and the blur bubbles take place through out the whole game. Can someone please help me Thank You.
Stop this Actionscript on exit frame:
an example would really help alot
Problem With 'stop' On ActionScript
We have a simple banner ad which rotates with snow falling on one of the banners, which is in the Action Script below. How can we make the snow stop falling after this one banner, instead of having it fall for the entire flash banner rotation? Meaning we only want it to happen on one single banner and not them all. I've tried placing stop commands and making a new action script with all the values set to 0, but no dice. The original action script just won't stop. Any help appreciated! Thanks.
Code:
amount = 100;
mWidth = Stage.width;
mHeight = Stage.height;
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("flake", "flake"+i, i);
with (thisFlake) {
_x = Math.random()*mWidth;
_y = Math.random()*mHeight;
_xscale = _yscale=_alpha=40+Math.random()*60;
}
thisFlake.yspeed = Math.random()*2+.2;
thisFlake.increment = -0.025+Math.random()*0.05;
thisFlake.radian = 0; //declare for actionscript 2.0
thisFlake.onEnterFrame = function() {
this.radians += this.increment;
//trace(this.radians);
this._x += Math.sin(this.radians);
this._y += this.yspeed;
if (this._y>=mHeight) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
if (this._x>=mWidth || this._x<=0) {
this._y = -10;
this._x = -10+Math.random()*mWidth;
}
};
}
How Can I Stop An Actionscript In Flash?
I want to put this into action script code: after exit frame stop actionscript. I am creating a game and i put this flash file before the game http://ffiles.com/flash/actionscript/color_blend_rain_1366.html but after i press the play button i still see the action script taking effect and the blur bubbles take place through out the whole game. Can someone please help me Thank You.
How Can I Stop An Actionscript In Flash?
I want to put this into action script code: after exit frame stop actionscript. I am creating a game and i put this flash file before the game http://ffiles.com/flash/actionscript/color_blend_rain_1366.html but after i press the play button i still see the action script taking effect and the blur bubbles take place through out the whole game. Can someone please help me Thank You.
It would help so much if you can use an example.
Stop Clock Actionscript Help
It's been a long time since I've visited, sorry in advance if anything
THE SITUATION:
I want to make a stop clock that starts on the touch of a button
Like using getTimer() but only starts the time at the click of a button
I do not want to display todays date but just a millisecond stopclock like on a watch, one that you can reset and time again
I hope you can understand that, I hope you can help
Cant Stop A Movieclip That Has Actionscript
i have in 'Scene 1' a movieclip that is animated in actionscrpt and when i jump to 'Scene 2' everything desapears except this movie clip... i want the movie clip to disapear to... how can i do it?
How To Stop Movieclip Of Gun With Actionscript?
Hi Everyone,
I am fairly new on kirupa.com wich i think is a great resource for the flash/macromedia community, i am a Graphic Designer from The Netherlands and a beginner/intermediate user of Flash MX, at the moment i am working on personal site for animated short film in Flash MX, i've got a gun as the navigation structure that fires bullets when users click on the buttons those small bullets turn into big bullets to load external .swf content into, however i want to do animation of a gunclip sliding into the gun before user can navigate.
Making the animation i've converted part of the gun into a Movieclip and made simple animation of bullets sliding into gun, but when i use the actionscript (stop the animation keeps repeating (loop).
My question : "How do i stop the Movieclip animation from repeating using actionscript (stop; ?)"
Take Care!
DEGEIT
Flashsound - Stop Actionscript
Hi,
I'm trying to use the Flashsound API. Everything is working fine except that if I have three keyframes (3 different sounds) and if I want to play the first one, it's actually playing all three of them. If I call the second sound, it's playing the second and third sound. You get the point. I'm sure it's a missing stop(); actionscript somewhere, but I can't find where.
Your expertise would be appreciated.
I have uploaded my .fla if someone can take a look at it.
http://www.megaupload.com/?d=3GLT3VCL
Thanks.
Mark.
Actionscript Stop(); Issue
This issue has been resolved.
I have a turtle strolling across the stage. (http://heckhouse.com/turtle.htm) The first time you mouse over him, he does exactly what I want. He stops moving and goes to the hiding position. But if you try to roll over him again, he'll hide, but he keeps sliding across the stage. Here is the code on the moveclip:
on (rollOver) {
this.turtle.gotoAndPlay(1); <-- This is the hiding animation
}
on (rollOver) {
this.stop();
}
And here is the code on the last frame of the hiding moveclip:
this.gotoAndPlay(1)
onEnterFrame = function() {
this._parent.play();
}
I'm assuming the problem is that it's wanting to finish out the motion tween before it stops again... Is there any way to fix this?
What Could Cause ActionScript Animation To Stop?
I am working on a site that requires swf's loaded onto the stage to be tweened with actionscript. And it randomly stops the animation.
http://harshmedia.com/index_preload_test.html
if you want an illustration
I could post the code but it's pretty long and drawn out, just looking for ideas.
Thanks!
Stop Clock Actionscript Help
It's been a long time since I've visited, sorry in advance if anything
THE SITUATION:
I want to make a stop clock that starts on the touch of a button
Like using getTimer() but only starts the time at the click of a button
I do not want to display todays date but just a millisecond stopclock like on a watch, one that you can reset and time again
I hope you can understand that, I hope you can help
Cant Stop A Movieclip That Has Actionscript
i have in 'Scene 1' a movieclip that is animated in actionscrpt and when i jump to 'Scene 2' everything desapears except this movie clip... i want the movie clip to disapear to... how can i do it?
Stop The Timeline In Actionscript 2.0
I need to stop an animation using AS2. I know how to do this using AS3 but can't remember how to do it AS2?
I want an animation to stop after 125 frames at 12 fps.
Thanks for any help, as this is really stressing me out!!
Using Actionscript To Stop Movie When...
i have a 50-frame long loop, i am wanting the movie to stop and freeze on frame 50 when the mouse moves over a button that i have placed on layer 1. I have given this button an instance name of "myBackgroundBtn".
I am now sure i need to make a new layer and insert actionscript into frame 50.
Can anyone see anything wrong with this?
i am wanting this actionscript to go something like this right?
IF myBackgroundBtn = mouse over THEN stop
IF ELSE continue looping
Can anyone help me out here?
thx
Alistair
Stop A Sound With Actionscript?
hi all,
i have a loooong animation ive just finished. i have a sound being loaded using the sound object, and then a toggle sound button for turning sound on and off. When it gets to teh end of the animation, theres a stop action and a mySound.stop() action. i have a replay button so the user can replay teh animation, but my toggle sound button then doesnt work. do i have to clear the sound object when the user clicks the replay button so when the timeline goes back to frame 1, it can then load in teh sound object? there doesnt seem to be a clear sound object thing. im clutching at straws here, any advice would be great.
cheers
- D
Can't Stop Actionscript Movieclip [newbie]
hello! i'm having trouble stopping an actionscripted movieclip. i am naturally a computer programmer so i just wanted to try and make all my stuff with actionscript (no graphic/motion tweening in the timeline using frames). i'm making an intro for a website and i wanted the movieclip to play and then i would use AS again to start the next movieclip after the first is done, but the first movieclip keeps going and going.
what i did:
1. created a movieclip and added it to the scene.
2. added AS code (using beginfill, moveto, lineto, endfill) to draw the image, which is just a square. (WORKS)
3. added an AS function with move code. (WORKS)
this.onEnterFrame = function() {
mcIntervalTimer = setInterval(move, 0);
function move() {
with (_root.mcBGSquare) {
if (_x>-2000) {
_x -= 1;
} else {
_x = 700;
stop(); // doesn't work
}
}
updateAfterEvent(move);
}
}
4. added stop(); in AS (everywhere in the code: beginning of move function, end of move function, makes no difference).
please note that i didn't want to use any buttons to start/stop the movie AND in most tutorials they have movieclips that run forever w/o stopping unless a button is used...almost EVERY tutorial has a button or doesn't use complete AS, which is what i'm trying to do.
question: is it possible to stop a movieclip in its own frame or must i have 2 frames? (1 to play the movieclip and a 2nd to goto so that nothing is happening...like adding gotoandplay(2) instead of stop(). i'm guessing maybe it's absolutely necessary to have 2 frames but i just wanted to use one and hope the AS can do the rest.
--small screenshot added so you can see what i'm looking at
PLEASE HELP AND THANKS IN ADVANCE!
I AM SUCH A FLASH NEWBIE
[MX04] Stop Sound Actionscript?
Is there some actionscript i can use so somebody will click a button and all the sounds playing will stop? any help appreciated!
Thanks,
~Justin
Using Actionscript To Slow Down And Stop A Movie
Hi there,
I'm currently working on a Flash Menu 'carosuel' and I've got to a point were I can't work out how to get the carousel to slow down and stop spinning once the cursor rolls out from the Flash area. I'm pulling in XML too, which I'm finding a bit tricky. Here's my code:
#include "mc_tween2.as"
import mx.utils.Delegate;
import flash.filters.BlurFilter;
var blur:BlurFilter = new BlurFilter(0, 0, 1);
var numOfItems:Number;
var radiusX:Number = 320;
var radiusY:Number = 50;
var centerX:Number = Stage.width / 2 - 15;
var centerY:Number = Stage.height / 2.4;
var speed:Number = 0.05;
var perspective:Number =15;
var home:MovieClip = this;
var blurX:Number = 30;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOver = blurX;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
function over()
{
trace (home.tooltip.thing._y);
home.tooltip.thing._y = -180;
home.tooltip.thing.tween ("_y",-119,.5,"easeOutQuart");
home.tootip
home.tooltip._alpha = 0;
//home.tooltip._x = home.tooltip._x - 40;
home.tooltip.alphaTo(100, 1.5, "easeOutQuart");
//home.tooltip.tween((home.tooltip._x + 40), 1.5, "easeOutQuart");
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
}
function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip.alphaTo(0, 1, "easeOutQuart");
//home.tooltip._alpha = 0;
}
function released()
{
trace(this._parent.toolText);
}
function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this._alpha = s*150-5;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
this.blurY = s*150;
trace(s);
this.filters = [blur];
//this._alpha = this._y - 525;
/* blur.blurX = speed * 5;
//blur.blurY = -this._y / 10 + 62.5;
this.filters = [blur];
var s:Number = this._y/(centerY+radiusY);
this._xscale = this._yscale = s*100;
this._alpha = s*150-70;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale+100));
}
*/
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/10000;
blur.blurX = Math.abs(speed * 200);
this.filters = [blur];
}
Any help would be much apreciated!
Thanks
Move To X And Y Position And Stop, For Actionscript 2.0
Hi guys,
I'm relatively new to actionscript x and y positioning.. and i was wondering how i would go about: after clicking a button, moving to a specific x and y axis and stopping?
I am unsure on the coding that i would use..
help would be much appreciated!!
Cheers, Brett
Fast -> Slow -> Stop Using Actionscript
i am after a script (lost thru reformat) that allows an animation to start of very fast then slow down then stop as it gets nearer its finishing point. this works well for a shape moving from left to right. it starts off fast then as it gets to its destination is slows down to a halt.
what script is used for this please?
Timer With Actionscript? Need A Mc To Stop After 20 Seconds
Hi,
I have a file that has animation that must stop after 20 seconds...
The way I have it set up is there are different mcs on the main timeline, each with their own animation in their clip... the main timeline is only one frame...
I cannot find references to do this... one MC in particular that I have that I would like to be stopped is animating with Actionscript to make a circular path...
the code is:
mc1.angle = 0;
mc1.angleChange = 2;
mc1.radius = 20;
mc1.centerX = -17.5;
mc1.centerY = 71.0;
function deg2rad(degree) {
return degree * (Math.PI / 180);
}
function animateCircle() {
var radian = deg2rad(this.angle);
this._x = this.centerX + this.radius * Math.cos(radian);
this._y = this.centerY + this.radius * Math.sin(radian);
this.angle += this.angleChange;
this.angle %= 360;
}
mc1.onEnterFrame = animateCircle;
stop();
_____________
the other animations in the other movie clips are just motion tweened...
Does anyone know how to stop an animation after a certain amount of time???
Music Start Stop Actionscript
On my FMX animation I have 2 buttons. One to start and one to stop the music. Could anyone give me the Actionscript to make this happen?
Many thanks
Magyar
Movement Using ActionScript - Stop On An X Point?
Hi everyone,
I was using this tutorial
http://www.kirupa.com/developer/mx/ASmovement.htm
Which is awesome, but i would like to stop the movement on a certain x point. I'm a real noob and am not sure how to do it.
Could someone please post the script I would need? Thanks!
Move To X And Y Position And Stop, For Actionscript 2.0
Hi guys,
I'm relatively new to actionscript x and y positioning.. and i was wondering how i would go about: after clicking a button, moving to a specific x and y axis and stopping?
I am unsure on the coding that i would use..
help would be much appreciated!!
Cheers, Brett
Music Start Stop Actionscript
On my FMX animation I have 2 buttons. One to start and one to stop the music. Could anyone give me the Actionscript to make this happen?
Many thanks
Magyar
Start/stop Sound With Actionscript Problem
...been trying to use .sound commands in AS to start and stop specific and separate sound files but encountered this problem; please help...
actionscript in main scene;
---------
s = new Sound();
s.attachSound("prodigymorello2");
k = new Sound();
k.attachSound("gittarriff");
---------
with individual buttons, to START these sound files went ok but STOPPING them separately didn't work.
for example; "prodigymorello2" is started, then "gittarriff" is also started after the first sound. but when i created individual stopsound buttons for each sound, it stops BOTH the sounds playing - not just the specific sound that was supposed to stop; something wrong with my scripting?
---------
on (release) {
k.stop();
}
---------
(on the "gittarriff" stopsound button)
---------
on (release) {
s.stop();
}
---------
(on the "prodigymorello2" stopsound button)
by the way, both these stopsound buttons work, but as if they were;
---------
on (release) {
stopAllSounds ();
}
---------
why??!!
Scrolling Image Useing Actionscript Cant Get It To Stop
Hi I am new to flash and I would like some help. I want to add a scrolling image to a site I am making. Which I have got working but I can’t get it to stop scrolling.
Could some one please have a look at my fla and tell me what I have to do to get it to stop scrolling at a certain point.
Thanks in advance
MCs Stop Moving After Alpha Value Is Changed In Actionscript
I have a timeline based animation that has multiple movie clips on it. I want the user to be able to fade out and back in various MCs on the screen using buttons.
Problem is, when you modify a movie clip's alpha value with Actionscript, the clip just stops in the timeline.
The timeline is still running though (a 'trace' on the last frame proves this).
The 'faded' movie clip still needs to be active and stiil needs to move as per the timeline so that when it is faded back in it is in the correct position relative to the other MCs.
The actual movie is fairly complicated, but I have attached an example flash file that illustrates the problem.
Any ideas how to make this work ????
Actionscript: Stop Playing At Frame Codehelp
Hi cool people!!
Ok, i've done some actionscripting! wow for me, and it works fine - it depending on variables it stops the progress of something at a certain frame depending on variables sent to the flash file... however... i want to make it play UPTO the certain frame, as opposed to it just landing on that frame immediately! Does that make sense? I can't figuire out how to write that into this code:
Code:
complete4 = totalgirls;
total = 180000;
if (complete4 == total) {
gotoAndStop(100);
}
frame = int(complete4/(total/100));
tellTarget (_root.Girls) {
gotoAndStop(_root.frame);
}
So where it says
gotoAndStop(_root.frame);
It needs to say something like
gotoAndPLAYUPUNTIL(_root.frame);
Haha, i wish that was correct coding hehe
Please help if you can
When Does GotoAndPlay/Stop Actually 'fork' In Actionscript Code?
I was wondering when does a frame decides to branch to another frame?
for example i didnt expect this code to go past that gotoAndStop...
trace(1);
trace(2);
trace(3);
trace(4);
trace(5);
trace(6);
gotoAndStop(10);
trace(7);
trace(8);
trace(9);
trace(10);
trace(11);
trace(12);
trace(13);
trace(14);
yet it outputs then goes to frame 10.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
so i assume if i have..
trace(1);
gotoAndStop(10);
trace(2);
gotoAndStop(20);
trace(3);
it will output, 1 2 3 then the last thing to goto it remembers which is 20 (totally skipping 10)? kinda confusin hehe, as i would expect a gotoAndPlay to act as a sort of basically equal in another programming language
'goto frame10;
break;'
Actionscript For Banners To Stop All Animation After 15 Seconds.
Hello.
I"m having a bit of trouble with creating some actionscript for a flash banner ad.
The specs requires that all animation stop after 15 seconds.
The root of the flash movie is only 2 frames with embedded movieclips that loop. How can I easily stop all animation after 15 seconds...including loping movieclips?
Fast -> Slow -> Stop Animation Using Actionscript
i would like to know how to move a shape from left to right using actionscript. the movement should be fast up until it gets to the end point then slow down as it reaches it. i would also like to do this type of animation for a sahpe that shrinks. so basically it starts off as a sqaure or large rectangle then it shrinks up from the bottom while the top stays at the same value. i hope this is being explained well.
Pause, Stop And Play Audio Actionscript
im trying to make a play, pause and stop btns controlling a mp3 file which is in the library which has a linkage id of Speakers
ive manage to get the pause and play to work but now incorperating a stop button isnt working for me
Code:
var snd:Sound = new Sound();
snd.attachSound("Speakers");
btnHalt.onRelease = function() {
snd.stop();
}
btnResume.onRelease = function() {
snd.start(snd.position / 1000);
}
restartbtn.onRelease = function() {
snd.start();
}
ive also looked into the O'Reilly one to http://www.oreillynet.com/pub/a/java...p1/index1.html
but i still dont think even that will help me i think i need some kinda if statement?
to say basicly if you have pressed the pause btn, then the play btn, play from state pause at, but if you have pressed the stop btn then pressed the play btn, play from start and also if the play btn has been pressed and the audio is playing if pressed again dont play again do nothing.
[CS3, Actionscript 2.0) How To Stop Actions From Running Across Scenes
I'm not even sure that I am putting this in the right place. I originally posted it to the AS3 forum, but when I open a new flash movie, I am choosing 2.0. When I realized that, I posted it here. I apologize if I've posted to the wrong place.
I am using Flash CS3. I'm new at actionscripting and I do not understand it completely. I have a movie that has a few (2-4) scenes in it. Each scene is like its own "commercial" I created a holiday movie that has snowflakes falling using an online tutorial. The movie works fine by itself, but when I load it as a scene in the movie that has my "commercials", the snowflakes continue to fall throughout the rest of the scenes. The holiday movie has a movie clip that has a snowflake falling straight down. The actionscripting duplicates the movie clip randomly as well as its opacity, postition, etc. I understand what I did during the tutorial, but I'm not sure how to get the snowflakes to stop falling throughout the rest of the scenes. I've tried entering a stop after the script but it just seems to stop the scene there without continuing to rotate through the rest of them. I don't quite understand where to tell it to stop. Somewhere else on the actions timeline? In the movie clip itself? Here is the actionscript code I'm using:
this.createEmptyMovieClip("canvas_mc",10);
var i = 0;
myInterval = setInterval(addFlake,500);
function addFlake() {
if (i<20) {
var t:MovieClip = canvas_mc.attachMovie("snowflake","flake"+i,canvas _mc.getNextHighestDepth());
i++;
t._xscale = t._yscale = Math.random()*80+20;
t._x = Math.random()*Stage.width;
t._y = -50;
t._alpha = Math.random()*40+50;
}
}
I hope I've provided enough info. Any help you can provide is greatly appreciated!!!!
Fast -> Slow -> Stop Animation Using Actionscript
i would like to know how to move a shape from left to right using actionscript. the movement should be fast up until it gets to the end point then slow down as it reaches it. i would also like to do this type of animation for a sahpe that shrinks. so basically it starts off as a sqaure or large rectangle then it shrinks up from the bottom while the top stays at the same value. i hope this is being explained well.
I Can't Stop Movie: Steven Grosvenor Actionscript
Hi there
I'm a newbie to the scripts like those within the excellent Steven Grosvenor book.
I have modified them and are working well, but I can't unload one of the attachMovie elements (i'm using Flash Professional).
Due to the single frame actionscripted animation, it is effectively in the main timeline. I'm hoping that I don't have to load an external movie, because I want this to be self-contained, and even when I tried this, I still couldn't turn it off!
If anyone can have a look at the associated fla (saved to MX, and ZIPped) would be so much appreciated.
The animation I would like to turn off is a movie clip of BUBBLES, called 'noise', and it's loaded on frame 1 of the layer 'Actionscript' (see line 26 of the script).
I would like to turn the bubbles off on release of the button on layer 'button'.
To view a recent version online, see http://www.refrigerantreclaim.com.au...in/index2.html
Thanks so much for anyone able to help me.
kind regards
|