A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Songs Not playtintg first time around

  1. #1
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299

    resolved [RESOLVED] Songs Not playtintg first time around

    Hi,

    I'm loading the xml path into my flash by using FlashVars.

    The first time you click a link it doesn't play the song, but the second link you hit works and if you go back to the first link you clicked it works now.

    Here's an example

    I get these 2 errors in my flash

    I load my xml path into the flash movie so the second _level0.textis correct.
    Error opening URL 'file:////Venus5/multimedia/Interactive/MMED%5F0025%20Elvis%20Collectable%20Tins/Xtras/Javascript%5FTalking%5Fto%5Fflash/undefined'
    Error opening URL 'file:////Venus5/multimedia/Interactive/MMED%5F0025%20Elvis%20Collectable%20Tins/Xtras/Javascript%5FTalking%5Fto%5Fflash/_level0.text'
    Can anyone see why this is happening?

    Code:
    stop();
    
    // Setup sound object
    var s:Sound = new Sound();
    s.onSoundComplete = playSong;
    s.setVolume(75);
    
    // Array of songs
    var sa:Array = new Array();
    
    // Currently playing song
    var cps:Number = -1;
    
    // Load the songs XML
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
    {
    	var nodes:Array = this.firstChild.childNodes;
    	for(var i=0;i<nodes.length;i++)
    	{
    		sa.push(new Song(nodes[i].attributes.url, nodes[i].attributes.artist, nodes[i].attributes.track));
    	}
    	playSong();
    }
    
    
    xml.load(text);
    
    function playSong():Void
    {
    	s = new Sound();
    	s.onSoundComplete = playSong;
    	s.setVolume(75);
    	mute.gotoAndStop("on");
    	if(cps == sa.length - 1)
    	{
    		cps = -1;
    		s.loadSound(sa[cps].earl, true);
    	}
    	else
    	{
    		s.loadSound(sa[++cps].earl, true);
    	}
    	trackInfo.text = sa[cps].track;
    	playPause.gotoAndStop("pause");
    	textPos = 0;
    }
    Thanks,
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

  2. #2
    Total Universe Mod jAQUAN's Avatar
    Join Date
    Jul 2000
    Location
    Honolulu
    Posts
    2,429
    please be careful not to double post.

  3. #3
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299
    oops! Sorry
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center