all groups > flash actionscript > march 2007 >
You're in the

flash actionscript

group:

Sound On Page Enter Stutters A Few Times...


Sound On Page Enter Stutters A Few Times... Tanner8
3/2/2007 9:28:16 PM
flash actionscript:
I made a page transition thing with Tween and added sound. I used this script
to make it play the tween when I enter any page..

The problem is that when I enter a page I want the tween to start on frame 70.
It plays the sound but somtimes it sort of sounds like its playing 2 or 3 of
the sounds at the same time ( only for a few milliseconds though. It sort of
stutters for the first .2 seconds ) then plays through fine. This problem dosnt
happen on all pages. I made sure i am not playing the sound anywhere else at
any time when you click on that frame but i cant find whats causing it. Also,
this dosnt happen every time, if I click the home link it will do it, then if I
click it again it might not... Another problem is sound inconsistency, somtimes
when I click on a link it plays the sound much louder then it did before and
this also seems to be on a random basis.

Also, my tween works fine. If I just play the tween its exactly as I want it (
also it plays the tween from frame 70 every page but it dosnt stutter on some ).

And yes i did the "stop();" in the first frame.
Whats wrong? Thanks

var i = 70;
this.onEnterFrame = function() {
delete this.onEnterFrame;
trans.gotoAndPlay(i);
};
Re: Sound On Page Enter Stutters A Few Times... kglad
3/2/2007 10:22:20 PM
the code you showed wouldn't cause the problem unless that code is repeatedly
executing. on the other hand, that code should be:



var i = 70;
trans.gotoAndPlay(i); // and is there some reason to define i, instead of
just using trans.gotoAndPlay(70)?
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/2/2007 11:08:10 PM
I sort of know whats going on but i cant fix it. I have the motion and the
sound all in one tween. For some reason when I put the tween onto the frame and
remark out my code that says to play it. It dosnt play the motion but it STILL
plays the sound... So the reason its studdering is because its playing the
sound when it gets to the frame, then its playing it AGAIN when i actually code
it to play the tween. I searched ALL of my layers and such for anything that
may be making this sound play but i have no idea why its playing. Why is it
automatically playing one part of the tween when im NOT even calling it? Thanks
Re: Sound On Page Enter Stutters A Few Times... kglad
3/2/2007 11:21:32 PM
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 12:07:02 AM
Yup just realized that, I bumped the frames over one and now that fixed it! 2
more questions plz.

1) I have the tween playing in the first frame so right when you go to the
page it plays it. The problem is that the normal page flashes first, and then
plays the tween. I want it to play the tween right on entry instead of that
small delay, ( its noticible and ugly believe me ).

2) What code can i use to make somthing play on the leaving of a frame? I know
i can hook it up to a button and make it so on release it will play it but are
there any other ways? Thanks!
Re: Sound On Page Enter Stutters A Few Times... kglad
3/3/2007 12:49:12 AM
there's no direct way to execute code just prior to exiting a frame. there are
ways to accomplish that, but they probably aren't needed in your situation.

you will probably be happier setting the next page's _visible property to
false (as soon as the next page is known and) until your transition finishes.
then set its _visible property to true.
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 1:36:52 AM
Ok thanks that works great. How can I make it go to a frame AFTER the tween
reaches a certain frame? I tried "if(trans._currentframe==69)" but that didnt
work at all. The problem is that when i click on the button, I want it to play
the WHOLE transition on that page and then move onto the next page. It keeps
jumping to the next page and then playing it there... Sorry about all these
questions but its better to ask in the same thread then create a bunch of
others. Thanks
Re: Sound On Page Enter Stutters A Few Times... kglad
3/3/2007 2:12:05 AM
the easiest way to do that would be to use actionscript on the last frame of
your transition tween to goto a frame label. that label should be a variable
whose value changes depending upon the next page.

for example:



yourbutton.onPress=function(){
_root.nextPage="page3";
_root.nextPage._visible=0;
// play transition tween
}

// and on the last frame of your transtion tween:

gotoAndStop(_root.nextPage)
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 4:10:28 AM
I got your idea and it sounds good. I edited it because I didnt really
understand that way so what i tried to do was set the page you want to go to a
variable. Then in the last frame of tween, send it to that frame. The problem
is that its going to that frame in the tween and not in the actual thing. I
tried

"gotoAndPlay("Scene 1",8);

but that stil played it off the tween. Thanks
Re: Sound On Page Enter Stutters A Few Times... kglad
3/3/2007 4:17:33 AM
don't use scene information for navigation and don't use the goto functions. use frame labels and the goto methods:



Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 4:28:16 AM
Ya but how do you label the frames to like page8? I searched and couldnt really
find anything. I can click on frame of one of the layers and label that but
that dosnt do anything. How can I label a whole entire frame so when i set
netPage to that page it will go there? ( yes i am new to this stuff ) thanks.
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 5:01:41 AM
Re: Sound On Page Enter Stutters A Few Times... Tanner8
3/3/2007 5:01:43 AM
AddThis Social Bookmark Button