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




Stopping A Loadmovie?



Hiya guys, I'm guessing this will be an easy question to some


I've imported another flash file, but i carnt get the damn thing to stop looping?

createEmptyMovieClip("container",1);
_root.film.loadMovie("www.site.com/flash.swf","container");
container._x = 0;
container._y =0 ;


This works fine, it plays and everything.

But once its finnished, i would like it to go to the next scene instead of just looping round and round.


Many thanks.



FlashKit > Flash Help > Flash MX
Posted on: 04-27-2005, 07:13 AM


View Complete Forum Thread with Replies

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

Stopping A LoadMovie
I have a jpeg image that loads when a button is clicked (using loadMovie). If the user clicks another button before that jpeg is done loading, I want the loadMovie command to stop loading the current jpeg, so I can start loading the new one. Basically I am asking how to stop a loadMovie command. Can this be done?

LoadMovie Stopping Listener?
Any help on this would be greatly appreciated.

Problem: I'm dynamically creating an empty mc called "bg" I'm then keeping bg position in the top left corner on stage resize. I have everything working fine - I've tested the position of bg with a trace action and it is moving as planned when the stage is resized. The problem arises when I load bg.swf into bg.

loadMovie("bg.swf",bg);

When I ad this line of code the whole operation stops working. Can someone explain why this is happening. I'll put all relevant code below. Thanks.

fscommand("allowscale", "false");
// switch to showAll mode
Stage.scaleMode = "showAll";
Stage.originalWidth = Stage.Width;
Stage.originalHeight = Stage.Height;
// switch back to noScale
Stage.scaleMode = "noScale";
Stage.onResize = function() {
this.left = this.getLeft();
this.top = this.getTop();
this.right = this.getRight();
this.bottom = this.getBottom();
};

_root.createEmptyMovieClip("bg",1);

//remove the following line and the trace actions below work fine.
//add this line and trace action no longer fire.
loadMovie("bg.swf",bg);

// retrieve boundaries
Stage.getLeft = function() {
return -1 * (this.width - this.originalWidth) / 2;
};
Stage.getTop = function() {
return -1 * (this.height - this.originalHeight) / 2;
};
Stage.getRight = function() {
return this.left + this.width;
};
Stage.getBottom = function() {
return this.top + this.height;
};
Stage.addListener(Stage);
// register bg to receive notification of onResize
Stage.addListener(bg);

bg.onResize = function() {
this._x = Stage.left;
this._y = Stage.top;
trace(bg._x);
trace(bg._y);

};

Starting And Stopping A Loadmovie Swf
- I've done a product demo that loads 4 daisychained swf's to play in sequence inside a base movie with a nav bar in it called base.swf

I load the first movie with _root.contents.loadmovie("firstmovie.swf");
then at the end of that I put _root.contents.loadmovie("secondmovie.swf");
The navigation bar has buttons that allow the viewer to jump to each section and all this is working well.

However, I put a 'stop' and 'play' button on the nav bar and want to be able to pause the loaded movie and audio (a voiceover), then resume from exactly the same point when you click 'play'.

What is the correct way to do this and is the above loadmovie logic appropriate for this?

Thanks in advance for any input! My brain is fried tonight...

Starting And Stopping A Loadmovie Swf
- I've done a product demo that loads 4 daisychained swf's to play in sequence inside a base movie with a nav bar in it called base.swf

I load the first movie with _root.contents.loadmovie("firstmovie.swf");
then at the end of that I put _root.contents.loadmovie("secondmovie.swf");
The navigation bar has buttons that allow the viewer to jump to each section and all this is working well.

However, I put a 'stop' and 'play' button on the nav bar and want to be able to pause the loaded movie and audio (a voiceover), then resume from exactly the same point when you click 'play'.

What is the correct way to do this and is the above loadmovie logic appropriate for this?

Thanks in advance for any input! My brain is fried tonight...

Immediately Stopping A Loaded Swf (loadMovie)
Hi all,

Probably a very simple question, but if I load a movie into a _mc using the following:

