Results 1 to 5 of 5

Thread: Array problem

  1. #1
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Array problem

    What's wrong with this?


    Code:
    <!--SCM Music Player by Adrian C Shum - http://scmplayer.net-->
    <script type="text/javascript" src="http://scmplayer.net/script.js" ></script>
    <script type="text/javascript">
    var Nasyeed = [{'title':'Qasidah Burdah','url':'http://www.youtube.com/watch?v=tsk9LPDsgsA'},{'title':'Sahabat Sejati','url':'http://www.youtube.com/watch?v=6-OtuuV9IqA'},{'title':'Sebuah Pertemuan','url':'http://www.youtube.com/watch?v=ajmN6ByXnJY'},{'title':'Kau Sahabat Kau Teman','url':'http://www.youtube.com/watch?v=NcEyGU8eB2M'},{'title':'Doa Perpisahan','url':'http://www.youtube.com/watch?v=lOaTAV2_ibM'}];
    var Song = [{'title':'A Shoulder To Cry On','url':'http://www.youtube.com/watch?v=nSJ3sSxv0yg'},{'title':'All Out Of Love','url':'http://www.youtube.com/watch?v=yr3dJxeT4oA'},{'title':'Take My Heart','url':'http://www.youtube.com/watch?v=eXoIbbE1KXs'},{'title':'Perfect Two','url':'http://www.youtube.com/watch?v=-lLvtydTM78'},{'title':'A Drop In The Ocean','url':'http://www.youtube.com/watch?v=mt8jifKlbTc'}];
    var Percent = Math.floor(Math.random()*100);
    var selected;
    if (Percent >= 50)
    {
    selected = Nasyeed;
    }
    else
    {
    selected = Song;
    }
    SCMMusicPlayer.init("{'skin':'skins/tunes/skin.css','playback':{'autostart':'true','shuffle':'false','volume':'100'},'playlist':selected,'placement':'bottom','showplaylist':'false'}");
    </script>
    <!--End of SCM Music Player script-->
    Last edited by jscheuer1; 03-12-2012 at 03:59 AM. Reason: Format

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by Devilester View Post
    What's wrong with this?
    there is no explanation of what you want to happen, or what problems you're having.

    Your question is unclear.
    Please provide more information, and be as specific as possible.
    • What do you want to accomplish?
    • What have you already tried?
    • What problems did you encounter?

    Also, please be sure that you have included all relevant code and/or a link to the page in question.


    Please post a link to the page on your site that contains the problematic script so we can check it out.


    Without more information, we can only guess.
    Maybe you're trying to pass an object to SCMMusicPlayer.init() (currently, you're passing a string)?
    (also, in that string, you have 'playlist':selected (no quotes around the value) - might be part of it.)
    Last edited by traq; 03-12-2012 at 04:38 AM.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There's nothing intrinsically wrong in that code, at least nothing that jumps out at me. I don't like the idea of using a String to represent an Object, but that's not my call as it appears to be code for the SCM Music Player by Adrian C Shum. As such it was/should have been generated by the SCM Music Player Setup Wizard. Any attempt to edit it after it's generated is not advised. If you need to edit it (from SCM Music Player website):

    You can select "Import Profile" (Bottom left of Setup Wizard) to import your existing SCM code into the setup wizard. After done editing, copy and paste the new code to replace the old one.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the advice. I thought if I edit the code I would make what I wanted it to be.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What about it were you trying to change? What did the code look like before when it was working?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •