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




Restarting Sound



Does anyone know how to re-start a background loop automatically after someone comes back from a pop-up window? I would think it has something to do with some of the Sound object properties (eg Sound.start, Sound.stop) but I can't get them to work.



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-02-2001, 07:26 PM


View Complete Forum Thread with Replies

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

Restarting Sound
After a sound is paused, is there any way to restart a sound where it was paused?
the sound (narration) is on the timeline by:

pageSound = new Sound();
pageSound.attachSound("name");
pageSound.start();

When the user pauses the timeline by pressing the button to stop all sounds and stopthe timeline - that works fine, Restarting the timeline and playing sounds works - but it only picks up and plays the next attached sound as it travels down the timeline, it does not finish playing the sound that was paused.

Any Ideas?

How Do I Stop Sound From Restarting?
I placed my sound movie with on & off buttons in a layer covering all of my website's frames. When I play the movie, the sound loop plays alright and my equalizer animation appears. When I rollover on the "off" button. It stops, but after some time the sound starts playing again! what am I doing wrong? I placed a
stop ();
in the first frame of my mp3 loop layer inside the sound movie, and have used the following on the "off" button:
on (press) {
stopAllSounds ();
this.mcecualizador.gotoAndStop ("fin");
}

Problem With Looping Sound Not Restarting.
Hey Everybody,

I've got a looping piece of music in a fairly long product demo/sales piece. I've included a movie pause button and a sound on/off button.

The problem is when the movie pause button is pressed, everything pauses as it should, but when you press it again to resume everything, the looping sound doesn't resume where it left off. In fact, the looping sound doesn't come back on only the voice over comes back on.

Does anyone know what's wrong with my code or what I can do differently to fix this?

You can view the flash movie at:
http://www.twisttop.com/citrix/citrix_final_v2.html

If you would like to look at the source files they're here (Warning: They're a little big in file size...the demo is heavy on screenshots and voice over):

(This is the main Flash file)
http://www.twisttop.com/citrix/citrix_final_v2.fla

(These are the externally loaded support files)
http://www.twisttop.com/citrix/ScrnShot_Access.fla
http://www.twisttop.com/citrix/ScrnShot_Secure.fla
http://www.twisttop.com/citrix/ScrnShot_Personalize.fla
http://www.twisttop.com/citrix/ScrnShot_Virtualize.fla

Any and all help would be super-appreciated.

Thanks,
Joe

Restarting A Sound By Click Of A Button
Hi,
I have my sound file in my library. and i have placed it in one layer. Now i have two buttons to stop and start a movie. When i click the stop button my movie and sound both stops. I use the followng code
on (release) {
tellTarget ("bq") { //bq is the movie clip
stop();
stopAllSounds();
}
stop();
}

on (release) {
tellTarget ("bq") {
play();
}
tellTarget ("music") { //I dont know how to specify the
//target for the music file.this gives
//error.I even gave it a linkage in the lib
//but that also did not worked
play();
}
play();
}

can anybody plaese help. I jsut want to know how to restart the sound.

using flashMX

[MX] Restarting A Movie/sound After Stopping It...
Heya all, thanks in advance for the help.

This seems like it would be an obvious answer, but I must be missing something. Anyway, here we go.

I have a frame in my movie that plays a mp3 file when the frame is played. I dropped the sound file right onto the frame.

What I want to be able to do is stop playing the sound on the frame with a button (I can do that now, just made a button with "stop all sounds").

Then at some point after I stop the sound, restart the sound file on that same frame.

For some additional background info - essentially what I created was a flash power point presentation. Each frame has a diffirent slide, and an mp3 voice over that goes along with each slide/frame. I added some forward/back buttons (to move through the presentation), a mute button, and now want a "stop slide" and "restart slide" button. Since there is no animation, the only thing that will change is the sound stopping and restarting.

Nothing I do can get that sound file to start playing again.

If anyone could help me out I'd GREATLY appreciate it.

Thanks again!

How To: Stop Sound And Restarting After Pressing Button...
hi, i need help on this:

I have a template whith a bunch of buttons, on this template i want a song to be playing, but i don't want it to play when i press certain buttons with songs themselves....what can I do to make this possible...

what code do I use, and where?


thanks!

mannie

Restarting
i have created an online tutorial for a software package. i have broken the HUGE file into 5 or 6 separate movie files. a menu allows the user to choose which section they wish to view - in addition, the tutorial can also run straight thru as a complete movie.

HOWEVER, once i get to the 5th section (not exactly at the same point every time) it cuts out and restarts the entire tutorial at the beginning. if i let it run thru again it doesnt happen. is it a download issue?