loadMovie("external_file.swf", "empty_holder/empty");

Is there anyway to stop it immediatley on Frame_1.

It's an external swf that has compressed video so I can't edit that file and add a stop to F1 (which would be easiest I guess!?)

Thanks,

Nik

Movieclip.loadmovie -> Stopping When Movie Is Finished
well, title is pretty clear i think..
i have loaded some movie in a movieclip and i want it to play and when its finished, to stop
what it does now: play, loop
i dont know how to set a parameter or condition or something to let stop, plz help

grtz !

Weird Problem With LoadMovie And Stopping Midway Through
It's been awhile since I've posted anything here, but it's nice to be back. I have a site at http://tdcwc.com. After the intro, under the projects menu, if you click a project and while it's pre-loading, you click another project, the stop actionscript doesn't work anymore for the loaded movies. The sub-movies will just zip through all the frames blatently ignoring the all-powerful stop command. If you let the movie load completely, there isn't a problem. Why would this be happening?

I have an empty mc called holder_mc that I load the external swf's into. I even tried adding holder_mc.unloadMovie(); before the load command, but that did nothing.

Any ideas?

Jake

Stopping A Action Scrpit Without Stopping The Movie ?
Hello all,

I new to flash and used a snow script i found on flash kit. Anyway my problem is i cannot stop the snow half way thought the movie ?

Link to the working file

http://www.megaupload.com/?d=S0ZNMFP6

Thanks

Stopping A Action Scrpit Without Stopping The Movie ?
Hello all,

I new to flash and used a snow script i found on flash kit. Anyway my problem is i cannot stop the snow half way thought the movie ?

Link to the working file

http://www.megaupload.com/?d=S0ZNMFP6

Thanks

Stopping A Movie Without Stopping Submovies
I have a looping animation contained in another movieclip, the parent clip stops on about frame 20 and this causes the submovie to stop playing, is there anyway round this.

How To Loadmovie The Place Iwant? I Have Loadmovie But It Just Take All The Screen
i load a swf and it just take all the space
and my buttoms and others are all been covered
here is how i do it

onClipEvent (enterFrame) {
ifFrameLoaded (1) {
loadMovieNum ("first.swf", 0);
}
}


i put this in the layer called middle where i have put a instance of a w700 h270 movieclip so i can try to loadmovie the same size of it but it just failed
did i miss anything else? i know i did
please tell me~~~~~~~~~~~~~~~~~~~~~

Stopping All MC'S?
is there anyway using code to just stop all playing mc's and then resume them all?

thanx

Stopping A Mc From Another One...
Whats going wrong with this script?

I try to control a mc from another one:

-----------------------------------------
1. MCName is my variable for the clip!
2. Both mc`s are in a mainmovie!
-----------------------------------------

on (release) {
MyClip = "_root"+"."+_root.MCName;
MyClip.gotoAndStop(2); -> I think here is my mistake!
}

------------------------------------------

Thanks!!

Mikalux

Stopping A MC
Hi All,

I'm struggling with this one and i'm sure that it's an easy one to solve.

After downloading a menu system from flashkit i've amended the code and design slightly to give me the look that I want. Each button is allocated to a wedge on the menu system, which when clicked opens and when hovered off closes.

you can find the menu at www.partyboy.org/flashstuff/

Each button has the code:

on (rollOver) {
revolver_mc.carrRotate(number);
}
on (rollOut) {
revolver_mc.cartRetract();
}
on (release) {
revolver_mc.cartOpen();
}

Where the number is the relevant wedge to rotate to.

2 Questions for ya:

1. How can I force the movie to finish even if say, i've hovered over another button. eg. I hover over the "journal" button, I want that movie to finish playing even if I move the mouse over the "link" button before it's finished?
2. I have a text effect which I want to apply to my buttons. I want this effect to play when the page loads up and stop. How do I apply it without affecting the action of the buttons i've already added?

Anyones helps is much appreciated!

MP3 Is Not Stopping
I am only a novice so don't laugh.

I am creating a Flash movie and i want to have an MP3 soundtrack playing in the background. When i test the scene, the animation finishes and the music keeps on playing, then when i want to test the scene again, i have to wait for the original music to finish otherwise i get an overlap of music with multiple amounts of the same track playing at once.

All i want to do is to have the music stop when the animation is finished.

Thanks for your help

My movie so far can be seen here: http://freespace.virgin.net/pete.wills1/Test/_notes/The Iron Stick Tornament Round 1.swf

Stopping _x-=#
Hey-

I am wondering how to make the script:

onClipEvent(enterFrame){
this._x=this._x-=#;
}

I can get itto move, but not stop! Any help is appreciated.

Why Is It Stopping?
Here is the code:...

onClipEvent(enterFrame)
{
_root.loadMovie(_root.path[_root.i]);
trace(_root.i);
}

this is hooked into one of the MC's and it works, The mc loads the picture and I can see it and everything, problem is, it seems the loadMovie method stops the running of the mc. cause when the trace window shows up I see the number for the frame where it loaded the image from loadMovie, but then there is no repeating in the trace window. Now if I comment out the loadMovie method. the trace window pops up and I see i flip through like normal.

Why is this?

Cedric

Stopping ?
Is there a way to stop a flash but still have the last frame/image/button remaining visible?

Stopping A Swf
I am really new at this flashMX...been playing with it for a couple days...my question is:

I have 2 buttons START and STOP on a bitmap picture...when I press the START button the movie "norma_girl_Scene 1.swf" plays...how do I make it stop and exit with the second STOP button...the script for the START button is..........

on (release) {
loadMovieNum("norma_girl_Scene 1.swf", 1);
play}

Stopping
ok I got a bunch of crap goin on in my movie it play till about frame 355 then it supposed to go to the main page. It keeps loopimng and goin back to the beginning and only flashes the main page quickly.
I;ve tried just the StopO; command but it still loops back to the beginning. How do i make it sit and the main page?

Stopping
I have an amination already created and i want it to stop repeating itsself. How o i go about doing this?>

Also i would like to post this animation on my website. How can i display this on my site.

Stopping All MCs At Once
Anyone have any ideas on stopping all MCs (_root, nested, etc) with one button click fromthe _root timeline?

Any help is appreciated!!

Stopping _x And _y
Code:
onClipEvent (load) {
_x = Math.round(_x/5)*5;
_y = Math.round(_y/5)*5;
dx = _x;
dy = _y;
}
onClipEvent (enterFrame) {
if (Key.isDown(1)) {
// Mouse click
dx = Math.round(_root._xmouse/5)*5;
// Round off
dy = Math.round(_root._ymouse/5)*5;
// to nearest 5
}
if (_x != dx) {
_x += dx>_x ? 5 : -5;
// Add 5 or -5 depending on dx>_x
}
if (_y != dy) {
_y += dy>_y ? 5 : -5;
// same as before
}
if (_root.follow, hitTest(_root.line)) {
this.stop();
}
}
see where it says this.stop(); ? well the _x and _y do not stop they keep on going.. i've tried _root stop(); everything..

i want to stop the script from continuing..if it doesn't then the mc will just keep going and going..

please help!

Stopping
Hi All,

I'm just learning AS so if this is a really dumb question ... sorry.

I have a remote control with 6 buttons ... screen changes for each button press and displays new info on a TV screen.

Button 6 - which will play frame 7 (code below) will play an embedded wav file also.

MY PROBLEM IS THIS ... I cant work out the code, how to stop the audio when another button is pressed eg button 4 or 5.

Please help ... deadline is in 6 hours and I'm really stuck__________________________________________________ _____

on (press) {
tellTarget ("led") {
gotoAndPlay(2);
}
tellTarget ("_root.tv.channels") {
gotoAndStop(7);
}
if (_root.tv.boxen.boxen_anaus == 0) {
tellTarget ("_root.tv.boxen") {
prevFrame();
}
}
}
on (release, releaseOutside) {
tellTarget ("led") {
gotoAndPlay(1);
}
}
__________________________________________________ ___

Stopping It
Alright guys I need a little help here. Me and a buddy are making a flash intro in Flash 8 Professional. So we have a star coming across the background from the left hand side and using the "explode" effect we have it break apart or explode into peices as music is playing in the background. We have our video done right?...or so we thought. We only want to video to play once..but it continues to loop over and over again. So how do we stop it from looping?

Is there a setting to do it?

Any help is much appreciated. Thanks!

Stopping An MP3
Hi so iv created 2 scenes which are connected by a button which iv managed to code ok but now my problem is when I use the button the next scene appears but the mp3 from the previous scene keeps playing. Is there a code I can put into the actions of the button to stop the mp3?

Stopping An MC?
A vairable is set that is the frame that I need an MC to stop on.

How can I make it so that the MC keeps playing through and when the variable gets set, it plays through the animation and just stops on that frame. So if the stop frame is 5 and when the var is generated the mC is on frame 6, the MC wont just jump to frame 5, it will play through 6-30 then 1-4 and stop on 5...

Thanks

[F8] Stopping Xml
Hello everyone was wondering if anyone could help me. I have built a map that pull all the data off an xml sheet. Anyway i need to breakdown the map by catogories so have started building other xml sheets. (client choice) How do i get flash to stop loading one and start loading another xml sheet. Is this even possiable. Thanks in advance

Stopping Flv
How do you stop an flv on a cue point? How do you load a movie clip on a different cuepoint?

I just want a progressive flv to stop/pause at the end of the clip instead of going back to the beginning. I also want to load a sound clip in the middle of the video on a cue.

Stopping Mc - Still Not There
on actions layer, frame 1 inside my movie clip I have:

counter

on the last frame of an animation layer inside the same mc I have:

if (counter < 4){
counter += 1;
gotoAndPlay("frmStart");
}

(and) it is still not stopping as desired....

please- any advice would be helpful

Stopping MC's
Hi all, thought I would post this in the Newbie section, because it seems like a newbie type question...

MC's automatically loop by default. So if you have a twenty frame MC, you better place a stop(); action on frame 20, or else you are in for a loop....

My question is, what if you have a 1-framed MC...does that continous loop also if you DON'T place a stop(); action on the first frame? Or is Flash smart enough to recognize and automatically stop this MC?

Lets just say you place a graphic in that first frame of the MC, and the only reason you did this was so that you can target the graphic later. IS there a need to place a stop(); action in the frame?

I always place stop(); actions in my MC's out of habit (don't want any surprises down the road)...just wondering if this was necessary for 1-framed MC's.

Thanks.

Stopping Everything Where It Is
Last edited by cybling : 2002-06-26 at 04:18.
























Hey,

I dont want everything to stop now, i figured what i want out..

I'm creating a game in whihc you have to shoot ducks/elephants etc, a funfair game.

The probem is this:

I have a duck whihc is a button. On the up state i have an MC where is rolls across the screen. I have another MC where the duck falls where it stands. I've put this MC onto the hit state. I dont know how to tell flash that when ou click the duck, play the falling duck movie exactly where you clicked the target. At the moment i can't even get the falling clip to work never mind making it play when you shoot. I have this so far...

http://www.cyblingdesign.com/external/duckshoot.swf

Just ignore what comes after the first part..

Please help me! My deadline is in 2 days. Thanks,

Aidan

LoadMovie Target Vs. LoadMovie Level
can someone please explain to me why when I load an external movie as a target, the action scripting in the loadedmovie doesn't work.
But if i load the movie into a level it works fine. I want to load into a target beacuse I want it positioned in a specific co-ordinate.

thanks

LoadMovie Calling MC With LoadMovie Problem
I am loading a movie clip into a target MC on my timeline and it works fine, but the movie clip that I'm loading in is also using loadMovie to load a movie into a MC on it's own timeline. For some reason, the MC that is getting loaded doesn't load the MC it is calling on it's own timeline. It works fine when I test it out on it's own, but as soon as I load it in using the first MC, the loaded MC doesn't call the movie clip it's supposed to load.

Any suggestions?

-k

(I said "load" way too many times!)

LoadMovie/loadMovie From Loaded Movie?
I know I know .. messed up heading .. but ..

I have a button that loads a swf into an empty mc (sliderContainerMC)

(release) {
_root.sliderContainerMC.loadMovie("http://www.justinsteiger.com/flash/anims/sliderOpen.swf");
}

That works as advertised. The difficulty comes when I tell the button on that swf to load a new swf into the same MC (sliderClose.swf). Since the swf in the MC (sliderOpen.swf) isn't the same swf (loading into a MC in justinsflashsite.swf) do I need to change the path? Say to include something telling it to load the swf into the parent swf?

Eventually the swf that's called into the empty MC is going to have buttons that are supposed to call up other swf's that load in other empty MC's around the site. HELP?!

Thanks,
Justin
http://www.justinsteiger.com/flash/justinsflashsite.fla (Is the parent swf)

Loadmovie Inside Loadmovie Problem?
Hi,

I have a main movie which use's the loadmovie function to load up an external SWF. But then inside that SWF there is another loadmovie function to load another external SWF into that.

But the problem is that when the first movie is loaded all of its loadmovie commands are disabled.

Is there something i could do to rectify this?

Thanks,
T

Local Loadmovie Ok / Online Loadmovie Bad
I'm at my wit's end with this one. I have an swf that's loading fine locally but refuses to be loaded online. Here's the script. It's in the first frame of the root mc ....
code:
_root.createEmptyMovieClip("slideshow", this.getNextHighestDepth());
_root.slideshow.createEmptyMovieClip("container_mc ", 0);
slideshow_btn.onRelease = function() {
this._visible = 0;
this.gotoAndStop(1);
_root.slideshow.container_mc.loadMovie("temp.swf") ;
};


Loads no problem locally. Nothing when I upload it. I have lockroot set to true in the same frame as the above script. I also tried a simple test with ....
code:
_root.slideshow.loadMovie("temp.swf");

.... in a simple mc containing only a 'slideshow' mc. Works if I access the URL directly, doesn't if I put it in an html page. What mistake could I be making?

thanks
mark

[F8] Need To Change A Variable In A LoadMovie Mc While In Another LoadMovie Mc
So I have a shell mc that has 2 mc's loaded into it with loadMovie (let's call them project1 and project2). While I'm in project1...how do I change a variable in project2 to be true instead of false?

I thought I could do it like this (in Project1...):
myBtn.onPress = function()
{
_parent.dropZone_project2.myVar = false;
}

Nothing seems to be working. Any insight would be greatly appreciated.

Resize LoadMovie Container, Not LoadMovie?
I've searched and searched but haven't found what I'm looking for.

I'm wanting to load different sized .swf into the same field and I want the field to adjust (preferably some smooth transitions for the size change) to fit the size of each different .swf loaded. I've seen it done on quite a few sites but I haven't been able to find a tutorial of any kind addressing this specifically. Can anyone help?

I'm keeping it simple, i.e. thumbnails with titles above or off to the side; click one; the field where the .swf will play adjusts itself; .swf loads and plays. When completed, user can click another thumbnail and the previous .swf will "unload" then the field adjusts for the new .swf and the new one loads. Follow me? Just any tutorial you guys may know of would be great.

Here's the closest example I could find... cool site too. http://www.pollenation.org

Loadmovie Over Prev Loadmovie And Positioning Jpg
Hello, a little question and i have the feeling i am very close.

i use loadmovie to load an image into an movieclip.
that movieclip goes to the position x and y of the movieclip - the loaded image width/2

my problem is that when i load a new image the position is not correct.

my code:
--------------------------------------------------------------------------------------------------------------------
function nextImage1()
{
if (p < total - 1)
{
++p;
if (loaded == filesize)
{
trace(p);
trace("x van inst0"+litlimg_instance.ltlimgmc_instance0._x);
trace("y van inst0"+litlimg_instance.ltlimgmc_instance0._y);
litlimg_instance.ltlimgmc_instance0._alpha = 0;
litlimg_instance.ltlimgmc_instance0.holder.loadMovie(image[p], 1);

var maxWidth = 250;
var maxHeight = 200;

var myWidth = litlimg_instance.ltlimgmc_instance0._width;
var myHeight = litlimg_instance.ltlimgmc_instance0._height;
// Calculate percentage by which image will need to change to fit
if (myWidth > maxWidth){
var xscalePercent = (myWidth*100)/maxWidth;
}
if (myHeight > maxHeight){
var yscalePercent = (myHeight*100)/maxHeight;
}
// Multiply both height and width by the bigger percentage
if (xscalePercent>yscalePercent) {
litlimg_instance.ltlimgmc_instance0._width /= (xscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (xscalePercent/100);
} else {
litlimg_instance.ltlimgmc_instance0._width /= (yscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (yscalePercent/100);
}
var test=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
trace("width img:"+litlimg_instance.ltlimgmc_instance0._width);
trace("width:2 :"+litlimg_instance.ltlimgmc_instance0._width/2);
trace("x position must be:"+test);
trace("x position is:"+litlimg_instance.ltlimgmc_instance0._x);
trace("----------------------------------------------------");

litlimg_instance.ltlimgmc_instance0._x=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
litlimg_instance.ltlimgmc_instance0._y=litlimg_instance._y-(litlimg_instance.ltlimgmc_instance0._height/2);
slideshow();
} // end if
} // end if
} // End of the function


function slideshow()
{
function pause_slideshow()
{
clearInterval(myInterval);
if (p == total - 1)
{
p = 0;
firstImage1();
}
else
{
nextImage1();
} // end else if
} // End of the function
myInterval = setInterval(pause_slideshow, 4000);
} // End of the function

p = 0;
--------------------------------------------------------------------------------------------------------------------

what i do is i have an array with the image links.
on a interval i load an image. and if p has reached the number of loaded images i start over again.

i traced the following while testing a bunch of images:
-------

1
x van inst0-125
y van inst0-93.55
width img:250
width:2 :125
x position must be:-125
x position is:-125
----------------------------------------------------
2
x van inst0-125
y van inst0-93.55
width img:258.05
width :2 :129.025
x position must be:-129.025
x position is:-125
----------------------------------------------------
3
x van inst0-129
y van inst0-93.55
width img:140.3
width :2 :70.15
x position must be:-70.15
x position is:-129
----------------------------------------------------
4
x van inst0-70.15
y van inst0-93.55
width img:243.2
width :2 :121.6
x position must be:-121.6
x position is:-70.15
----------------------------------------------------
1
x van inst0-125
y van inst0-93.55
width img:250
width :2 :125
x position must be:-125
x position is:-125
----------------------------------------------------

It looks like he takes the position of the prev image or something like that.

Please some help here.

Greetz. Jacob

Ps: this was some code i posted.. i would like to know how you put it into such a nice code block on the forum so it becomes more readable.

Set LoadMovie Time, UnloadMovie, LoadMovie
in that order-

Put simply-
can anyone guide me to any resources that would explain how to do this?

1. Load 2 swf's into empty mc's (this part is already done)
2. Have those 2 swf's be on the stage for 3 seconds.
3. Unload those 2 swf's.
4. Then load a completely new swf once those have been unloaded.

Stopping ONE Sound
I originally set up my music to "stream" so that when the next sound started streaming it would obviously stop the first one. However, I hate streaming music because of the choppiness. If I therefore want to run the music on "event" or "start," is there a script to tell a _specific_ sound to stop playing at a particular keyframe? Do I nest it in a movie clip and then control the sound by pointing to the instance of the movie clip? Or is there an easier way? And what is the script?

Thanks so much for your help!
-Dave

Stopping The Motion
I'm sorry if this sounds dumb. Ok I have a movie clip, and the instance name is "ball". Now in frame one of the movie clip there is an image of a round circle. And I want this circle to move from left to right so I put in the action script:

_root.ball._x += 10;

and in frame two of the movieclip I put in:

goto and play frame 1:

so that the stage will update the position. Now what I want to know is how do I stop my movie clip image in a certain area of the stage?

Thanks

From Playing And Stopping...
I hope someone of you can me tell something.

I stopped a movie called Movie1 in this case. Now I want to play again the Movie1...

here is the little script:

number = 1

// 'number' is dynamic (and has to be dynamic !)

eval("Movie" + number + ".GotoAndPlay(1)")

...any suggestions what I am doing wrong ? There is no error in Flash when I play it...

Please, My Work Is Stopping. HElp ME.
I created a door animation opening and closing while navigation between the pages.
but when I navigate from a page to another, the door closes then the browser pops up to load the opening door. ( I hate this pop up. ) are there any ideas to avoid this pop up between pages? this pop up because it loads another html page.


Please HELp mE.

the link is:
http://www.steelnetwork.com/trial/flash/software.html

Stopping A Counter
Hi,

I'm trying to rework some code I got from someone. It makes a movieclip scroll continuously through actionscript. Here's the code:
...................
onClipEvent (load) {
// set vars
old_x = this._x;
trace("old_x = "+ old_x);
speed = 4;
counter = 0;
// how often can i move the MC ?
max_counter = (this._width/speed)/2;
trace ("max_counter " + max_counter);
}
onClipEvent (enterFrame) {
// move the MC
this._x -= speed;
// counting the "times moved"
counter++;
// is the whole MC was moved begin from the start
if (counter>=max_counter) {
this._x = old_x;
counter = 0;
}
}
.......................

Now I want to add a stop function to the scrolling.
So on the stopbutton I placed the following code:

...................
on (release) {
_root.webskills.text.speed=0;
// where are we when we stop the movie?
stop_at = _root.webskills.text.counter;
gotoAndStop(2);
}
..................

To start playing again I use the this code on the play button in frame 2:
.................
on (release) {
_root.webskills.text.speed=4;
// where are we when we restart the movie, substract stop_at from this
// number
_root.webskills.text.counter = _root.webskills.text.counter - stop_at;
gotoAndStop (1);
}
................

I thought I could use the counter variable but I can't figure out how. The problem is that the counter keeps adding because it's in an onClipEvent (enterFrame) function. Thus making the movie jump to the beginning when the original counter is bigger than max_counter. The example is here: http://home.wanadoo.nl/d.roberts/stuff/webdesign.html
Press the first stop button (next to web vaardigheden) to see the effect.

Is there a way to tune this or am I looking in the wrong direction entirely?
Thanks very much for any help.


Kind regards,

Danielle Roberts.

Stopping A Scroller
I've been working on stopping a scroller. I downloaded a simple photo scroller from Flash Kit: Photoscr-Barry_Dr-6066
It is they type that scrolls opposite the direction of the mouse (move mouse left, scroller scrolls right).

I've been trying to program it so I can click on a picture and it will stop the scroller from scrolling.

As I get more advanced with it I want the photo I click on the ease to the center on mouse release. Then it will launch a movie, a larger version of the photo, zooming to full size. Then I'll click and button that will send it back to the center and then the scroller begins scrolling again.

Any ideas? Any help will be appreciated.

Thanks.

Stopping The Scene When....
...I do a hitTest. I cant figure out how to stop the scene that i am on when i do a hitTest on an object..


Code:
onClipEvent (enterFrame) {
if (_root.guy.hitTest(_root.object)) {
tellTarget ("/guy") {
gotoAndStop (10);
}
}
}

This is the code i have now. and once i can stop the scene, i would like to stop the scene about 5 frames after the object hits it by using "_currentframe + 5" how can i do this?????

Stopping Sounds
I have a number of sections in my movie, each with sounds attached. I want the viewer to be able to skip ahead to different sections without the sound from the previous section continuing over the new section's sound.

Right now, I have this on the first keyframe of each section:

mySound.stop();

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