Script advise

I have a working script that allows next button to be disabled until sound is complete.

playme = function(){
page1WAV = new Sound();
page1WAV.loadSound(“page1.wav”,true);
next.enabled = false;
myMP3.onSoundComplete=function(){ next.enabled = true; };
};

next.onPress = function(){ playme(); };

On last button frame I can do my next

currently since this is only an example I have everything (including next button). together on one timeline.

However, in true work form it would be an unworkable mess and a nightmare to edit
Clip nav should be in seperate movie from sound.

Although currently I myself have little working knowledge of actionscript, I do know enough to know that if everything is NOT
exactly right & attached to the right mc or frame it flat won’t work!

Can I still use this script & control buttons in the same way if they are in two seperate MC’s (buttons & Sound)

Any advice you can share would be gretly appreciated.
BTW—If it matters or not I am publishing in Flash 5 player.

Thanks
Janet

this wouldn’t be my choice of scripting sound. i just helped someone with this. try this script.

mySound=new Sound()
mySound.attachsound(“WAV1”);
mySound.Start(0,999);

*Just make sure to go to linkage and make sure the first and last checkbox are checked.
you can disable the buttons the way you have them.

Hi, I appreciate your trying to answer my questions.
Could you be a little more specific as to how to use the script?

my working knowledge of actionscript is very minimal

Thanks for you help,
Jamet

ok sure.

Start by opening a new document.

Step 1
on layer one frame one give the FRAME actions as follows:

mySound=new Sound()
mySound.attachsound(“WAV1”);
mySound.Start(0,999);

Step 2 - Link the imported mp3

