Flash Trek: The Unofficial Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Oppening Sound

4 posters

Go down

Oppening Sound Empty Oppening Sound

Post by JPB18 2008-08-23, 19:36

When appears the game title with the cloak sound, how can I change it with one that I already have in the library?
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-24, 00:34

change the sound object.
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-24, 08:07

No, I still need the cloacking sound! But in the code, how can I change it?
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by raffitz 2008-08-24, 08:27

Well, you search for it... It's in one of the preloader frames, that's for sure...
avatar
raffitz
Lt. Commander
Lt. Commander

Male Number of posts : 2234
Age : 31
Registration date : 2007-12-15

https://github.com/raffitz

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by me naam is m 2008-08-26, 11:10

preloader: layer 18, frame 10 wrote: soundbeep = new Sound(this);
soundbeep.attachSound("musicintro");
cloaksound = new Sound(this);
cloaksound.attachSound("cloak");
soundbeep.start(0, 999);

here!
me naam is m
me naam is m
Commander
Commander

Male Number of posts : 9981
Registration date : 2007-12-26

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-26, 11:12

good! Now darkwing, how can I change that, without influencing the cloaking device sound?
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-26, 11:49

like i said, change the sound object.
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-26, 12:01

but that wont change the cloaking device sound?
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by me naam is m 2008-08-26, 12:03

nope, add a sound (the one you want) name it, say... fruit, and change
cloaksound.attachSound("cloak");
to
cloaksound.attachSound("fruit");
me naam is m
me naam is m
Commander
Commander

Male Number of posts : 9981
Registration date : 2007-12-26

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-26, 12:04

did you already tryed that?
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by me naam is m 2008-08-26, 12:05

busy with it, actually.

EDIT: oops... wrong, sorry.
me naam is m
me naam is m
Commander
Commander

Male Number of posts : 9981
Registration date : 2007-12-26

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by me naam is m 2008-08-26, 12:13

(oh noes! doublepost!) actually, you should still do that, but in preloader layer 16 frame 16 you should change
stopAllSounds();
cloaksound.start();
into
stopAllSounds();
fruitsound.start();

EDIT: oops... now I've got no sound at all... doesn't work either! Sad
me naam is m
me naam is m
Commander
Commander

Male Number of posts : 9981
Registration date : 2007-12-26

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-26, 13:12

this is what you need:

using fruit as the example:

fruit = new Sound();
fruit.attachSound("Linkage name of sound");
fruit.start;
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-26, 17:34

At the Linkage name, should I write sound-kawoosh (as it is named in the library)? Or just Kawoosh?

EDIT: I did it, but I needed to sacrifice the wormhole sound, for this to work.
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by me naam is m 2008-08-26, 19:30

Darkwing wrote:fruit = new Sound();
fruit.attachSound("Linkage name of sound");
fruit.start;

tried that... didn't work...

(I used the enterwarp in the experiment, other sounds... didn't work. or should I add 'sound-' in front of it?)
me naam is m
me naam is m
Commander
Commander

Male Number of posts : 9981
Registration date : 2007-12-26

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-27, 00:27

ok, ok, i'll write up a full tut including fla files for ya tomorrow
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-27, 12:17

OK, here's your tut:

http://www.fileden.com/files/2008/7/30/2026414/sound_tut_files.zip
Creating sound objects using Actionscript

Intro:
This will be a fairly simple tutorial, that will let you create your own sound objects in flash. Sound objects allow far more versatility and control with sound, than importing it into the timeline. So let's begin!

Step 1.
Download the files that come with this tutorial.
Open up Flash. I am using Flash 8, but the code and everything should work for Flash MX or later.
Open up your library (F11).
Go to File>Import>Import to Library (Or CTRL F7)
Find the file imperial_march.mp3 (included in your download)
It should now be stored in your library

Save your project. I called it sound_march.fla

Step 2.
Open up your actions panel (F9)
In your library, right click on imperial_march.mp3 and choose Linkage.
Click Export for Actionscript.


Click OK.
Now, on frame 1 of layer 1, in the actions panel, type the following code:

music = new Sound();
music.attachSound("imperial_march");
music.start();
stop();

Test your movie. You should now be listening to the imperial march from Star Wars.

Step 3.
So what does it all mean? Well, it's all pretty simple, here:

music = new Sound();

This means that you have created a new sound object, with music as the name of the object. You can use whatever variable name you like, as long as you are consistant, I just chose music as it was appropriate.

music.attachSound("imperial_march");

this means that you are loading the sound object music, on frame 1 of layer 1 (you can do this on any frame or layer that you like). The sound you are attaching, is a specific one from your library, using its linkage name, which in this case was imperial_march.

music.start();

Finally, you are actually playing the sound object music in this frame.
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-28, 11:21

so, did this help?
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by JPB18 2008-08-28, 13:48

yup, alot!
JPB18
JPB18
Commander
Commander

Male Number of posts : 5475
Age : 30
Location : At atlantis searching for the ultimate weapon! Ok.. I'm in Azeitão, Portugal...
Registration date : 2008-05-15

http://joaopedroborrego.wordpress.com/

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Darkwing 2008-08-28, 13:50

good!
Darkwing
Darkwing
Founder
Founder

Male Number of posts : 17810
Age : 34
Location : Everywhere
Registration date : 2007-10-13

http://www.flashtrek-tuf.com

Back to top Go down

Oppening Sound Empty Re: Oppening Sound

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum