Need Help!

Hi list,

My web site is almost completed… (except for few designs and other stuffs)…

I wanted to include a music file on the main home page… I know how to include the music file. But the problem is that I just need only about 25 seconds of the music file…(I dont want to play the whole file…)

Is there any way to make that work… Any kind of help is appreciated…

Thanks-
Sathish

Do you mean you want to have the music playing but stops on a certain frame…or you want flash to take the full music file and cut off everything after 25 seconds?

Hi,

I think either way would be fine… I think I prefer the second one…

Thanks for ur help-
sathish

I have an answer for you, but let me prepare you a file to go with it and some pictures to explain linkage! It will be released in about 30 minutes!

’Sound Object’ Mini Tutorial:

Step 1:
First off lets get your sound file so that it can be controlled by sound object methods. To do that open up the library (Ctrl + L) and look for your sound file and right click on it and select 'Linkage…" like I show you below:

Now you should get a pop-up window with the Linkage Properties and select the check box that says ‘Export for ActionScript’ and the checkbox that says ‘Export in first frame’ and last but not least in the ‘Identifier’ text area place a name for your sound object (I used ‘dre’ because I used a dre song). Now it should look the same below in the picturce I provided as what you should have except a different Identifier name:

Step 2:
Make an empty movie clip (Ctrl + F8) named ‘script_clip’ (you don’t have to name it anything particular). And add it to your timeline then open the actions panel (F9) and place this code in it:

//To be executed when clip loads which only
//happens one time but thats all we need.
**onClipEvent(load) {**
	//Make a new sound object named 'mySound'.
	**mySound = new Sound(); **
	//Attach sound file named 'dre'.
	**mySound.attachSound("dre");**
	//Start playing sound file.
	**mySound.start();
}**

//To be executed every frame, like a timeline loop.
**onClipEvent(enterFrame) {**
	//Make 'mySoundTime' variable so that we can store the
	//position in seconds to be used in 'if statement'.
	**mySoundTime = Math.round(mySound.position/1000);**
	//An if statement used to tell if the variable
	//'mySoundTime' has reached 25 seconds.
	**if(mySoundTime >= 25) {**
		//Stops 'mySound' object.
		**mySound.stop();
	}
}**

Step 3:
To edit this to play a different sound file than the one I used, ‘dre’, than edit this line of code and replace the name that is underlined below with the Identifier for the sound file you used to make in the linkage properties:

mySound.attachSound(“dre”);

To change the time in which the file stops playing then change this code that is underlined to a numeral of your choice:

if(mySoundTime >= 25) {

Step 4:
You are all done and I provided the source file below if you have any more questions don’t hesitate to ask them!

<a href=http://www.macromotive.com/ebay/sound_test.fla>Sound Test File</a>

nice explination Dan.

Thanks upuaut (I know its david but I miss your old name!),

I want to play Neverwinter Nights…haven’t had the time to go out and get it, I have played Dungeon Siege and I heard it was sort of like that?