Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




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



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-12-2007, 12:06 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

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?

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.

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.

Telling A Movie To Slow Down And Stop - BUT HOW?
I have a mc which is scrolling - when the preloader loads.

When it's complete i'd like to send a command to object "text scrolling" to slow down to stop with EASE 100 Out.

Can anyone plz help me?

tellTarget ("text-scrolling") {
;
}

How Do You Get A Movie To Slow Down And Stop No Matter What Frame It's On?
Hi,

I was just wondering whether someone could tell me how to script a playing movie (within a movie (not on the main timeline)) to slow down and eventually stop.

For example, I click on a button (that's not on the timeline) and I want a certain movie that's already playing to slow down over a period of 10 frames and to stop on the 10th frame.

Any ideas? Anybody?

Thanks for your help!

Blastbum

How Do I Enable A Playing Movie To Slow Down And Stop At The Click Of A Button?
Hi,

I was just wondering whether someone could tell me how to script a playing movie (within a movie (not on the main timeline)) to slow down and eventually stop.

For example, I click on a button (that's not on the timeline) and I want a certain movie that's already playing to slow down over a period of 10 frames and to stop on the 10th frame.

Any ideas? Anybody?

Thanks for your help!

Blastbum

Actionscript Causes The Movie To Run Slow?
Hi,

i have a little movieclip & some duplicateMovieclip script for creating some bubbles... below, i'll give the actions that take place in 3 frames... I embed this little bubble MC into another MC on the stage... When those take place on the stage(after being loaded into the container) as entering to the related section, whole movie starts to work real slow. But when tested as a separate SWF everything seems normal...

Is this because that there are some conflicts/interfering/coincidence between this script and others or is this because of bad coding?

HERE ARE THE CODES in 3 frames,

Layer 1

Frame 1


Code:
baloncuk = "1";
maximo = "40";
rq = "10";
Frame 2


Code:
set("posicionx" add baloncuk, random(800));
set("velocidad" add baloncuk, Number(random(9))+2);
duplicateMovieClip("estrella0", "estrella" add baloncuk, baloncuk);
setProperty("estrella" add baloncuk, _x, eval("posicionx" add baloncuk));
buyukluk = Number(random(rq))+25;
setProperty("estrella" add baloncuk, _xscale, buyukluk);
setProperty("estrella" add baloncuk, _yscale, buyukluk);
i = "1";
while (Number(i)<=Number(maximo)) {
setProperty("estrella" add i, _y, getProperty("estrella" add i, _y)-eval("velocidad" add i));
i = Number(i)+1;
}
Frame 3


Code:
if (Number(baloncuk) == Number(maximo)) {
baloncuk = "1";
} else {
baloncuk = Number(baloncuk)+1;
}
gotoAndPlay (2);
WHAT IS THE SOLUTION? Or your SUGGESTION?

THANKS A LOT...

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

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

[CS3] This Is Embarrassing - How To Stop A Movie Clip? - Actionscript Newbie
Ok, Can anyone help me out? Here is the situation. I have a movie clip that moves across the stage on the main timeline. The movie clip contains the following script which makes the clip move from left to right across the stage. The movie clip starts at position -1254.8. I want to make the clip stop moving when it gets to an x value of -700. It just keeps moving until it's off of the screen. I know this is probably basic and if anyone can help I would greatly appreciate it! Here is the script attached to the moving movie clip:

onClipEvent (enterFrame) {
if (this._x == -1254.8) {
this._x += 1.5;
} else if (this._x >= -700) {
this._x >= -700;
}
}

Slow To A Stop?
I have a box and as soon as I enter the frame I want the box to get bigger progressively slower from a fast start from left to right.
I know it has something to do with this.xscale but I'm not really sure how to appraoch it.

Slow Down And Stop
Hey guys Ive got a quick question to ask, sounds like it should be easy enough.

I have some scrolling pictures going and I would like them to slow down and stop on rollover. The idea is that they wont just stop cold...

Cheers in advance for any help...

Gently Slow To A Stop
It may be beyond Flas's capabilities, but, is it possible to slow down and stop a mc by the click of a button? I think that ease transitions will only effect the mc as it reaches the end.

[AS1]How Can I Make It Stop And Slow?
http://www.kirupaforum.com/forums/at...achmentid=2752

this is my fla that uploaded kirupaforum.

I have two question:
1.how can I make it stop when I rollover a button that have scaled biggest.

2. I want to make it rotate in an Area.

How can I make it slowly when _xmouse not in an Area.for example,I want to make it rotate in 0,0,400,400.when _xmouse >400,how can I make it rotate slowly.

pls help me! thanks a lot.

Slow Motion Works, How To Stop Though?
Hello to all,
searching in the fk forums i found this piece of code (flash 7 & 8) that goes onto the first frame of a movie clip :


Code:
onRollOver = function() {
stop();
slow = true;
slowItup = setInterval(function () { nextFrame();}, 300);
};
onRollOut = function() {
slow = false;
clearInterval(slowItup);
play();
};

and this goes onto the last :



Code:
if (slow) {
gotoAndStop(1);
}

What this code does, is play the movie slower when the mouse is over the movie clip and it returns to full speed when its out. You can use that code for anything looping you want to use slow motion on. However, i cant find a way to make it stop in a certain frame!

If you assume there are 3 people rotating in this movie clip, i would like to make the movie stop, when the user clicks on the face of one of these people.(when their faces are in front). This is just an example anyway. I tried using stop, and other solutions, but it doesnt stop, and if it does stop, it resumes movement with the smallest mouse movement.

any ideas?

thanks!

Drag, Drop, Speed Up And Slow Down To A Stop
Hi All,

I need help in creating an action scrip that you can drag and drop a movie clip, but when you drop the movie clip it speeds up in the beginning then slows down to a stop to the exact point where you dragged it from. If anyone can help me with that I'd much appreciate it! Thanks in advance!

Draconis

2d (simulated 3d) Carousel Slow To A Stop When Mouse Off
got a carousel (thanks Lee Brimelow!) that i've modified to my liking. now i just need to figure out how to taper off the speed to zero when the mouse moves away from the carousel.

I've figured out how to make the carousel stop by simply checking mouse position relative to center of carousel... but not sure how to taper the speed down or up (negative speed means spinning in other direction) until the speed equals zero.

i tried using a for loop to bring speed up/down until it hits zero but no luck.. any suggestions?

code that determines speed:

Code:
function mouseChange(event:MouseEvent):void
{

var distX:Number = mouseX - centerX;
var distY:Number = mouseY - centerY;
trace("this far away: "+distX+" and y: "+distY);
trace("This is speed: "+speed);
if(distX > -308 && distX < 292 && distY > -45 && distY < 140){
speed = (mouseX - centerX) / 3000;
}else{
speed = 0 ; // here is where i want to determine if pos or neg speed and taper up/down to zero!!!
}
}

Carousel To Slow Down And Stop On Cursor Command.
Hi guys,

I'm currently finishing off my own version of the tut Carousel. I've been trying to work out how to get the Carousel to slow down and stop when the cursor rolls out of the Flash area. Currently the Carousel keeps spinning rapidly. I'm a bit of a novice, sorry!

Any help would be much appreciated.

Thanks

RollOver-rotate & Speed Up | RollOut-slow & Stop ?
I am attempting to make a MC spin when the mouse rolls over it - I want the spinning to increase in speed while the mouse is making the MC active. When rolled out I then want the MC to slow to a halt....

The code below is great for the spinning but I'm having trouble applying it to a button or (rollOver) & (rollOut) scenario

onClipEvent(load){
rot = 1;
del = 10;
}
onClipEvent(enterframe){
this._rotation += rot;
del -= 1;
if(del == 0){
del = 10;
rot += 1;
}
}

Thanks if you can help

How To Make A Scoll Slow To A Stop Im Both Forwards And Reverse
Hi there.
Ive created a scroll of thumnail images for a website which can be found at: http://60watts.org/pigment/artists.html its not a movie clip, its all done on the main timeline. i created a "controller" ( amovie clip with nothing in it, just three frames, with an action script on each respectivly:

frame 1:stop();
frame 2:_root.prevFrame();
frame 3: gotoAndPlay(2);

the buttons on the main timeline are simple

to go forward:
on (press) {
play();
}
on (release) {
stop();
}

to go back:

on(press) {
_root.controller.gotoAndPlay (2);
}

on(release) {
_root.controller.gotoAndStop (1);
}


what can I add this to make the scroll NOT abruptly stop??
again, the thumbnails are not a movie clip, its all in the main timeline.

thanks for your time.
60watts

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);

Large Images / Alfa Tween / Slow Slow Slow... Help Please
I'm working on a site at the moment and one of the main eyecatchers is there is a slideshow-type of animation running in the background the whole time.

There's a dozen (large in pixels, but not in kb) .jpgs that have a minute long fade between images, a few seconds pause and then onto the next fade.

I've tried just making a normal alfa tween, I've tried making the slideshow as a seperate .swf, I've tried dynamic images with .xml, I've even tried making the .fla background transparent and making the slideshow on the html page using javascript.

But all make the site run very slowly. Text scrolling is slow, short rollover animations are slow, etc. etc.

My question is: Is there a way of making a super light alfa tween with large images?

99% of the threads regarding slideshows here at Flashkit have many views but no replies. I need help, and soon. Many many thanx to anyone that can point me in the right (or any) direction.

Help, Slow Movement With Actionscript.
This is probably really easy but,

I need to know how to move/rotate an object slowly using action script. I made a test file to try and rotate a MC by 20 points left or right in a smooth motion. Here is a code example:

function rotateRight() {
for(var i=20; i>0; i--) {
_root.myDial._rotation = _root.myDial._rotation + 1;
}
}

Now this works.. But it rotates it so fast I might as well not use a counter. I hope I'm explaining myself well .

Thanks in advance,

Slow Actionscript Fade In : (
I'm working on a slide show and I have some actionscript fades that are called when the images change. I have noticed that if a have just a couple of images the fades work great, but when I have more images the fades are really slow.

Take a look at the link below. First click on "family" there are only two images here and the fades work pretty good. Then refresh the page and click on "recent" there are 12 images here and the fades are way too slow. How can I correct this so the fades work better?



BTW, you can download the source files at the link above.

Slow-motion Using Actionscript HELP
I am tyring to animate a box to slide onto screen and make it look more realistic than a simple motion tween.

I want the box to slide on and slow down as it reaches its destination, and then stop. If you can imagine pushing a box along an ice rink - it would slide along rapidly and then slide to a stop.

Does anyone know the proper actionscript for this? And please keep in mind I am a bit of a novice when it comes to A.S

cheers!!!!

[F8] Actionscript Transition Really Slow
Tried tweaking the actionscript to my needs, changing the size of the squares, and then amount of squares in order to cover the length of the images I want. Managed to get it, but now it runs painfully slow! I even tried taking the tweens out as I figured that maybe flash was trying to do too many things at once. But it still runs as slow without the tweens, which doesn't seem to make much sense to me......am I missing something?

Actionscript Editor Very Slow
Flash Pro 8

I have a Flash movie I am working on. It is pretty big (fla is about 90Mb) it's for a presentation.

Flash itself runs fine, I can do everything without a problem until I come to open the actionscript editor, that's when it all slows down.

There isnt much script, only a few lines, but even if I edit one value I then get the egg timer for about 4 seconds before the change appears in the editor.

If I restart Flash it is all fine again so long as I dont open the script editor, so it seems to be related to that.

Whats Flash trying to do thats so difficult here?

Thanks

Actionscript Transition Really Slow
Hello

Trying out using a really nice transition that I found on flashkit. Here - http://www.flashkit.com/movies/Effec...5431/index.php


Tried tweaking the actionscript to my needs, changing the size of the squares in the script, and then amount of squares in order to cover the length of the images I want. Managed to get it, but now it runs painfully slow! I even tried taking the tweens out as I figured that maybe flash was trying to do too many things at once. But it still runs as slow without the tweens, which doesn't seem to make much sense to me......am I missing something?!!

Any help much appreciated ;-)

Can't attach my fla though...it's 2MB. But the swf it publishes is 70k which shouldn't be the reason for the problem I don't think!

Thanks

Pat

Combobox Stalls/slow W/actionscript
I have a combobox that I am trying to load from a dB but the swf is slow/stalls when tested. Can anyone notice something that I am not doing correctly.


PHP Code:



_root.prospect.information.rep = new LoadVars();
prospect.information.rep.load("http://localhost/php/salespeople.php");
prospect.information.rep.onLoad = function(success) {
    for(this.a=1;this.a<=this.total;this.a++){
        this["object"+this.a] = this["People"+(this.a)].split("|");
        _root.prospect.information.comborep.addItem(this["object"+this.a][0]);
        this["object"+this.a].colors = this["object"+this.a][4].split(",");
        this["object"+this.a].splice(4,1);
        delete(this["People"+this.a]);
    }
}

Pause Or Delay In Actionscript For Scrolling (to Slow It Down)
Hey I am having some problems and hoping one of you ninjas can help.

I have a scroller for text i want to autoscroll, and my code is:

onClipEvent (enterFrame) {
this.textField.scroll += 1;
}


now this scrolls super fast, way to fast in fact. It would be great to be able to change that += 1; to += .2; but it wont work ( i assume decimals dont work in actionscript?

this little code loops, so is there any simpe way to put in a pause or something to slow it down?

Thanks in advance guys/gals!

Actionscript To Gradually Slow Down Movieclip Tweens?
I'm trying to find the effect of something slowing down the closer it gets to where it is going to stop. Rather than try and moviclip my way through it, I'm going to see if I cant just paste some code on each item.

Know anything about how to do this?

Actionscript MC Runs SLOW; Speed Up Suggestions?
I've put together a jet engine with spinning fan blades; ok, cool. Problem is that it runs SLOWWWWW.

Here is the jist of what I'm doing:

1. I have a MovieClip.prototype that draws the fan blades (using lineTo and curveTo) based on the number of blades the fan has.

2. I create an empty movieClip that will hold 4 sub-movieClips.

3. I add the 4 clips to the empty movieClip using a loop. Each time thru the loop, I call the MoviClip.prototype to add the fan blade drawing to the current instance of the sub-movieClip; that is, I create a 'snap-shot' of the fan blade at its current rotation angle add it to the sub-movieClip. I then bump up the rotation angle and run thru the loop again until I have 4 'snap-shots' of the fan blades drawn at 4 different angles.

4. I then add an onEnterFrame event function to the empty movieClip that:
a. keeps track of the last 'snap-shot' sub-movieClip shown and
b. hides the last 'snap-shot' sub-movieClip (snapShot0._visible=false) and shows the next 'snap-shot' sub-movieClip (snapShot1._visible=true)

This gives the illusion that the blades are turning.

Anyway, HOW CAN I SPEED THIS UP!

To see the swf: http://www5.brinkster.com/ralanis Look for TF-39 Engine in the menu on the right; it is the LAST item in the list.

Don't know if this will work: http://www5.brinkster.com/ralanis/fan2c.html


Thanks!

ra

Problem With Flash Actionscript When Using Slow Connection
I have a preloader/progress bar that works perfectly whith a Broadband connection. However, when I view the same movie with a 56k the preloader doesn't work.

I think Flash is missing function calls or listeners when working with slow bandwidth. Has anyone else had this problem? Or any idea what might be a work around?

It's not just my script... i have tried others on the net. If you know of one that definitely works with slow connections please lead me to it! Thanks.

[Flash 8] Scenes Slow Down ActionScript Performance
ello, I've been making a game and it worked great before I added the preloader.

I have many onEnterFrame functions, to shrink bars with energy, life, etc., and they work great if there's no loader before the game.

I did some tests and found out that even if I add a blank scene before the main scene with all the scripting, some scripts don't perform as they do normally (they are slower).

Why the hell does this happen? How can I fix it o.o?

Thanks in advance,
-javier

XML, Slow Moving, Jittery.. Actionscript Problem?
Hi,

I have a series of SWF's which are loaded inside another SWF.. Each SWF loads the following script at frame 14;

#include "xmlnitro.as"

function Article(id, link, headline, source) {
this.id = id;
this.link = link;
this.headline = headline;
this.source = source;
}

function makeArray(success) {
var i, j, mainTag, id, link, headline, source;
if (success) {
for (i=0; i<=moXML.childNodes.length; i++) {
if (this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName == "moreovernews") {
mainTag = this.childNodes[i];
}
}

for (i=0; i<=mainTag.childNodes.length; i++) {
if (mainTag.childNodes[i].nodeName == "article") {
articleTag = mainTag.childNodes[i];
id = articleTag.attributes["id"];
for (j=0; j<articleTag.childNodes.length; j++) {
if (articleTag.childNodes[j].nodeName != null) {
if (articleTag.childNodes[j].nodeName == "url") {
link = articleTag.childNodes[j].firstChild.nodeValue;
} else if (articleTag.childNodes[j].nodeName == "headline_text") {
headline = articleTag.childNodes[j].firstChild.nodeValue;
} else if (articleTag.childNodes[j].nodeName == "source") {
source = articleTag.childNodes[j].firstChild.nodeValue;
}
}
}
thisArticle = new Article(id, link, headline, source);
articles.push(thisArticle);
delete thisArticle;
}
}
_root.gotoAndStop("showArticles");
}
}

// articles is an array of Article objects
var articles = [];

// read xml and display when loaded
moXML = new XML();
moXML.ignoreWhite = true;
moXML.onLoad = makeArray;
moXML.load("news.xml");

and then at the end frame it loads;

news = "";
for (i=0; i<articles.length; i++) {
news += "<b>" + articles[i].link + "</b><br>" + articles[i].headline;
news += "<br><font color='#999999'>" + articles[i].source + "</font><br><br>";
}
stop();

the site is found here: http://www.hatterdesign.com/six/

and the XML file is here: http://www.hatterdesign.com/six/news.xml

and you can probably see from the flash, that the XML loads randomly, sometimes it loads, sometimes it doesnt...

Apparently it works on a Mac.. so I am not sure what it is?! Also, it has come to my attention that it takes up a huge amount of processing power? Why is this, its mainly vecotr and quite low key?

Thanks,

Max

Jittery Flash, XML Slow Loading.. Actionscript Problem?
Hi,

I have a series of SWF's which are loaded inside another SWF.. Each SWF loads the following script at frame 14;


Code:
#include "xmlnitro.as"

function Article(id, link, headline, source) {
this.id = id;
this.link = link;
this.headline = headline;
this.source = source;
}

function makeArray(success) {
var i, j, mainTag, id, link, headline, source;
if (success) {
for (i=0; i<=moXML.childNodes.length; i++) {
if (this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName == "moreovernews") {
mainTag = this.childNodes[i];
}
}

for (i=0; i<=mainTag.childNodes.length; i++) {
if (mainTag.childNodes[i].nodeName == "article") {
articleTag = mainTag.childNodes[i];
id = articleTag.attributes["id"];
for (j=0; j<articleTag.childNodes.length; j++) {
if (articleTag.childNodes[j].nodeName != null) {
if (articleTag.childNodes[j].nodeName == "url") {
link = articleTag.childNodes[j].firstChild.nodeValue;
} else if (articleTag.childNodes[j].nodeName == "headline_text") {
headline = articleTag.childNodes[j].firstChild.nodeValue;
} else if (articleTag.childNodes[j].nodeName == "source") {
source = articleTag.childNodes[j].firstChild.nodeValue;
}
}
}
thisArticle = new Article(id, link, headline, source);
articles.push(thisArticle);
delete thisArticle;
}
}
_root.gotoAndStop("showArticles");
}
}

// articles is an array of Article objects
var articles = [];

// read xml and display when loaded
moXML = new XML();
moXML.ignoreWhite = true;
moXML.onLoad = makeArray;
moXML.load("news.xml");


and then at the end frame it loads;


Code:
news = "";
for (i=0; i<articles.length; i++) {
news += "<b>" + articles[i].link + "</b><br>" + articles[i].headline;
news += "<br><font color='#999999'>" + articles[i].source + "</font><br><br>";
}
stop();


the site is found here: http://www.hatterdesign.com/six/

and the XML file is here: http://www.hatterdesign.com/six/news.xml

and you can probably see from the flash, that the XML loads randomly, sometimes it loads, sometimes it doesnt...

Apparently it works on a Mac.. so I am not sure what it is?! Also, it has come to my attention that it takes up a huge amount of processing power? Why is this, its mainly vecotr and quite low key?

Thanks,

Max

[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

Movie Clip Runs Slow When There Are Multiple Movie Clips Running
Hi, Can someone help me out? I have made a flash where a movie clip containing text runs at the same time that a second movie clip runs (movie clip 2). I used function updateCursor() to replace the standard mouse symbol with the movie clip symbol (movie clip 2). After the scene runs a few times at the correct speed, everything within it slows down markedly, which I don't want. Why is this happening? Any ideas? I have actually seen something similar in Flash 5...but I can't figure out how to keep this from happening!!

TEXT SCROLLBAR THAT MAKES TEXT SLOW TO A STOP
someone posted a tutorial based on a site that had a text scroll bar that that when pulled and stop made the text scroll, but it didnt just stop...

...the text faded to a stop...

does anyone have that link by some chance or a link to a tutorial....

i always use text scrolling buttons, but i want to make a scroll bar to drag for this next site..

thanks in advance,
mannyme80

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
}
}

Container Flash Movie Slow Down Actual Movie?
Hi, would loading a huge flash file into a byte size container flash over the internet slow down the playback of the actual swf?

Slow Playing Movie When Using Load Movie
Hi....i'm using flash mx

I have a movie which loads on level 1. I noticed it plays slower than it does when i just open it directly. (just straight from the computer). It is designed to open on level 1. any ideas why it is lagging?

Cheers

Miffy

External Movie Slow Down The Main Movie
I have a main movie (web site) and a few buttons. Click on the buttons loads external swf movies. Problem is that when i do that (load external swf) , the whole movie becomes slow and i mean really slow.
I don't get it why is that happening. My external movies are not bigger then 50 kb.
Anyway the frame rate of main and external movies is 30 fps.
Does anyone know why is this happening, and maybe have a soulution to resolve the problem.

Thanks!

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

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

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)