1) ive tried breaking the movies down so no movie is over 1.6MB.
2)i tried converting all movies to flash 5.
3) i tried unloading the previous movies.

help!

thank you.

Help With RESTARTING In Some Way
Basicly i've posted a question earlier and it seems that my problem is a big one and i would like to go back a stage and unmake all my symbols. Is there a way to do this?

To convert a symbol back into a simple graphic?

Restarting A Swf
Is there someway to restart the swf? So for example, after 20 loops of the swf, the code will call a restart function so that the swf starts from anew. I am asking about this because the system memory of mine keeps building up, (slowly now since ive optimized it) but after the 20th loop its start lagging, so this restart which would completely start with new system memory would fix my problem. any thoughts? thanks

soup

Restarting A Movie
I have a movie that loads a variable from a file. the variable is just a special string containing properties for a textField. I have read and parsed the variable, and created my text fields and many other objects dynamically. It all works fine.

My problem is this:

I want to load a new file and make all new objects, totally getting rid of the ones I made. It would be a huge hassle to loop thru all the objects of various types, using .removeMovieClip or whatever. Is there a way to just restart the movie but still remember just 1 variable? (the variable for which file to load on restart)

thanks in advance.

Pausing/restarting
This question has been asked a million times, but I still can't get this to work.... please help!!! I have a movie clip that I want to pause if you click on it once and resume playing (or perhaps to another clip) if you click on it again. Is there a way to do this?
Thanks in advance

Prevent Mc From Restarting - I'm Not Sure How...
I'm not sure how I would go about doing this...

I have an mc with 10 frames. I have buttons to switch between frames. Each frame has an mc with 10 frames, and buttons to switch between frames. (So I have 110 frames total, 10 parent frames and 100 subframes.)

If I switch frames in one of the sub-mcs, then switch frames in the parent mc and go back again, the sub-mc starts over again at frame 1. How do I get them not to start over?

Restarting Presentation?
Hello everyone,

Im in the process of making a kiosk that will be displayed to where the public came come up and click through the presentation. What I want is that if someone starts clicking through pages and leaves and the kiosk is stagnet for an amount of time the whole flash presentation goes back to the opening page, that way if someone new comes up there not starting from within like the middle of the project and at the begining. Is there a way to do this?

thanks in advance

bass vivi

[F8] Restarting A SetInterval
How do you re-start a setInterval?

I've made a countdown script that uses setInterval. I've got a clear button that stops the clip, and I used clearInterval to do that. I need to know what script will allow me to re-start the countdown.

countdown code

Quote:




function countDown () {
seconds --;
secondsText_txt.text = seconds;
minutesText_txt.text = minutes;
if (seconds <= 9) {
secondsText_txt.text = "0" + seconds;
}
if (minutes <= 9) {
minutesText_txt.text = "0" + minutes;
}
if (seconds <= 0) {
minutes --;
seconds = 59;
}
if (seconds == 0 && minutes == 0) {
secondsText_txt._visible = false;
minutesText_txt._visible = false;
allClipsHidden ();
countFinished_mc._visible = true;
}
if (minutes == 19 || minutes == 14 || minutes == 9 || minutes == 4) {
allClipsHidden ();
participants_mc._visible = true;
} else if (minutes == 18 || minutes == 13|| minutes == 8||minutes == 3) {
allClipsHidden ();
chat_mc._visible = true;
} else if (minutes == 17|| minutes == 12|| minutes == 7|| minutes == 2) {
allClipsHidden ();
whiteboard_mc._visible = true;
} else if (minutes == 16 || minutes == 11|| minutes == 6|| minutes == 1) {
allClipsHidden ();
polling_mc._visible = true;
}else if (minutes == 15) {
allClipsHidden ();
game1_mc._visible = true;
} else if (minutes == 10) {
allClipsHidden ();
game2_mc._visible = true;
} else if (minutes == 5) {
allClipsHidden ();
game3_mc._visible = true;
} else if (minutes == 0) {
game4_mc._visible = true;
} else {
allClipsHidden ();
}
}

countInterval = setInterval (countDown, 1000);




reset Script

Quote:




resetButton_btn.onRelease = function () {
this.enabled = false;
clearInterval (countInterval);
timeColon_mc._visible = false;
secondsText_txt._visible = false;
minutesText_txt._visible = false;
presentationStartText_mc._visible = false;
manorCareLogo_mc._visible = false;
peoplePictures_mc.gotoAndStop ("blank");
labelText_mc._visible = true;
allClipsHidden ();
allPeopleHidden ();
allBTSLogosHidden ();
logoButtonsActive ();
skinColorButtonsActive ();
skinButtonsActive ();
peopleButtonsActive ();
minuteButtonsOn ();
}




