[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] Re: stereo sound(track)
From: |
Russell Lyons |
Subject: |
Re: [Swftools-common] Re: stereo sound(track) |
Date: |
Wed, 14 Jul 2010 14:18:05 -0400 (EDT) |
User-agent: |
Alpine 2.00 (LFD 1167 2008-08-23) |
Hi, Iosif.
Thanks very much. This works, even after I put in the pause button. :-)
Now I have to see whether it will also work when video is going at the
same time.
(By the way, the problem before was not with cygwin, as it happens even
under cmd in WinXP.)
Best regards,
Russ
Hi Russ,
Here is the mp3 player as simple as it can get [put the code bellow into a
file foo.sc]:
.flash filename="sound.swf" fps=24 bbox=100x40 background="" version=8
.box play width=20 height=20 line=0 fill=blue
.box stop width=20 height=20 line=0 fill=red
.button bt_play
.show play as=area
.show play as=idle
.show play as=hover y=-1
.on_press:
_root.play();
.end
.end
.button bt_stop
.show stop as=area
.show stop as=idle
.show stop as=hover y=-1
.on_press:
_root.stop();
.end
.end
.put bt_play 15 10
.put bt_stop 40 10
.action:
song = new Sound();
song.loadSound("dust.mp3", true);
function play(){
song.start();
};
function stop(){
song.stop();
};
.end #end of action
.end
So explaining that code:
-first line creates a file sound.swf [after compiling swfc foo.sc]
-after create 2 rectangles 20x20 pixels play and stop one blue and other
red
-create 2 buttons one for play and one for stop using on press action for
those buttons trigger their respective functions
-put the buttons at a certain position
-in between the action:/end tags are the actionscript 2 code
-create a new sound object called song [you can name it whatever you
want]
-next line load the mp3 song into that object [put your mp3 file name
in here and the file have to be in the same folder as the foo.sc file]
-function start tells to object song to start and function stop tells
to object song to stop
To play that file into any browser do this:
Put the flowing code into a file player.html in the same folder withe the
compiled sound.swf file:
<html>
<head>
</head>
<body>
<table border="0" bgcolor="black" width=100% height=100%>
<tr>
<td align="center">
<object width="100" height="40">
<param name=quality value=high>
<param name="movie" value="sound.swf">
<embed src="" width="100" height="40">
</embed>
</object>
</td>
</tr>
</table>
</body>
</html>
Drag the player.html in any browser and the song should start
automatically. In the middle of the page you should have a blue and a red
button.
I use swftools-0.9.0 and works on windows and linux too.
If you follow the steps it should work. Take it from here and you can do
just about everything
Hope helps.
Regards,
Iosif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Swftools-common] Re: stereo sound(track),
Russell Lyons <=