Flash music player can be even more Qu original document release
Simply say something, I look at the specific source files.
1. Into four music files in the library right - link identifiers are: s01 s02 s03 s04
2. Do a volume control, and click Control AS:
On (press) (
StartDrag (this, true, left, top, right, bottom);
)
On (release) (
StopDrag ();
)
OnClipEvent (load) (
= _y Top;
= _y Bottom;
_x Left =;
_x Right = 150;
_x = 75;
)
OnClipEvent (enterFrame) (
_root.mySound.setVolume (_x-Left);
) 3. Audio visual effects do a green rectangular, F8 to films, the name for the entity: line
AS the first frame plus:
_root.lineMc.line._visible = False;
_root.lineMc.onEnterFrame = Function () (
For (var i = 0; i <20; i) (
DuplicateMovieClip ( "line" and "line" i, i);
With (_root.lineMc [ "line" i]) (
_x = 4 * i;
_y = 0;
_yscale = Math.round (Math.random () * 100);
)
)
);
Stop (); second frame and AS:
_root.lineMc.line._visible = False;
_root.lineMc.onEnterFrame = Function () (
For (var i = 0; i <20; i) (
DuplicateMovieClip ( "line" and "line" i, i);
With (_root.lineMc [ "line" i]) (
_x = 4 * i;
_y = 0;
_yscale = 25;
)
)
);
Stop (), 4. Placement of all accessories, and the music control buttons entity name: btnPrev btnPlay btnPause btnNext
The third step to control the audio visual effects for the name of the entity: lineMc
Rafah three dynamic text, variables are: pauseTotalTime soundName txtBtn
AS increase in the first frame:
I = 1; / / initial value s1 = "Wenbie position - Hacken Lee";
S2 = "kill the phone - Kelly";
S3 = "there is only - Joey Yung."
S4 = "kiss the more sad - Jacky Cheung";
MySound = new Sound ();// create Sound object mySound.attachSound ( "s01 ");// call identifier for the links in the audio files s01 mySound.start ();// broadcast mySound.onSoundComplete = function ( ) (/ / Automatic Call i;
If (i> 4) (
I = 1;
)
MySound.attachSound ( "s0" i);
MySound.start ();
);
OnEnterFrame = function () (
PauseTimes = Math.round (mySound.position/1000); / / sound files have been broadcast totalTimes = Math.round (mySound.duration/1000); / / sound files total time pauseTotalTime = pauseTimes "s", "/" totalTimes " s ";
SoundName = eval ( "s" i); / / simulation trace array (pauseTotalTime);
Trace (i);
);
Var song = true; / / declare a variable, the song is true that the voices of documents are being broadcast btnPlay.onRelease = function () (
If (song == false) (
MySound.start (pauseTimes); / / Seconds suspended from the broadcast song = true;
)
_root.lineMc.gotoAndStop (1);
);
BtnPause.onRelease = function () (
If (song == true) (
PauseTimes = Math.round (mySound.position/1000);
MySound.stop ();// suspended players song = false;
)
_root.lineMc.gotoAndStop (2);
);
BtnNext.onRelease = function () (
I;
If (i> 4) (
I = 1;
)
MySound.stop ();
MySound.attachSound ( "s0" i);
MySound.start ();
_root.lineMc.gotoAndStop (1);
);
BtnPrev.onRelease = function () (
I -;
If (i <1) (
I = 4;
)
MySound.stop ();
MySound.attachSound ( "s0" i);
MySound.start ();
_root.lineMc.gotoAndStop (1);
);
BtnPrev.onRollOver = function () (
_root.txtBtn = "1";
);
BtnPlay.onRollOver = function () (
_root.txtBtn = "Player";
);
BtnPause.onRollOver = function () (
_root.txtBtn = "Suspended";
);
BtnNext.onRollOver = function () (
_root.txtBtn = "Next first";
);
BtnPrev.onRollOut = function () (
_root.txtBtn = "";
);
BtnPlay.onRollOut = function () (
_root.txtBtn = "";
);
BtnPause.onRollOut = function () (
_root.txtBtn = "";
);
BtnNext.onRollOut = function () (
_root.txtBtn = "";
);
If that much paper can be read loadSound attachSound, external load music files, for the partial revision of the code, the same principle.
The document, occupation of source files to delete music files. Open source files, import sound files of four, plus links identifier. Original documents:






Leave a Reply