button to restart script

Quote:




minute01_btn.onRelease = function () {
minutesText_txt._visible = true;
secondsText_txt._visible = true;
timeColon_mc._visible = true;
minutes = 0;
seconds = 59;
presentationStartText_mc._visible = true;
manorCareLogo_mc._visible = true;
logoButtonsHidden ();
minuteButtonsOff ();
peopleButtonsHidden ();
skinButtonsHidden ();
skinColorButtonsHidden ();
labelText_mc._visible = false;
resetButton_btn.enabled = true;
}

Restarting Movie
Is it possible to restart the WHOLE movie using actions script?

Like:

Code:
_root.*restart*
Where the *restart* would be the code

Restarting My OnEnterFrame
Does anyone have ideas on how to get my mc to follow my mouse after my if conditions are made true?


PHP Code:




_global.followMouse = function (target_mc,mouseSpeed){
    
    
    eval(target_mc).onEnterFrame = function() {
        
        var containerBounds:Object = container_mc.getBounds(_root);
        
        var mspeed = mouseSpeed;
        var xMouse = _root._xmouse;
        var yMouse = _root._ymouse;
        
            
        var differenceX = (target_mc._width)/2;
        var differenceY = (target_mc._height - container_mc._height)/2;
            
        var left = containerBounds.xMin + differenceX;
        var top = containerBounds.yMin + differenceY;
        var right = containerBounds.xMax - differenceX;
        var bottom = containerBounds.yMax - differenceY;
    
        
        if (container_mc.hitTest(_xmouse, _ymouse, true)) {
            
            if (left <= eval(target_mc)._x && eval(target_mc)._x <= right && eval(target_mc)._y >= top && eval(target_mc)._y <= bottom){
                trace("run");
                target_mc._y -= (target_mc._y-yMouse) / mspeed;
            } else {
                trace("out of bounds");
                _root.onMouseMove = function(){
                    eval(target_mc)._x == left){
                        target_mc._x++;
                    } else if (eval(target_mc)._x == right){
                        target_mc._x--;
                    } else if (eval(target_mc)._y == top){
                        target_mc._x++;
                    } else if (eval(target_mc)._y == bottom){
                        target_mc._x--;
                    }
                    
                    // do I need to delete the ON ENTER FRAME????
                    // HOW DO I GET THIS TO START MOVING AGAIN?
                    
                    delete this.onEnterFrame();
                }
            }
        
        
        }  else if (!container_mc.hitTest(_xmouse, _ymouse, true)) {
            
            trace("off container");
        }
    
    }
}


_global.followMouse(ball_mc,15);


stop(); 




Please Help Me... going insane and this project is past due

Keeps Restarting -- Tween That Is..
function multiFade(obj1, obj2, delay){
obj1._alpha = 0;
obj2._alpha = 0;

function runSecondTween(){
var alpha_2:Tween = new Tween(obj2, "_alpha", type.easeOut, 0, 100, 1, true);
}

//fade in first obj
var alpha_:Tween = new Tween(obj1, "_alpha", type.easeOut, 0, 100, 1, true);

//fade in second obj
alpha_.onMotionFinished = function(){
var intrvl:Number = setInterval(runSecondTween, delay*1000);
}
}

Restarting Loaded SWF
I load an external SWF which has 1 frame with code that plays an animation.
Once I load it the animation runs fine, but at a certain point I want the animation to be initiated again, preferably reset the SWF and replay it.

What I did was to remove the loader MC which loads the SWF, setting it to null and reloading the same SWF; didn't work. The SWF appeared, but the animation did not play again. It was as though I just hidden the SWF and showed it.


ActionScript Code:
removeChild(loaderClip);
            loaderClip = null;
            loaderClip = new Loader();
            var context:LoaderContext = new LoaderContext();
            context.applicationDomain = new ApplicationDomain();
            loaderClip.load(new URLRequest(globalPath), context);
            addChild(loaderClip);
Is there a way to reset loaded SWF to run code again?

Restarting A Movie With AS3
In Flash 8 and earlier, I could restart a movie from the beginning with loadMovieNum(_url, 0);

This isn't supported in CS3/AS3. Is there another way to set a movie back to its original state without having to manually reset all the variables and objects?

