|
-
button to control item in playlist AS3
ok call me stuuupid
but I am sure this is simple, but can't seem to get it to work, in AS3
I just want to have a button play an item in the media player playlist, for example, index 3.
the media player is 'mediaplayer' and the button is 'btn3'
so I tried this:
------------------AS3--------------
btn3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler31);
function mouseDownHandler31(event:MouseEvent):void {
mediaplayer.play(playlist.selectedIndex,'3');
}
---------------------------
also tried this:
-------------------
btn3.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler31);
function mouseDownHandler31(event:MouseEvent):void {
mediaplayer.playlist.selectedIndex.play(3);
}
-----------------
grrrr
I know I am using wrong syntax, I do not know AS3
any help is appreciated
cheers
-
KoolMoves Moderator
You almost had it
mediaplayer1.playlist.selectedIndex=(3);
grrr thought I had this working, it does select the item but it doesn't play it. Not sure how to proceed
Last edited by blanius; 01-14-2011 at 05:28 PM.
-
Thanks
that works to select it visually, but it doesn't seem to actually play the audio for right index file...
the right file is selected and highlighted - but it does not play the audio for that file...it plays whatever the previous file was (either the file that was default or any that is selected directly in the playlist with mouse)
strange...
what am I doing wrong?
-
aha!!
I figured it out.
this is the code:
mediaplayer1.playlist.selectedIndex=(3);
mediaplayer1.loadSelectedItem();
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|