import your flash audio file
-goito library-linkage
-name the file WAV1
-click the first and last checkbox(export for actionscript, and export to first frame.

ok your sound file should now start.
if you don’t want your file to start automatically the simple edit your code to say this:

mySound=new Sound()
mySound.attachsound(“WAV1”);

your file will now not start automatically.
create a button and give it these actions:

on(release){
mySound.start(0,999);
}

and to stop it create another button and give the following actions

on(release){
mySound.stop();
}

ok i hope i have cleared my self up a bit more, if you are still having trouble repost .

Wow thanks, that is specific enough that even I can follow!

haha

I can animate in Flash, no problem —but actionscript kicks my tail every time I try to us one.

I have never used the linkage capability on sound before.

I do have a couple of questions, let me explain further what I am after though first.

We are moving our focus from Director to Flash. Because Flash is AICC Compliant. The company I work for builds training modules.
All previous work in Flash was the more complex animation that Director could not handle.

Our client’s union requires that all union employees get this training, AND they listen to the audio completely before they go to the next page.

Some of the audio is rather extensive—we do have some restrictions.
We can only publish in Flash Player 5
File types - aiffs or waves only. currently they do not have MP3 capabilities throughout the entire plant operation. Several hundred or so computers so it is slow moving to get changes made. + to complicate matters they have one IT person.
NO STREAMING - that is a restriction they have placed on their server.

I am working towards streamlining as much as I possibly can,
Therefore currently I have 3 movie clips in the actual published document.
This actually works—but not that well.
layer 1 - clip1 contains the actual loaded page
layer (sound is on this layer so we can sync as close as we can to the event since we cannot stream.)
layer2 - clip2 contains a boxed interface. (kinda TV screenish) with the buttons at the bottom.
Layer3 - clip3 contains the buttons that cannot be available until the sound is finished.

attached to clip1 MC I have this script:
onClipEvent(enterframe){
if(this._currentframe==this._totalframes){
_root.clip3.gotoAndPlay(2);
}
}

as a frame action in frame1 of clip3 I have a stop.
(therefore this only shows up after clip1 is complete.

This works sorta—However is rather flawed in that there is a lag between the end of sound & the pop up of the navigation.

For testing purposes I had used a small tiney MC with just a short sound file. I was really excited until I tried to place the exact same script into my actual job. somewhere around an 8 second lag :frowning:

Hence I am back to square one in the problem solving mode.
Perhaps back to the disable button until sound is complete is the way to go?
This way the buttons would all be there & at least if there were a lag, they would be trying to click until the system played catch up with it,

We originally were going to go with disabled buttons until the sound was done.


OK…now my questions…
my sound is on a seperate MC than the button nav that has to be disabled.

I cannot put the button into the clip that has the sound. becuase of the interface since it is boxed in…I won’t show up :frowning:

I loaded the sound like you said ok…

a) becuase of my minimal knowledge of script I don’t know which part of the current script I have disables the button.

I understand to a certain degree (wonders never cease—scary)
how this works in one movie clip.
but how to use what I got to work together in two seperate clips
I am still way lost,

Thank you for any helpful or useful advice you might be able to offer me.
Sorry for the long message but I figured the best way to get help is for you to know exactly what I am trying to accomplish & why.

Seems to me there is about a jillion ways to do stuff.
I just want the most efficient & most effective one for the operating environment & the restriction that I do have.

~Janet

ok janet you are still consufing what i am saying. when you load the sound like i showed you, your not loading a mc. your simply loading and external file. that script that i gave you should go on your main time line, and so should your buttons. if you want to load multiple sounds at different times, than it is simple. this is your script from what i can see

layer 1 - clip1 contains the actual loaded page
layer (sound is on this layer so we can sync as close as we can to the event since we cannot stream.)
layer2 - clip2 contains a boxed interface. (kinda TV screenish) with the buttons at the bottom.
Layer3 - clip3 contains the buttons that cannot be available until the sound is finished.

why do you have diferent clips?

layer one shoudl be your interface outside a clip

layer 2 should be your actions for loading the sound file

layer 3 should be your buttons

I have 3 clips because I am trying to keep thing simple — Guess it isn’t working haha

Seriously though, I neglected to mention that I am technically not using the interface & just pulling files into it but—due to server restrictions have to load the interface with every page each time a new page loads. Not the best way to do the project but it isn’t our choice.

I will reread what you wrote for better understanding a bit latter,
perhaps it will sink in after I get a chance to think about it.

Thanks for the advise,
Janet

no no no matter what server restrictions you have u do not have to reload the interface. for example use
loadMovieNum(“yourswf.swf”,1);

1 is the level, so if you wanted to load another movie on top of that simply replace 1 with a 2

ok…I think I am starting to see the light.

What you are suggesting indeed sounds like the way to go. However since, (as you can see) I have little scripting knowledge & I have been researching this for probably 2 months trying to find the most workable way to get this to work.

I would actually love to only load the interface once, but these are several pages long some as high as 20+.

It would be wonderful to go in merry page order & not have to change the navigation…such as go to next frame for next clip

However I was told during my research that when flash loads—it loads the entire movie, not just the section which you are playing.

So therefore if you are suggesting I use a target path. I don’t have a clue what do do with my next button or my previous button on the navigation. My supervisor is not actionscript oriented. She has previously built things in Director & she has got some Lingo knowledge…Not a lot but enough to get her by.

We were talking about it this afternoon. She would like to keep the scripting as minimal as possible, since neither her or I have but just a tinsey bit of knowledge about it.

She would like to know if her idea will work. Here is her idea.
a preloader, the actual page, then an after page. with the entire button interface coming up. (The people who use our modules many are NOT computer savvy.)

Could we use something like OnSoundComplete? This I am not sure on. Since we are publishing in FlashPlayer 5, I was looking at the actionscript box & OnSoundComplete is yellowed out?

Or…If she wants to use this type of method would this work?
Scene 1 - preloader
Scene 2 - page info with sounds
Scene 3 - final navigation comes up?

I have the weekend to come up with a workable solution. Or something close to test.

I can always work for a better scenerio (that is on my own time.)

Janet

PS—I was subcontracting, I just got hired yesterday :slight_smile:

ok here is what you do. this is how you shoudl load your pages.

Scene 1 - preload your movie
Scene 2 - page info with “EXTERNAL SOUNDS”
**now on scene 2, you should have your interface and your butttons. meaningyour background shoud be on scene 2 as well as your navigation.
now i am taking it that you are going to have somewhere around 5 sections. each section should be its own .swf
**meaning you should have (for ex.) an about.swf in a totally seperate movie with its own preloader.

now on your main interface there should only be your background and navigation—no content(in our case about.swf)
on your interface create a blank movie clip-go to library and make a mc. drage it to the stage. select it a dgive it these actions.

onClipEvent(load){
loadMovieNum(“about.swf”,1);
}

ok what we are doing here is loading your about.swf onto our inteface. this will give you control to open new movies without changing yur navigation or background. now make sure your about seciotn is exactly where you want it to be when it loadds onto your interface.

what the code means:
onClipEvent(load){ // when movie clips loads…)
loadMovieNum(“about.swf”,1);// load movie on level 1
// level 0 is your interface
}

ok now all you have to dfo is make all seperate swf’sfor your website, with the main inteface and navigation being static.

after you make your other swf’s you are going to have to unload your swf’s as they are not needed. so when you click the contact button you want about.swf to unload and contact.swf to load. here’s how you do it

on contact button-----
on(release){
loadMoviNum(“contact.swf”,2);
unloadMovieNum(1);
}

what the code means:

load contact.swf on level 2 so it will be on a about.swf
when you unload your movies u just need to type the layer number to unload.

unLoadMovieNum(level);
unLoadMovieNum(2);

ok i think you wil be fine… if you have trouble let me know.

ahhhhh…ok thanks for all the info on this.

I do have one small question–(I’ll probably have more–haha once I get into it) I’ll present this way to my supervisor.

Back to my initial problem & the first reply you sent me.

How do I manage to disable the next button till the sound is complete?

I have the original script that I thought about using but, you said to load my sounds a different way? & the disable is written into the original script.

You answer the disable question & I have enough to satisfy my overwhelming curiosity for now!
:slight_smile:

Cheers
Janet

ok…
So I have a couple more questions…
I read through this several times.

Am I assuming this correctly?

Once I get the first page loaded & put the script on the next button & unload the first mc that it will count which number I am on? & I would just go backwards for my previous button.

3 buttons I have covered—index, help & replay. Next & previous are what I am concerned about. & the fact that Next cannot work until the sound is finished.


Forgive this rather technically stupid question.
I am more htm oriented than Flash & have only been working in Flash for a couple of months.

BUT—I need to know this, when uploading these online. We actually uploading the html files with it too correct?

Reason being we are going to publish them with AICC tracking. So if we are referencing the SWF files I assume at the same time we are referencing the html files?
Thank you for your patience
~Janet

ok you need to upload the swf and the html files. i would suggest using dreamweaver to embed your flash movie.

ok your on the right track. i m going to paste a code from on of my projects. this is the code for my home button located on my index page

on(rollOver){
with(homemc){
gotoAndPlay(2);
}
}

on(rollOut){
with(homemc){
gotoAndPlay(7);
}
}

on(release){
loadMovieNum(“home.swf”,“1”);
}

on(press){
unloadMovieNum(2);
unloadMovieNum(3);
}

ok you are concerned with these lines of code…


on(release){
loadMovieNum(“home.swf”,“1”);
}

on(press){
unloadMovieNum(2);
unloaieNum(3);
}


the level numbers go up
unloadMovieNum(2); unloads in my case(challenge.swf)
unloadMovieNum(3); unloads in my case(downloads.swf)


loadMovieNum(“home.swf”,“1”); loads movie num 1 (home.swf)

do you understand what i am getting at?

let me look into your volume problem and i will post . if you are still having problem i will post my .fla for you tonight

I am greatful for the time you took to clue me in on the best way to handle this.

I guess I’m not so brain dead after all if I am beginning to get the idea huh? LOL

Personally—If I had my prefers I’d prefer not to mess with the disable button thing. You would think that people would WANT to learn proper safety procedures. I would if it were my job.

BUT the company union says it is manditory that they listen to the training audio portion. They get a quiz at the end so they better!
anyway so it comes with the territory of the project, Do what the client wants & everyone will be happy.

SOOOO—if they can’t touch the button till the audio is complete either by
disabling it until the sound is complete or
just not show up till the sound is complete.

That is what I need to do :slight_smile:

THANKS,
Janet
oooo() ()oooo
( ) A mind stretched in a new ( )
( ) direction never returns to its ( )
( ) original shape. ( )