Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Visual Design > Flash and ActionScript

Reply
 
LinkBack Thread Tools
Old December 12th, 2008, 12:10 PM   #1
New Member
 

Join Date: Nov 2008
Location: US
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 tizbo1423 is on a distinguished road
Music Player w/ Cookie?

Basically what I need is an audio introduction that automatically starts when the page is loaded, has an option to be stopped and restarted, but also works with a cookie so if a user goes to the site again, the intro would not play again, but will have the player there to play it again if they want to hear it.

is that even possible? i'm sure it is
tizbo1423 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 18th, 2008, 04:20 PM   #2
New Member
 

Join Date: Nov 2008
Location: US
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 tizbo1423 is on a distinguished road
Re: Music Player w/ Cookie?

anybody?
tizbo1423 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 23rd, 2008, 03:25 PM   #3
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: Music Player w/ Cookie?

Sorry dude, flash is not my forte
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 24th, 2008, 08:43 PM   #4
New Member
 

Join Date: Dec 2008
Location: Idaho
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Jimb is on a distinguished road
Re: Music Player w/ Cookie?

@Tizbo1423

I do something like what you are looking to impliment on my Home Page. I use the javascript shown below.
Code:
function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}
/*
expire_time*24*60*60*1000
to make it for hours, 
delete * 24, for minutes, delete * 24 * 60
*/
function createCookie(name,value,expire_time) {
    if (expire_time) {
        var date = new Date();
        date.setTime(date.getTime()+(expire_time*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
}

      var flashvars =

      {
        autostart:            'true',
        enablejs:             'true',
        javascriptid:         'y',
        file:                 'comments.flv',
        skin:                 '',
        image:                'none',
        menu:                 'false',        
        icons:                'false',
        controlbar:           'none',
        transparent:          'true',
        volume:               '80'
      };

      var params =
      {
        allowscriptaccess:    'always',
        wmode:                'transparent',
        bgcolor:              '#BFCFFF'        
      };
      
      var attributes =
      {
        id:                   'playerId',
        name:                 'playerId'
      };

if ( window.readCookie ) {
        // See if cookie has been set
        if (readCookie("NewUser")=="true") {
            flashvars.autostart = 'false';
           } else {
            flashvars.autostart = 'true';
        }
    } else {
            flashvars.autostart = 'true';
    }
    
swfobject.embedSWF('player.swf', 'player', '400', '223', '8', false, flashvars, params, attributes);
   // Disable Auto Play
    // - see if js function exist, the function should only exist on the pages you want to limit autoplay
    //
    if ( window.readCookie ) {
        // If cookie has not been set, then set it
        if (readCookie("NewUser")!="true") {
            createCookie("NewUser","true",1);    /* set to 1 minute for testing */

        }
    }
Hope this will help you - Jim

Last edited by Jimb; December 24th, 2008 at 08:45 PM..
Jimb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a flash music player to an html site? crash41 HTML, XHTML and CSS 1 July 10th, 2008 10:34 PM
Flash Music Player RZX Developer Flash and ActionScript 1 April 28th, 2008 12:15 PM
flash music player that plays music throughtout saxy46 Flash and ActionScript 5 August 23rd, 2006 10:24 AM
Help, with creating a Music Player, to be embedded into a html code website sx-nutta Flash and ActionScript 1 January 25th, 2006 01:41 AM
Flash Music Player aljandro Flash and ActionScript 0 December 21st, 2005 05:10 PM


Search Engine Optimization by vBSEO 3.2.0 RC8