Mp3 Restarting After A Few Seconds
I have a site with a LOT of short mp3 music clips to play.
Currently what I built is working perfectly on my desktop,
but when I play it online, it glitches.
I assume there is a problem with the streaming somehow,
but I don't know where to start to fix it.

The glitches are:
(1) a song starts to play, then a couple seconds in, it skips and starts over then plays all the way through.
(2) sometimes if you click on a second song, when the second song skips (see glitch #1), the first song starts playing too so then they're both playing at the same time.

It's in AS2, btw.
The way it's currently built is I create a sound object
and use loadSound to load each external mp3 into that object.

There is a button for every song with a toggle switch inside the button.
The script to play the song is on every button.

(3) I do create the same sound object ("music") on every button.
Would it be better to create the sound object once on frame1 of the whole site
and have every song that loads from external .swfs reference that existing sound object?
Does it matter?

I am quite prepared to completely rebuild it if anyone has a better structure for how to do this.

You also may notice:
(4) I also have a problem with the toggle button (glitchy, but fixing the music is more important).
When you click on the second song, I can't figure out how to get the toggle on the first song
to revert to it's usual "play" state.

Thank you.









Attach Code

toggle_mc.stop();

var music:Sound = new Sound();
music.onLoad = function() {
music.start();
};

//-----------


toggle_mc.onRollOver = function(){
var my_color:Color = new Color(toggle_mc);
my_color.setRGB(0xCF0000); // toggle_mc turns red
}

toggle_mc.onRollOut = function(){
var my_color:Color = new Color(toggle_mc);
my_color.setRGB(0x9A9997); // toggle_mc turns back to grey
}

toggle_mc.onRelease = function(){
if (this._currentframe == 1) {
this.gotoAndStop(2);
stopAllSounds();
music.loadSound("http://www.girlcharlie.com/test/music/ind/pianoLessons/jazzPianoLessons/09 Just One More Mile-DUPL_01 1.mp3", true);

} else {
this.gotoAndStop(1);
stopAllSounds();
}
}

Core Keeps Restarting
Once or twice a day my FMS Core with it's application restarts. As far as I see it happens when FMS runs on certain part of server side code that sets properties in shared object very fast (in for loop), for instance:

for (k = 0; k < sharedObjectNamesArray.length; k++)
{
application[sharedObjectNamesArray[k]].setProperty(propName, propValue);
}

Log in my Core is:

#Fields: datetimex-pidx-statusx-ctxx-comment
2009-01-2601:19:5831823(i)2581247Core (31823) disconnected from edge.-
2009-01-2601:19:5831823(i)2581233Core (31823) disconnecting from admin.-
#Date: 2009-01-26
#Fields: datetimex-pidx-statusx-ctxx-comment
2009-01-2601:19:5929582(i)2581237Starting admin app on core (29582).-
2009-01-2601:19:5929582(i)2581238Core (29582) connecting to admin.-
2009-01-2601:19:5929582(i)2581231Core (29582) connected to admin.-
2009-01-2601:19:5929582(i)2581234Core (29582) connection to admin accepted.-
2009-01-2601:19:5929582(i)2581246Core (29582) sending register cmd to edge.-

Restarting After A Few Seconds
Can someone please give me some code I can add after at stop(); function to restart the movie (or play from frame1 on scene1) after 3 seconds? Thank you.

Restarting Movie
How could I have a movie restart itself totally?
Like every variable declared, every MC that changed, every thing that the user did, goes back to what it was when it started. In other words, it would be like the movie hitting your browser's refresh button for you.
And could you do the same with only the current scene?
thanks,
Buya7

Tween Keeps Restarting?
function multiFade(obj1, obj2, delay){
obj1._alpha = 0;
obj2._alpha = 0;

function runSecondTween(){
var alpha_2:Tween = new Tween(obj2, "_alpha", type.easeOut, 0, 100, 1, true);
}

//fade in first obj
var alpha_:Tween = new Tween(obj1, "_alpha", type.easeOut, 0, 100, 1, true);

//fade in second obj
alpha_.onMotionFinished = function(){
var intrvl:Number = setInterval(runSecondTween, delay*1000);
}
}

Restarting Interval
hi everyone,

got a bit of a question with setInterval();

My Interval is working. But I have a button so that when you click it, it clearIntervals(); etc. But when you click it again, I need it to restart the interval. Which is not happening..

here is my as:


ActionScript Code:
btn.onRelease = function() {    if (pressed == 0) {        menu.signBtn._visible = true;        fader(menu,100);        pressed = 1;        clearInterval(iid);        trace("cleared: "+iid);    } else if (pressed == 1) {        fader(menu,0);        menu.signBtn._visible = false;        pressed = 0;        var iid = setInterval(this, "image", duration);        trace("new: "+iid);    }};menu.signBtn.onRelease = function() {    getURL("../signUp.html", "_blank");};var iid = setInterval(this, "image", duration);


Now, to me it looks fine, but it won't re-initiate the setInterval..I'm just not quite sure what to do at the moment...

Any tips and advice would be much appreciated.

Cheers,

Restarting After A Few Seconds
Can someone please give me some code I can add after at stop(); function to restart the movie (or play from frame1 on scene1) after 3 seconds? Thank you.

Restarting A Movie
Hi all,

I must being doing something wrong here, but I just can't get it to work (and as always time is running out) so here goes....

In frame 1 of the main movie I've got a stop; and a large movie clip (an imported swf file)

What I want to do is when imported movie clip ends to restart the main movie again from frame 2

All it seems to do is run the imported movie then stop

Any help please!!!

LeBodge.

Flv's Restarting Before The End Of The Video
Hi there i am fairly new at this but here is my problem,

I used the Video tutorials to create a custom media player in my website to play Flv's, Everything seems to be working fine, however on some of my longer Flv's (1min+) they keep restarting about a third of the way into the file and won't play all the way through?

Any ideas?

GetURL Is Restarting My Movie... Help
when someone views my movie in flash4 it willget to the end where there are 2 buttone proceed to site, and play again...

now the proceed to site button has...
on (release) {
getURL ("frameset.html", _top);
}
but when they (flash4) click on it... it just restarts the movie?

anyone know how i can fix this?

GetURL Is Just Restarting The Movie? Help Please
i have a getURL at the end of my movie...

however on some browsers... (that have only flash 4)
it just restarts the movie.

i have put it in a frame
i have put it on a button.. whenever the getURL is called the movie jsut starts over...

anyone know how to work around this?

Non-profit Site Keeps Restarting
Help!!!!!!!!!!!

This site was due to be completed about three days ago. I've spent hours looking at it and can't work-out what's wrong. The worst thing is its a really simple site!

Here's a link:

http://www.dur.ac.uk/society.theatre

Any help would be much appreciated.

Thanks,

NS

Restarting The Flash 5 Experience
Hey,

I took a break from FLASH 5, but now i wanna start it up again. But this time i'm gonna start to use ACTIONSCRIPT when doing almost everything. I used to tween using the motion tween option etc...but now i will try to use actionscript to move things around and enlarge etc...

Is this a good idea or not?...Is it best to use actionscript to do things like tween and enlarge or what?

Neway, my main question is 'Where can i find a maual of some sort to help me learn ACTIONSCRIPT?

Possibly dowmnloadable?

The tutorials here are good, but i wanted a whole wad to enable me to learn the things i want easily...

Thanks in advance...

Mike :|

If only...

Restarting Slide Presentation
Hi
I'm having trouble restarting a slide presentation loaded into an mc created at runtime. Here's how I create/load ....
code:
_parent.content_mc.createEmptyMovieClip("slideshow ", 10);
_parent.content_mc.slideshow.loadMovie("swf/slideshow.swf");

.... and here's how I unload ....
code:
_parent.content_mc.slideshow.unloadMovie("slidesho w.swf");
removeMovieClip(_parent.content_mc.slideshow);

But from the second time I load it, the load works but the slide presentation seems stuck on the first frame. Am I making a mistake somewhere?

thanks
mark
MXPro2004

Problem With Restarting LoadSound
I had been using regular Mx up until about 3 months ago when I needed mx 2004 for a project, and I had created many audio sections(in regular mx) using the same code.

_root.my_sound = new Sound;
_root.my_sound.loadSound(xb, true);
_root.my_sound.onSoundComplete =_root.replay

This all works fine I have the variables defined throughout the site then on the pause button I have

on (press) {
_root.myMusicPosition=_root.my_sound.position/1000;
_root.my_sound.stop();
}

and on the Play button to start from the paused position

on (press) {
_root.my_sound.start(_root.myMusicPosition,0);
}

Now this code worked when I had it in regular mx but since moving it over to mx 2004 it doesnt in flash player 6- I think that when it was moved over I didnt change the setting so it would have been set to 7 but I have changed it since then to be set to 6 with as1 - it still doesnt work in flash player 6 but it does work in player. The site I am designing this for would like it to work in flash player 6 - any ideas what I can do to fix this?

Thanks
Randy

Restarting From Exit Point
Hello to you all.
I have a slight problem. I have a clip that contains, amongst other things, an exit button.
When clicked a 'Do you want to exit?' prompt is displayed containing Yes and No buttons.
At this point the clip needs to pause.
If the user clicks the No button I want to continue to play the clip from the frame on wich the Exit button was pressed.

I'm ok with what to do if the Yes button is selected.

Any suggestions please?

Thanks in advance,

Jase

Stopping And Restarting HitTest
I am trying to create a drop down menu that has buttons that fade in on rollover.

I had the drop down part down, but the buttons within the drop down menu movie would not respond to the rollOver action. I was told by someone on the board that the buttons would not work because I had two rollovers in one place, and they suggested I use hitTest to run one of the rollovers.

So, I am now using hitTest to control the opening of the menu, and rollover to control the buttons inside. The problem at first with the Hit Test was that when I told the hit test to play the movie timeline, it just kept on playing, and would not stop at the stop frame actions. That was because the hitTest was still running, and telling the timeline to play. So the next suggestion was to stop the hitTest after it opened the menu, but this is making it so that the menu will not close when I move the mouse off of the menu area.

Here is the code that was suggested to start and stop the hitTest:

onClipEvent (load)
{
this.ready = true;
}


onClipEvent (enterFrame)
{
if (this.hitTest(_root._xmouse, _root._ymouse, false)){
this.over = true;
}else{
this.over = false;
}

if (this.over && this.ready){
openmoive();
this.ready = false;
if (!this.over && !this.ready){
closeMenu();
this.ready = true;
}
}
}

I have also attached the fla.

Feel free to manipulate the fla and test it out.

Thanks for your help!

Jason

[F8] My Flash Page Keeps Restarting
http://www.abccreativegroup.com/optimized/main.html

This is a link to a site I am working on...

I thought everything was working fine, but in some browsers, the .swf keeps looping! I dont' know how to stop the .swf from restarting all the time. I'm a little new to flash, and I've gotten help from lots of book and websites.

I have a main flash file, and for every link that is pressed, there is a new .swf that loads into a blank movie clip.

Please help me if you can!

Here is my script for the last keyframe in the main file:


b1_btn.onRelease = function() {
if (_root.section != "ourbeers.swf") {
_root.section = "ourbeers.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};



b2_btn.onRelease = function() {
if (_root.section != "ourco.swf") {
_root.section = "ourco.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};

stop();

b3_btn.onRelease = function() {
if (_root.section != "ourevents.swf") {
_root.section = "ourevents.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};



b4_btn.onRelease = function() {
if (_root.section != "ourpromos.swf") {
_root.section = "ourpromos.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};



b5_btn.onRelease = function() {
if (_root.section != "history.swf") {
_root.section = "history.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("history.swf")
;
}
stop();};



b6_btn.onRelease = function() {
if (_root.section != "yourstories.swf") {
_root.section = "yourstories.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}

stop();};


b7_btn.onRelease = function() {
if (_root.section != "otherhome.swf") {
_root.section = "otherhome.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}

stop();};



beerbtn_btn.onRelease = function() {
if (_root.section != "ourbeers.swf") {
_root.section = "ourbeers.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};




invextras1_btn.onRelease = function() {
if (_root.section != "ourrestaurants.swf") {
_root.section = "ourrestaurants.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};

stop();


invextras2_btn.onRelease = function() {
if (_root.section != "yourstories.swf") {
_root.section = "yourstories.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};




invextras3_btn.onRelease = function() {
if (_root.section != "ourpromos.swf") {
_root.section = "ourpromos.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};




invextras4_btn.onRelease = function() {
if (_root.section != "brewcrew.swf") {
_root.section = "brewcrew.swf";
_root.transition.gotoAndPlay("closing")
_root.beerhome_mc._visible=false
_root.coaches_mc._visible=false
_root.photoContest_mc._visible=false
_root.winaweekend_mc._visible=false
_root.joinbrew_mc._visible=false
_root.regularpaper_mc.loadMovie("papernormtwo.swf" )
;
}
stop();};

gotoAndStop(83);

Restarting Movie In Powerpoint
I have a powerpoint pres. with a swf on one of the slides. Everything works fine but if i need to stop the slideshow and restart the animation doesnt work; it only works the first time the slideshow is played. So then I have to exit and reopen the ppt presentation to replay the show with animation. Is there a way to make the animations play once a certain slide is started? Thanks!

[CS3] Looping Or Restarting Actionscripted SWF
I have created a banner for a client which blurs images and slides them into postion and focusses again. There is also a small text slider 'copyMC'. It all works exactly as I would wish it to. The client has asked if it could loop/restart after 20 seconds. I thought this would be simple but I am stumped. I am an occassional Flash builder so my knowledge is limited.

If anyone could tell me how I could restart and where in the code i should put the commands I would be grateful.

Code:



#

#include "mc_tween2.as"

var m3timerStatus=0;
var m3Status=m3timerStatus;

//individual Line Intro Functions with timings//
line1=function(){
this.copyMC.passionSlide.xSlideTo(17,.5,"easeOutBo unce",1,(m3Status++),.3,.3);
}
line2=function(){
this.copyMC.knowledgeSlide.xSlideTo(17,.5,"easeOut Bounce",6,(m3Status++),.3,.3);
}
line3=function(){
this.copyMC.precisionSlide.xSlideTo(17,.5,"easeOut Bounce",11,(m3Status++),.3,.3);
}
line4=function(){
this.copyMC.tccSlide.xSlideTo(17,.5,"easeOutBounce ",16,(m3Status++),.3,.3);
}
returner=function(){
this.copyMC.passionSlide.xSlideTo(-300,.5,"easeOutBounce",0);
this.copyMC.knowledgeSlide.xSlideTo(-300,.5,"easeOutBounce",0);
this.copyMC.precisionSlide.xSlideTo(-300,.5,"easeOutBounce",0);
this.copyMC.tccSlide.xSlideTo(-300,.5,"easeOutBounce",0);
this.gotoAndPlay(1);//this is too simplistic. I need to know how to restart/loop the SWF!
}

//End of Line Functions//

rollit=function(){
//blur schedule//
this.carousel.xBlurTo(100,3,0,"linear",0,line1());
this.carousel.xBlurTo(0,3,1,"linear",0);
this.carousel.xBlurTo(100,3,1,"linear",4,line2());
this.carousel.xBlurTo(0,3,1,"linear",5);
this.carousel.xBlurTo(100,3,1,"linear",9,line3());
this.carousel.xBlurTo(0,3,1,"linear",10);
this.carousel.xBlurTo(100,3,1,"linear",14,line4()) ;
this.carousel.xBlurTo(0,3,1,"linear",15);
//slide schedule//
this.carousel.xSlideTo(0,0,"easeOutQuad",0);
this.carousel.xSlideTo(-800,.5,"easeOutQuad",5,undefined,.3,.3);
this.carousel.xSlideTo(800,.5,"easeOutQuad",10,und efined,.3,.3);
this.carousel.xSlideTo(0,.5,"easeOutQuad",15,undef ined,.3,.3);
//restart//
this.carousel.xBlurTo(100,3,.5,"linear",20);
}
rollit();
#

Function Jumping/restarting
okay I have a function that positions a MC then makes it move a bit. Anyway here's the function and the call:

Code:
function endMask(mcName, xloc, yloc, w, h, mcRate, mcxStop) {
mcName._x = xloc;
mcName._y = yloc;
mcName._width = w;
mcName._height = h;
mcName.onEnterFrame = function() {
trace("still running endMask: " + mcName);
if(mcName._width > 1) {
mcName._width -= mcRate;
trace(mcName + " width: " + mcName._width);
mcName._x += mcRate;
trace(mcName + " x: " + mcName._x);
}
if (mcName._x > mcxStop) {
mcName._x = -1000; //Move clip off the canvas
delete this.onEnterFrame;
trace("end killed for: " + mcName);
}
}
}
endMask(mask10_mc, 34, 200, 200, 440, 40, 300);
the problem I have is that it seems to be jumping/restarting for some reason I don't understand.
here are the results of the traces:

Quote:




_level0.mask10_mc width: 159.55
_level0.mask10_mc x: 74

_level0.mask10_mc width: 119.45
_level0.mask10_mc x: 114

_level0.mask10_mc width: 159.55
_level0.mask10_mc x: 74

_level0.mask10_mc width: 119.45
_level0.mask10_mc x: 114

_level0.mask10_mc width: 79.4
_level0.mask10_mc x: 154

_level0.mask10_mc width: 39.35
_level0.mask10_mc x: 194

_level0.mask10_mc width: 39.35
_level0.mask10_mc x: 234

_level0.mask10_mc width: 39.35
_level0.mask10_mc x: 274

_level0.mask10_mc width: 39.35
_level0.mask10_mc x: 314

end killed for: _level0.mask10_mc




You can see at the top where I have bolded it that it starts to work and then jumps backwards and starts again.

I'm also confused why it thinks 200 - 40 = 159.55? but that doesn't really stop my function from working so i don't care that much.

I really want to know why it's jumping at the start. If anyone has any ideas please let me know.

I'm not calling this function for this MC anywhere else. I am calling the function for a different MC; both of them are jumping like this and commenting one out doesn't affect the behavior of the other.

Restarting A Basic Game
I have a basic hang man style game which records the name of the player and keeps a running score of wins and losses, but I want to implement a 'restart' which takes the back to the point where a player can enter their name (to start a 'New Game')

Im completly confused on how to do this as simply closing the game by various menthods doesnt erase the information.

Can anyone help?

Trouble Restarting Game...
Okay, I feel almost dumb just coming here for this problem, but I can't for the life of me figure out where I went wrong. All I'm trying to do is tell my game to go back to frame 1 through a button. It's the simplest code out there doing gotoAndStop, but something appears to be interfering. It will go to the first frame, but than just skips right back to the last one...there is a stop(); on each of the 3 frames and on the first one you have to click a button to get to the 2nd. So I'm totally confused. The entire game works from the start, to the middle, to the end...just not to restart it.

I've attached all the files if anyone wants to take a quick look.

Thanks.

Movie Restarting For No Reason
Hey everyone

I've made a flash thing which is meant to act like a text based RPG, and it was working fine (relatively :P). On frame 1 there's a preloader which is just an arrow moving across the screen. Frame 2 has nothing on the stage, and has about 600 lines of actionscript starting with a stop() command. For some reason after i added some more code, it would start restarting itself for no readily apparent reason. You would type in a command, press enter, and it would show the preloader for a moment before returning to the start of the code again. However, after i tried it a few times, sometimes it would work until i stopped using it, other times i couldn't even do one command, and other times it would happen at a point apparently at random. Does anyone know why this would happen? I don't use any frame moving commands, but i'll post what i added in


ActionScript Code:
function Storyify(found, line) {
    nextLine = line;
    if (found != 1) {
        if (nextLine<>"You mumble to yourself, unsure of your actions." and nextLine<>"") {
            nextLine = "You mumble to yourself, unsure of your actions.";
        } else {
            nextLine = "";
        }
    }
    _root.SavedSO.data.story = _root.SavedSO.data.story+" "+nextLine;
}

As well as several calls to that function throughout the code.

Pausing Then Restarting Animation
heres the scoop i want to delay a function 1 sec after the last function has completed its animations whats the simplest way to code this. Im sort of leaning to set interval but i could be wrong could someone please help thanks


heres the code i have:

--------------------------------------------------------------
tweenBall();
function tweenBall() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 99;
var end = 0;
var time = 1;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
tweenBall1();
}
function tweenBall1() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 0;
var end = 99;
var time = 1;
var mc = xmotion_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
tweenBall2();
}
stop();
function tweenBall2() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 0;
var end = 99;
var time = 1;
var mc = _xinteractive_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
}
stop();

Help With Loop And Restarting Movie
How do I create a loop that runs a child movie 3 times.and then restarts the whole movie again..

Can someone help.

New Page Without Restarting Flash
I know about how you can use frames so you dont have to reload the a swf on a webpage, but my I've decided that frames are just bad in general.

But what I want is to load a new page without interupting the flash and not using frames.

I was thinking about sending whatever variables the flash needs like currentFrame in POST to the next page and then use that currentFrame to make it seem like it didnt reload. But I dont see a way to do that if the menu isnt in flash.

Restarting My Flash Game
So, this is probably a pretty simple question, but how do I go about restarting my flash game from the start? I was thinking maybe it would be like restart() or something, but it doesn't seem to work.

Restarting My Flash Movie
I have done a web-site type interafce in Flash MX and at some stage of the site I want there to be a button, which when pressed, will restart the whole thing from the beginning (not gotoframe 1, but re-setting everything instead).

How is this done?

Thanks!!!

Charlie

Pausing Then Restarting Animation
heres the scoop i want to delay a function 1 sec after the last function has completed its animations whats the simplest way to code this. Im sort of leaning to set interval but i could be wrong could someone please help thanks


heres the code i have:

--------------------------------------------------------------
tweenBall();
function tweenBall() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 99;
var end = 0;
var time = 1;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
tweenBall1();
}
function tweenBall1() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 0;
var end = 99;
var time = 1;
var mc = xmotion_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
tweenBall2();
}
stop();
function tweenBall2() {
easeType = mx.transitions.easing.Strong.easeOut;
var begin = 0;
var end = 99;
var time = 1;
var mc = _xinteractive_mc;
ballTween = new mx.transitions.Tween(mc, "_xscale", easeType, begin, end, time, true);
}
stop();

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