Dir Movie Too Slow
It seems the dir movie I made out of pasted and modded *.swfs runs pretty good when small, but slows when full paged. I got 256 RAM on an AMD 500 and 64 SDRAM video. I used Macromedia Director 8.5 and this was only my 3rd movie.

Anyone wanting to see it at http://www.voiceovermedia.com could maybe tell me what to do.

I tried to raise the frame-rate as high as it would go and found no difference past 300fps.

Can too many *swfs slow down the movie? I selected all the cast members when I adjusted the frame-rate also.

Below 100fps and it really looks slow.

No hurry on this mystery but I'd love to know whats up with that.
----
Thanks!

[Edited by Terran_Defense on 04-11-2002 at 11:43 AM]

More MCs Slow Down Movie?
I'm making a Flash page that has quite a few movie clips, and its getting to the point where putting more MC instances starts to horribly slow down the animation and make everything jerky.

For instance, I want to have a rotating symbol movie clip, but when I place one instance on the stage it rotates very unsmoothly, even though when I test the MC by itself it rotates fine. Also, when I place more instances (like 4 or 5) of the same rotating symbol on the stage, the animations become even more jerky.

Is there a way to get around this? Correct me if I'm wrong since I'm no expert, but I doubt my movie's complicated enough (around 30-40 MC instances on the stage at once) to start pushing the limits of Flash.

Copyright © 2005-08 www.BigResource.com, All rights reserved