Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Flash MP3 Player 1 Tutorial Problem


Hi, I'm a beginner. (...and I'm italian, so excuse for my english before)
I try to do what video part 1 shows.
but it doesn't seem to work.
I'm working in mac/OS and flash cs3.
this is the mp3Player.as code:
Code:

// 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(nodes[i].attributes.url);
  }
  playSong();
}


xml.load("songs.xml");

// Play the MP3 File
function PlaySong():Void
{
   if(cps == sa.length -1)
   {
      cps = 0;
      s.loadSound(sa[cps], true);
   }
   else
   {
      s.loadSound(sa[++cps], true);
   }
}


...and this the songs.xml:
Code:

<?xml version="1.0" encoding="utf-8"?>

<songs>
<song url="chompSamba.mp3"/>
<song url="cureForTheItch.mp3"/>
<song url="sheLooksToMe.mp3"/>
<song url="soWasRed.mp3"/>
<song url="thisIsWar.mp3"/>

</songs>


i put Code:

#include "mp3Player.as" in the first frame of the flash file

what's wrong? I thougt maybe the problem is I'm working in remote...I put all files in a folder.
could anyone find the mistake?
thanks




General Flash
Posted on: Thu Sep 18, 2008 4:59 pm


View Complete Forum Thread with Replies

Sponsored Links:

Is There A Tutorial For A Mp3 Player In Flash?
Can i get a tutorial of a flashplayer in flash where i can upload music files(mp3) with the Standalone File. anyone?


tnx in advance

View Replies !    View Related
Flash Player Tutorial
ive looked all over the interweb and i still cant find a good solid tutorial for creating a very basic h.264 player. one with just a play button, a pause button, a scrub bar, and maybe a fullscreen button. anyone know of any good tutorials or even a FLV file with a template. something please.

View Replies !    View Related
Flash MP3 Player 2 Tutorial
I'm not sure if I just coded things wrong, but after finishing the Flash MP3 Player 2 tutorial my songs no longer played one right after another. I don't know if this is "as designed" but it bothered me. I felt like if left to it's own devices an mp3 play list should play all the songs in succession without requiring the user to click the next button after one song ends.

The work-around I came up with was to add another 's.onSoundComplete = playSong;' immediately following the 's = new Sound();' in the playSong function.

For all I know, when I get to the end of part 3 that could have been addressed or my original error would have come to light. The important thing here is that *I* figured out a solutionthat worked for me - which wouldn't have happened without these tutorials. Many thanks! These tutorials are turning me from being 'just a designer' to something more and it is greatly appreciated.

L8r

View Replies !    View Related
Flash MP3 Player Tutorial...HELP
Hi! I tried to make an MP3 player with the tutorial provided here. The music was playing until i created the play pause buttons. After that no music was playing, nothing happens on rollovers on the buttons, but there are no erroes in the action script.

Here is the code i uses, and you can get the files here http://www.x-piral.com/dp/new.rar

Actionscipt code for mp3Player.as

Code:

// 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;

// Position of music
var pos:Number;

// 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("songs.xml");

// Play the MP3 file
function playSong():Void
{
s=newSound();
s.setVolume(75);
s.onSoundComplete=playSong;
mute.gotoAndSTop("on");
if(cps==sa.length-1)
{
  cps=0;
  s.loadSound(sa[cps].earl,true);
}
else
{
s.loadSound(sa[++cps].earl,true);
}
trackInfo.text=sa[cps].artist+" - " +sa[cps].track;
playPause.gotoAndStop("pause");
}

// Pauses the Music
function pauseIt():Void
{
pos = s.position
s.stop();
}

// Unpauses the Music
function unPauseIt():Void
{
s.start(pos/1000);
}

// Music controls

// Play/Pause Toggle
playPause.onRollOver=function()
{
if(this._currentframe==1) this.gotoandStop("pauseOver");
else this.gotoAndStop("playOver");
}
playPause.onRollOut=playPause.onReleaseOutside=function()
{
if(this._currentframe==10) this.gotoandStop("pause");
else this.gotoAndStop("play");
}

playPause.onRelease=function()
{
if(this._currentframe==10)
{
this.gotoAndStop("playOver");
this._parent.pauseIt();
}
else
{
this.gotoAndStop("pauseOver");
this._parent.unPauseIt();
}
}

//Next Button
next.onRollOver=function()
{
this.gotoAndStop("nextOver");
}
next.onRollOut=next.onReleaseOutside=function()
{
this.gotoAndStop("next");
}

next.onRelease=function()
{
this._parent.playSong();
}

// Mute Button

mute.onRollOver=function()
{
if(this._currentframe==1) this.gotoandStop("0nOver");
else this.gotoAndStop("offOver");
}
mute.onRollOut=mute.onReleaseOutside=function()
{
if(this._currentframe==10) this.gotoandStop("on");
else this.gotoAndStop("off");
}

mute.onRelease=function()
{
if(this._currentframe==10)
{
this.gotoAndStop("offOver");
s.setVolume(0);
}
else
{
this.gotoAndStop("onOver");
s.setVolume(75);
}
}


Actionscript for Song.as

Code:

class Song
{
public var earl:String;
public var artist:String;
public var track:String;


public function Song(e:String, a:String, t:String)
{
  earl=e;
  artist=a;
  track=t;
}
}


XML "songs.xml"
Code:

<?xml version="1.0" encoding="iso-8859-1"?>
<songs>
<song url = "music/piano.mp3" artist="artist Name" track="Track Name"/>
<song url = "music/rain.mp3"artist="artist Name" track="Track Name"/>
<song url = "music/thievery.mp3"artist="artist Name" track="Track Name"/>
</songs>


Can you find what went wrong here?[/code]

View Replies !    View Related
Flash Media Player Tutorial?
im tryin to create a media player similar to this one
allhiphop media player im pretty good with basic flash but i just need to find a good turoial for my media player......any help would be appreciated thanks.

View Replies !    View Related
Flash Mp3 Player - Tutorial 1 Issue
Hi all.

I have followed the tutorial and found it very useful. However, after finishing the tutorial and testing my movie, I found that the tracks didnt play and I also got the following message in flash Cs3

Error opening URL 'file:///F|/mp3/undefined'

I figured that it was because of where everything was on my computer so uploaded it to my server and im still having the same problem. Could anyone shed some light on this for me ?

Cheers


Ash

View Replies !    View Related
Tutorial For Flash Mp3 Player That Uses Php And Mysql
Hi everyone, I'm Looking for a tutorial somewhere on the internet that descripes how to make a mp3 player in flash. But I want the player to communicate with mysql trough php.
I have quitte some knowledge of actionscript, php, mysql and html. But I can't figure this out myself.
Does anyone knows something that helps. A tutorial somewhere on the net will do.
Thanks!!

Game

View Replies !    View Related
Xml And Photogallery Tutorial - Works Fine For Flash Player 9 But Not 7
Hi

I've followed the tutorial called XML and dynamic photo gallery. Everything is working fine - except that the image isn't being shown unless I use Flash Player 9 to view it... I wonder is there something special about the loadMovie function?

I know for sure that I can't see the image in Flash 7... I've incorporated the tutorial into something I've done myself so it's hard to say whether it's because of masks, or instance sizes or what...

Thanks for any help,

G

View Replies !    View Related
Continuous MP3 Player - Based On MP3 Player Tutorial 2
A simple question but i CANT FIGURE IT OUT

so, with the first tutorial, the songs play continously throughout the list.

But the 2nd tutorial for the mp3player doesnt do that. It just stops playing after the first song.

is there anyway we can make it continous, playing all the songs in the list and still have the button controls on it?

View Replies !    View Related
Mp3 Player Tutorial
anyone know a good mp3 tutorial that would allow you to add the name of the song and skip functions?

View Replies !    View Related
MP3 Player Tutorial
I'm looking for a Flash tutorial which shows how to build a MP3 player with the following features:
Play, Stop, Pause buttons
Volume
Fast Forward, Rewind track
Jump to next/previous track
XML playlist

I've been searching but haven't found something that covers all of these features, if anyone knows of a tutorial that covers all these and would let me know where to find it I'd would be very greatful.

Thanks
Av4tarnz

View Replies !    View Related
Looking For An AS 3.0 MP3 Player Tutorial
I was wondering if any of you know of a good tutorial for building an OOP MP3 player in AS 3.0.

I used the Lee Brimelow MP3 tutorials a while ago which were great.

Is there anything else like that out there or any traditional style text tutorials? Or some code that I could look at?

I'm particularly interested in how the SoundChannel class works.

Thanks in advance for any help.

View Replies !    View Related
Mp3 Player Tutorial
i need an mp3 player for my flash movie that will load an mp3 and play it .... it should have a seperate preloader specifically for the mp3, or how to make the mp3 streaming. basically i have a decently sized sount loop and i don't want it to bog down the download for my whole site

ideas?

View Replies !    View Related
MP3 Player Tutorial
Hi. I am new to flash!!! My first site is for a small band, and a music player is needed. You know, the sort with play, stop buttons etc and can play around 16 tracks.

I am sitting through the tutorials right now and have just finished 'Flash MP3 Player Part 1'. Although I have my first wee problem - I am getting an output error - Error opening URL "file:///Root%20A/Users/bb/Desktop/organicaudio/undefined" I have followed the tutorial carefully. Is there something wrong with my mp3's?

View Replies !    View Related
Mp3 Player Tutorial As2 > As3
Hi i watched the mp3 player tutorials a few hours ago after getting a copy of flash cs3. It be as2 im looking to do this in as3 but im having the worlds most annoying time trying to do it.

ive got all the little bits working ... i think (not getting any more error mesages from them ) its just getting the xml into the array thats really not working for me.
ive spent about 4 hours now (no laughing!) and i think ive been through every tutorial on how to do it on the net. thought i had it with the kupia one but that didnt work for me either.

(all in the same folder)
XML - songs.xml
Code:

<songs>
<song url="song_of_time.mp3" />
<song url="follow_me_down.mp3" />
<song url="the_south.mp3" />
</songs>

AS - b.as
Code:

//sound object
var s:Sound = new Sound;
//s.soundComplete = playsong;
//s.setvolume(75);

//song array
var sa:Array = new Array();

//current song var
var cps:Number = -1;

var xmlString:URLRequest = new URLRequest("songs.xml");
var xmlLoader:URLLoader = new URLLoader(xmlString);
xmlLoader.addEventListener("complete", init);

function init(event:Event):void
{
   var xDoc:XMLDocument = new XMLDocument();
   xDoc.ignoreWhite = true;
   var songsXML:XML = XML(xmlLoader.data);
   xDoc.parseXML(songsXML.toXMLString());

   var nodes: Array = xDoc.firstChild.childNodes; 
   for(var i=0;i<nodes.length;i++)
   {
      sa.push(xDoc.firstChild.childNodes.attributes.(song); <<<<<<<<<<<<<<<<<<<<<<<<<<<<, this is the bit .... what the heck goes here
   }
    playsong();
}

function playsong():void
{
   if (cps == sa.length -1)
   {
      cps = 0;
      var request:URLRequest = new URLRequest(sa[cps]);
      s.load(request);
   } else
   {
      var request2:URLRequest = new URLRequest(sa[++cps]);
      s.load(request2);
   }
}


the bit with the "<<<<<<<<<<<<<<<<<<<<<<<<< what the heck goes here" is the main frustration at the moment.
( getting 1084 syntax errors on that line atm ... but im just trying anything possible there really )

any help would be amazingly appreciated ... think i might start whacking computer with blunt objects soon

View Replies !    View Related
FLV Player Or Tutorial
Hi,

I'm creating a fairly basic FLV player in flash. Is there any tutorials around about creating a preview image as the first frame, or when the movie is paused, dim the video etc.?

Any FLV video player tutorials with AS3 would be helpful.

Thanks in advance.

View Replies !    View Related
MP3 Player Tutorial
I followed this tutorial and it is awsome.

However I would like to have the song play continuously until the user changes it. How can I achieve this.

Also My MP3 Player is at and angle and when I angle my dynamic text it will not show the text, is this a bug? Is there a work around.

I know that this causes it to play the next song

Code:

else
   {
      s.loadSound(sa[++cps].earl, true);
   }



But if I change it or comment it out it won;t work at all


Thanks,

tmo

View Replies !    View Related
Mp3 Player Tutorial Help
I was wondering how I could make the song loop instead of stopping after it plays once. Below is the actionscript used to play the song on my site. Thanks for your help in advance.

Code:

// 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;

// Position of music
var pos:Number;

// 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(nodes[i].attributes.url);
   }
   playSong();
}

xml.load("songs.xml");

// Play the MP3 File
function playSong():Void
{
   s = new Sound();
   if(cps == sa.length - 1)
   {
      cps = 0;
      s.loadSound(sa[cps], true);
   }
   else
   {
      s.loadSound(sa[++cps], true);
   }
   playPause.gotoAndStop("pause");
}

// Pauses the music
function pauseIt():Void
{
   pos = s.position;
   s.stop();
}

// Pauses the music
function unPauseIt():Void
{
   s.start(pos/1000);
}

// Music Controls

// Play/Pause Toggle
playPause.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("pauseOver");
   else this.gotoAndStop("playOver");
}

playPause.onRollOut = playPause.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("pause");
   else this.gotoAndStop("play");
}

playPause.onRelease = function()
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("playOver");
      this._parent.pauseIt();
   }
   else
   {
      this.gotoAndStop("pauseOver");
      this._parent.unPauseIt();
   }
}

// Next Button
next.onRollOver = function()
{
   this.gotoAndStop("nextOver");
}

next.onRollOut = next.onReleaseOutside = function()
{
   this.gotoAndStop("next");
}

next.onRelease = function()
{
   this._parent.playSong();
}

View Replies !    View Related
Mp3 Player Tutorial For Mx 2004
I've seen a few that work for MX but none sofar that are for 2004, i need one with a stop start forward and back button. anyone have any links? thanks a ton.

View Replies !    View Related
Creating An Mp3 Player W/ Tutorial
I'm trying to create an mp3 player using this tutorial. I can't seem to make the music play - either automatically (which I'd like it to) or when the play button is pressed. If anyone can tell me what I'm doing wrong I would really appreciate it. Thanks!

Main Scene Functions:
Code:
function playa() {
if (playing!=true) {
mysound=new Sound();
if (url!="http://www.mskimmyd.com/myspace/music/Rogue%20Wave%20-%20Eyes.mp3") {
mysound.loadSound(url+"http://www.mskimmyd.com/myspace/music/Rogue%20Wave%20-%20Eyes.mp3", false);
mysound.start((_root.pos)/1000,1);
if (mysound.duration!=0) {
playing=true;
}
} else {
}
}
}

function stopa() {
_root.pos=0;
mysound.stop();
playing=false;
}

function pause() {
if (playing) {
_root.pos=mysound.position;
mysound.stop();
playing=false;
}
}
Play Button Functions:
Code:

on (press) {
playa();
}

View Replies !    View Related
[F8] Video Player Tutorial
Hi all,

I'm looking for a flash video player tutorial / open source .fla file with simple features e.g. buffering progress, play/pause, stop & scollbar.

I also need to be able to dynamically load the video file either using a GET method from the address bar or by using PHP to change the parameters of the flash file inside the source code of the file.

Thanks in advance

Max

View Replies !    View Related
Music Player Tutorial
Hey, i was wondering how to make a music player, like for a website.

this is a bit of a request, but i think itd be cool if someone made a Music Player Tutorial, to help ppl like me out.


its just a sugestion though, ill look other places as well...

View Replies !    View Related
Would Anyone Like An Easy Mp3 Player Tutorial?
Hey guys,
im just finishing up on an mp3 player i am making in flash and am wondering whether or not i should make a tutorial. First up ill explain a bit about it.

It has these features;
Changeable balance w/ display of the current amount of balance to each side
Multiple songs
Play/Pause with one button
Stop
Song Name
Song Status
Changeable volume
Song duration display
Previous Button
Next Button
Current duration
Volume display as percentage
Image Display of current volume w/ volume status such as Mute, Normal etc..
Repeat

If you think i should make a tutorial for this, please post up here..

Please note, that if, and i probably will write a tutorial it may NOT be the only way to do these effects, though it is an easy way.
Also, using this method is only recommended for personal use, unless, you externally load your sounds.

Both of these are very possible, so i wouldn't let that affect you opinion too much

View Replies !    View Related
Music Player Tutorial, Has Anyone Done This?
http://www.pixel2life.com/publish/tu...er_using_xml_/

(the source file can be downloaded there too)

Im trying to put this inside a movie clip, but when i do, the track names dont display? any ideas?

Cheers.

View Replies !    View Related
Looking For A Good Mp3 Player Tutorial Or Example
I would like to create an mp3 player but my history with flash has almost no audio experience. Can anyone point me to a useful tutorial or example to work from?

The flash player needs load mp3's dynamically via .txt or xml and use the ID3 info to get the necessary information: artist, title, etc. I need the basic functionality of an mp3 player: play, stop, pause, fast forward, rewind, next/previous track, and would like it to have the option of playing continuously (like a playlist) except instead of selecting a group of songs to play, just start from the first selected mp3 then continue through the txt or xml list.

Any help would be great!
Thanks

View Replies !    View Related
Mp3 Player Tutorial Problem
Hello, thanks for the tutorials here and making them available. They are really helpful.

I followed the instructions as told and when I go to preview my mp3player this is what happens:

It plays the song(s) as it should however,the buttons don't seem to be working properly. Neither of them change on rollover and the Next button just roll's over on it own continuously. Here is a ss of the actions:


I appreciate any help you can offer!

View Replies !    View Related
Mp3 Player Tutorial Question
I successfully built the mp3 player from the tutorials. It works perfectly in a .swf player and when it's compiled in Flash, but the moment I try to play it in a browser... it doesn't connect. The textfield says undefined.
Being unknowledgeable of Flash, I have no idea why it can't connect to the files when it's being viewed from a browser.

Any ideas? Need to see the files? http://clay.bellmor.com/testsite/player

Also! Opening the player.swf file in Safari and FF doesn't work, but opening the player folder and then clicking on the .swf works properly...

I'm 'guessing' there's something wrong with the class setting, maybe it doesn't know where to look...

Any help would be great!

-Clayton

View Replies !    View Related
AS2 - AS3 Trying To Convert Mp3 Player Tutorial
Im just starting the transition from AS1-2 to AS3. I decided to change the mp3 player tutorials to AS3 and this is what I have so far:

Code:

// ActionScript Document
package {
   import flash.display.MovieClip;
   import flash.text.TextField;
   import flash.text.TextFormat;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.media.Sound;
   import flash.media.SoundChannel;
   import flash.net.URLRequest;
   import flash.net.URLLoader;
   import flash.xml.XMLDocument;
   import flash.events.ErrorEvent;

   public class mp3Player extends MovieClip {
   
      // Setup sound object
      private var s:Sound;
      
      // Array of songs
      private var sa:Array;
      
      // Currently playing song
      private var cps:Number;
      
      // Position of music
      private var pos:Number;
      
      // Load the songs XML
      public var xml:XML;
   }
   
   public function mp3Player()
   {
      playPause.addEventListener(MouseEvent.ROLL_OVER, playPauseOver);
      playPause.addEventListener(MouseEvent.ROLL_OUT, playPauseOut);
      playPause.addEventListener(MouseEvent.MOUSE_UP, playPauseUp);
      next.addEventListener(MouseEvent.ROLL_OVER, nextOver);
      next.addEventListener(MouseEvent.ROLL_OUT, nextOut);
      next.addEventListener(MouseEvent.MOUSE_UP, nextUp);
      mute.addEventListener(MouseEvent.ROLL_OVER, muteOver);
      mute.addEventListener(MouseEvent.ROLL_OUT, muteOut);
      mute.addEventListener(MouseEvent.MOUSE_UP, muteUp);
      s = new Sound();
      s.onSoundComplete = playSong;
      s.setVolume(75);
      
      sa = new Array();
      
      cps = -1;
      
      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("songs.xml");
   }
   // Play the MP3 File
   public function playSong():Void
   {
      s = new Sound();
      s.onSoundComplete = playSong;
      s.setVolume(75);
      mute.gotoAndStop('on');
      if(cps == sa.length - 1)
      {
         cps = 0;
         s.loadSound(sa[cps].link, true);
      }
      else
      {
         s.loadSound(sa[++cps].link, true);
      }
      trackInfo.text = sa[cps].artist + ' - ' + sa[cps].track;
      playPause.gotoAndStop("pause");
   }
   
   // Pauses the music
   public function pauseIt():Void
   {
      pos = s.position;
      s.stop();
   }
   
   // Pauses the music
   public function unPauseIt():Void
   {
      s.start(pos/1000);
   }
   
   // Music Controls
   
   // Play/Pause Toggle
   public function playPauseOver(event):Void
   {
      if(this._currentframe == 1) this.gotoAndStop("pauseOver");
      else this.gotoAndStop("playOver");
   }
   
   public function playPauseOut(event):Void
   {
      if(this._currentframe == 10) this.gotoAndStop("pause");
      else this.gotoAndStop("play");
   }
   
   public function playPauseUp(event):Void
   {
      if(this._currentframe == 10)
      {
         this.gotoAndStop("playOver");
         this._parent.pauseIt();
      }
      else
      {
         this.gotoAndStop("pauseOver");
         this._parent.unPauseIt();
      }
   }
   
   // Next Button
   public function nextOver(event):Void
   {
      this.gotoAndStop("nextOver");
   }
   
   public function nextOut(event):Void
   {
      this.gotoAndStop("next");
   }
   
   public function nextUp(event):Void
   {
      this._parent.playSong();
   }
   
   // Mute Button
   public function muteOver(event):Void
   {
      if(this._currentframe == 1) this.gotoAndStop("onOver");
      else this.gotoAndStop("offOver");
   }
   
   public function muteOut(event):Void
   {
      if(this._currentframe == 10) this.gotoAndStop("on");
      else this.gotoAndStop("off");
   }
   
   public function muteUp(event):Void
   {
      if(this._currentframe == 10)
      {
         this.gotoAndStop("offOver");
         s.setVolume(0);
      }
      else
      {
         this.gotoAndStop("onOver");
         s.setVolume(75);
      }
   }
}

Does anybody know what Im doing wrong?

Im getting the following compilation erros:
1021: Duplicate function definition. public function mp3Player() - mp3Player.as line 33
5000: The class 'mp3Player' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type. - mp3Player.as line 1

I have read the forums and have seen tibi's excellent AS3 player, however I wish to know what it is Im not understanding about AS3.

View Replies !    View Related
Lee's Mp3 Player Tutorial Question...
hi all!

i'm following lee's mp3 player tutorial and am just starting with the action script and xml file. i downloaded the sepy action script editor but as i'm watching the video i see windows opening up as he is typing certain letters (var, etc)...this isn't happening with me...???

is something wrong? i'm typing exactly what he is. how do i get this to do this?

sorry if this is a dopish question...but hey, i'm a dope! :P

View Replies !    View Related
The MP3 Player Tutorial... Issues
Hi!

Well, I've had some issues with the MP3 player tutorial. To make a long story short, I finally got all the errors to go away, but my songs never played at any stage of the process, and neither of the buttons actually work, i.e., you can't click on them or anything.

I'm using Flash MX 2004 Professional. I wrote the XML code in Dreamweaver MX 2004 and the ActionScript code in Flash. The songs are all in the same directory as everything else. I am baffled. My codes are below. Any help would be greatly appreciated.

Thanks!
Charity

Code:

//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;

//Position of music
var pos:Number = Math.round(the_sound.position/the_sound.duration*100);

// 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(nodes[i].attributes.url)
   }
}

xml.load("songs.xml");

//Play the MP3 file
function playSong():Void
{
   s = new Sound();
   if(cps ==sa.length - 1)
   {
      cps=0;
      s.loadSound(sa[cps], true);
   }
   else
   {
      s.loadSound(sa[++cps], true);
   }
   playPause.gotoAndStop("pause");
}

//Pauses the music
function pauseIt():Void
{
   pos = s.position;
   s.stop();
}

//Pauses the music
function unPauseIt():Void
{
   s.start(pos/1000);
}

//Music controls

//Play-Pause toggle
playPause.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("pauseOver");
   else this.gotoAndStop("playOver");
}

playPause.onRollOut = playPause.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("pause");
   else this.gotoAndStop("play");
}

playPause.onRelease = function();
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("playOver");
      this._parent.pauseIt();
   }
   else
   {
      this.gotoAndStop("pauseOver");
      this._parent.unPauseIt();

//Next Button
next.onRollOver = function()
{
   this.gotoAndStop("nextOver");
}

next.onRollOut = next.onReleaseOutside = function()
{
   this.gotoAndStop("next");
}

next.onRelease = function()
{
   this._parent.playSong();
}

   }

This bit:

Code:

//Position of music
var pos:Number = Math.round(the_sound.position/the_sound.duration*100);

I had to put that = Math.round... etc part because I was getting truckloads of errors without it.

Here is the XML file:

Code:

<?xml version="1.0" encoding="iso-8859-1"?>
<songs>
  <song url="RidingTheBell.mp3"></song>
  <song url="IHadTooMuchToDreamLastNight.mp3"></song>
  <song url="WickedWays.mp3"></song>
  <song url="SoulOfTheSea.mp3"></song>
  <song url="MovinOn.mp3"></song>
  <song url="PissYouOff.mp3"></song>
  <song url="BlameItOnTheMoonlight.mp3"></song>
  <song url="LoveLoveLove.mp3"></song>
  <song url="YouAreSoInLoveWithYourself.mp3"></song>
  <song url="DownToYou.mp3"></song>
  <song url="HushNow.mp3"></song>
</songs>

View Replies !    View Related
FLV Video Player Tutorial
Hey there!

Can someone post the entire AS for the Video Player Tutorials so that I can check mine! For some reason my 'scrubber' is able to be place anywhere on the stage. I'm sure I've done something wrong....but typing as fast as Lee goes through it is proving to be a little difficult!

Thanks in advance!

3B

View Replies !    View Related
Tutorial To Create Mp3 Player Without Xml Playlist
I have browsed the web for a flash mp3 player but all I have found either play just one file per player or use a playlist generated from an xml file.

I can`t use an xml file as the mp3's will be called from a database, does anyone know of an mp3 player that can call the mp3's from a database or know of any tutorials that will help me make something?

btw I am a complete flash newbie

thanks

View Replies !    View Related
Looking For A Tutorial For A SIMPLE .xml-driven .mp3 Player (see Example)
Hi all,

I'm looking for a tutorial for a SIMPLE .mp3 player (presumably XML-driven) that will play through a list of songs that can be skipped, and will loop back to the first song upon completion. I was also hoping for a loading bar and for it to read the ID3 tags for the title.

Can anyone help? Attached is an example I knocked up that shows what features I need...

thanks in advance,

Jif Moose

View Replies !    View Related
Mp3 Player Tutorial - Major Failure
I've done a bunch of flash, but my actionscript experience is limited. I've coded lots of things in other languages though, so I figured I could handle it with a tutorial... I breezed through it, no problems, and went all the way through tutorial part 2, and then went to test movie. I immediately was shocked because the buttons were systematically changing from Over to Normal state at some time interval. I did all the code exactly like in the tutorial (aside from a few comments) and followed the other instructions as well as I could. I thought perhaps that it was because I didn't have a stop(); at every point in the buttons, but that didn't help either. I also had omitted the "hit" layer, so I went back and did that. No help. Anybody got a clue? I'll upload the FLA if you'd like..

Also, the thing was telling me I had syntax errors with '#include "ifplayer.as" ' (but it was still executing it - I tried just pasting the AS code in there instead too), which was rather puzzling, as the syntax was identical to that in the tutorial. One thing perhaps worth mentioning is that the tutorial used Flash Pro 8 while I'm on CS3. I also used the actionscript 3 thing in "file->new".. could this be the problem? AFAIK though the changes shouldn't affect this. I wanted to finish this project (I'm tying a python CGI set in with this to generate playlists) tonight, but it doesn't look like it'll happen

I was trying to make myself useful, so I started browsing the threads and found the files section. I tried popping the original as file in, and it still does it, which means there's no problem with my code. I'm gonna continue comparing the two.

Ok I've read through both of them, and aside from tiny differences (like i chose to put a partial circle around my buttons on Over instead of recoloring, etc.) they are absolutely identical. The only difference is i chose AS3 instead of AS2, so that must be it. How can I revert my project to AS2? I know you can publish it different, am i forced to that? Maybe I'll just work from the example file since it was at the same point and just change what was different between them...

View Replies !    View Related
Controlling Volume (MP3 Player Tutorial)
Hi. I've completed Lee's MP3 player tutorial. I've also loaded the MP3 player clip into my main swf movie with the code:

loader_mc.loadMovie("mp3Player.swf");

The mp3 player now sits at the bottom of my movie and continously plays, ust like I want.

This is where my problem comes up. I have a button called "video", that loads a file called "video.swf" into my main .swf file and a flv video plays. My MP3 player is still sitting at the bottom of my movie (as I want it to), but the sound of the mp3 that is playing plays over the sound from the flv. I want to be able to "mute" the mp3 player when the user clicks the "video" button. How do I access the mp3 player from the main.swf via actionscript?

I know I need to do something like s.setVolume(0); , but I know that code won't work since the video button is not in the mp3player.swf file, but is in the main.swf file.

Thanks for any suggestions. :?:

View Replies !    View Related
Flashkit Tutorial Sound Player Wohs
can anyone get this to work with Firefox (you need to download it first).. its a right pest

http://www.flashkit.com/movies/Sound...8270/index.php

thanks for checking

View Replies !    View Related
Video Player & XML Playlist Tutorial Advice
Hi,

I visited this site yesterday and I must start by saying I have learnt a great deal from the clear and concise tutorials for the video and XML Playlist. I used Flash a few years ago and haven't touched it since so thanks for the help with the excellent tutorials.

I am trying to make a multimedia player.

I ahve created the video and playlist using the tutorials and it works great.

But is there a way in which I can add images and sounds to appear within the XML PLaylist so the user can select them.
I was hoping for the image to load (or the sound to play) within the video player?

I don't know if this is possible.

I am thinking that I will have to create a XML Playlist for the Images, and another for the sounds? - But I may be barking up the worng tree??

Can anyone please advise on which is the best way to go about this problem.

Thanks

View Replies !    View Related
Lee's Mp3 Player Tutorial With MySQL And PHP Undefined Error
Hi I have followed the tutorial and added a few extras (as found in this very forum) and everything works fine.

However I would like to retrieve the xml document information from MySQL so I created a songs.php page to fetch this info and place it in a while loop.

This is working just fine (I can view the source and see that it is fetching the db entries )
Unfortunately The mp3 player will not work now and it just prints 'undefined'.
I am guessing it's an error with the action script. Can anyone point out where I am going wrong ?

actionscroipt
Code:

// 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;

// Position of music
var pos:Number;

// 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.track));
   }
   playSong();
}

xml.load("songs.php");

// Play the MP3 File
function playSong():Void
{
   s = new Sound();
   s.onSoundComplete = playSong;
   s.setVolume(75);
   mute.gotoAndStop("on");
   if(cps == sa.length - 1)
   {
      cps = 0;
      s.loadSound(sa[cps].earl, true);
   }
   else
   {
      s.loadSound(sa[++cps].earl, true);
   }
   trackInfo.text = sa[cps].track;
   playPause.gotoAndStop("pause");
   textPos = 0;
}

//Play the previous MP3 file
function prevSong():Void {
   s = new Sound();
   s.onSoundComplete = playSong;
   if (cps == 0) {
   cps = sa.length-1;
   s.loadSound(sa[cps].earl, true);
   } else {
   s.loadSound(sa[--cps].earl, true);
   }
   trackInfo.text = sa[cps].track;
   playPause.gotoAndStop("pause");
}

// Pauses the music
function pauseIt():Void
{
   pos = s.position;
   s.stop();
}

// Pauses the music
function unPauseIt():Void
{
   s.start(pos/1000);
}

// Music Controls

// Play/Pause Toggle
playPause.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("pauseOver");
   else this.gotoAndStop("playOver");
}

playPause.onRollOut = playPause.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("pause");
   else this.gotoAndStop("play");
}

playPause.onRelease = function()
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("playOver");
      this._parent.pauseIt();
   }
   else
   {
      this.gotoAndStop("pauseOver");
      this._parent.unPauseIt();
   }
}

// Next Button
next.onRollOver = function()
{
   this.gotoAndStop("nextOver");
}

next.onRollOut = next.onReleaseOutside = function()
{
   this.gotoAndStop("next");
}

next.onRelease = function()
{
   this._parent.playSong();
}

// prev Button
prev.onRollOver = function() {
   this.gotoAndStop("prevOver");
};
prev.onRollOut = next.onReleaseOutside=function () {
   this.gotoAndStop("prev");
};
prev.onRelease = function() {
   if (Math.round(s.position)/1000>1) {
      s.start();
   } else {
      this._parent.prevSong();
      this._parent.unPauseIt();
      playpause.gotoAndStop("pause");
   }
};

//Volume
volScrub._xscale = 75;
volPercent.text = volScrub._xscale+"%";
volBotton.onPress = function() {
   adjustSound();
   this.onMouseMove = adjustSound;
};
volBotton.onRelease = volBotton.onReleaseOutside=function () {
   delete this.onMouseMove;
};
function adjustSound() {
   var dist:Number = ((_root._xmouse-volBotton._x)/volBotton._width)*100;
   if (dist>=0 && dist<=100) {
      volScrub._xscale = dist;
      s.setVolume(dist);
      volPercent.text = Math.round(volScrub._xscale)+"%";
   //scroll text as well 
  //    volPercent._x = Math.round(_root._xmouse);
   }
}

// Mute Button
mute.onRollOver = function()
{
   if(this._currentframe == 1) this.gotoAndStop("onOver");
   else this.gotoAndStop("offOver");
}

mute.onRollOut = mute.onReleaseOutside = function()
{
   if(this._currentframe == 10) this.gotoAndStop("on");
   else this.gotoAndStop("off");
}

mute.onRelease = function()
{
   if(this._currentframe == 10)
   {
      this.gotoAndStop("offOver");
      s.setVolume(0);
   }
   else
   {
      this.gotoAndStop("onOver");
      s.setVolume(75);
   }
}


Songs as
Code:

class Song
{
   public var earl:String;
   public var track:String;
   
   public function Song(e:String, t:String)
   {
      earl = e;
      track = t;
   }
}


And here is my song.php (but I am pretty sure thats all fine)
Code:

<?php


require ('inc/conn.php');

//connect to DB

$dbcnx = @mysql_connect($hostname,$username,$password);
$dbselect = @mysql_select_db($database);
if ((!$dbcnx) || (!$dbselect)) { echo "Can't connect to database"; }


// next, query for a list of titles, files and links.
$query = "SELECT * FROM PhPlayer";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());


//build the results as an xml array
echo "<?xml version="1.0" encoding="UTF-8" ?>
";


echo "<songs>
";


while($row = @mysql_fetch_array($result)) {
?>
<song url="<?php echo $row['file']; ?>" artist="Navigating Crowds" track="<?php echo $row['song']; ?>"/>
<?php
}


echo "</songs>
";



?>


Any Ideas ?[/quote]

View Replies !    View Related
Mp3 Player Questions (based On GotoAndLearn Tutorial)
Good-day men,

first of all, compliments for your tutorials.. they are great!

I have some "stupid" questions, if you wanna help me:

- how can I start the player from the position "pause" (so without playing a song when I open the flash) (and so with the button in position "play")

- I would like to add the button "previous track".. what code I need to create into the "mp3player.as"? (I think the button is the same of next but with "negative image" and with different names..)

- for a button like "stop" what I have to do? (a button with a simple action like: stop(); or stopAllSounds(); ?) (I've tried but without success...)

thanks to peolple will help me!

View Replies !    View Related
MP3 Player Tutorial Works But I Need To Jump Frames Playing
OK this is what im trying to do. I have a class I made that plays through a mp3 file.
I have made my navigation on the bottom and got that working correctly.

What I need to do is have when the track is playing have it transition through frames, but I need to be able to setup those transitions. I know it is probably a goto, im pretty lost. Does this have to be a different scene? a movie clip? how should i do this.

HOW DO I DO THIS?? I need a tutorial desperately.

I tried doing this though a text scroller. I have the scroller working but its manual, and cheesy it loads text from a .txt file and prints it out to the screen. I want the text to scroll automatically down, depending on what time my audio is set at.

IS THERE AN EASIER WAY TO GO ABOUT THIS????

I can cut my 30 minute class into sections so they change though like 10, 3 minute sections, if that makes it easier.


Even something like adding a code to displays a jpg picture that has my class frame in it, but i really want to keep it as a flash variable so i can use tweens and things on it, something like show text after x amount of seconds, once shown y amount of seconds


Overall, I desperately need to get this working, by no means am I a flash expert but I have done C++ and html and php coding on and off so I have an understanding of oop.

View Replies !    View Related
Custom Video Player By GotoAndLearn Tutorial - Problems
Hey guys,

first: sorry for my bad english knowledge, hope you are able to understand me

Okay, i did the Video Basic Tutorials and the XML Playlist, because this was a chance to insert more than one videos. Altouhgh, i customized the skin of the Videoplayer.

When i'm finished, the videoplayer shoud look like this:


Okay, so i took the functions shown in the tutorial. So i've got an XML-Playlist, play/pause button, replay button, mute button.

But as you see in the screenshot there should be some more

First of all i want to stop the "Autoplay-system" and "Autoreplay-System". I want to show the preview-picture and if i klick on "play" i want the TV to start. If one video is finished, there should be the "screenshot" again.

Screenshots -> Because i want to use the player with a lot of movies, i want to write down screenshots next to the videourl (XML Datei), something like this
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<videos>
<video url="videos/rundengewinner08.flv" desc="Giga Homepage Award Runde 8" thumb="preview.jpg" />
</videos>

Than there are some "Arrowkeys" like this », so i want to switch between the screenshots to choose your video. Because i want this as "navigation", i don't need the Playlist next to the player (if i delete the layer i cannot use the player anymore).

Third: I would love the "minutes"-display (shown on the screenshot).

As faar as good... my problem is: I've got no knowledge about Flash/Actionscripts, so please explain "step by step". If there is someone who says "thats easy" i would give him the files (if it is easilier)

You can download the files from the tutorial at this link

I just eddited the Layout, nothing by the code


Thanks,

mr92

View Replies !    View Related
Flash Player Installed, But Every Site Flash Player Required For Asks To Install Not Working At All
Hi all, wondering if someone would be kind enough to help me, PLEASE lol
Flash player asks to be installed everytime I go onto any site that requires it, I have installed it, it advises it has been sucessfully installed but when I go back to the page it asks again! Have had this problem for ages and have tried eveything I can think of! at witts end and customer service wont help as its a free product.
Any help would be greatfully appreciated.
Sarah ;-)

View Replies !    View Related
Flash Player 6 Code Doesn't Work In Flash Player 7 Or Grater
Hi flashers,

I think some of you know this page http://www.levitated.net
There you can download open source scripts that are quite cool. When I publish on of those codes with the flash player 7 or grater, they doesn't work anymore. Does anyone know why?

thanks
-Tukinu

View Replies !    View Related
Tutorial For Making A Flash Tutorial
I would like to find a tutorial on how to make a Flash Tutorial like this one or something similar.

Any help would be greatly appreciated!

View Replies !    View Related
Firefox Recognizes Quicktime As Flash Player Instead Of Flash As Flash Player
I don't know why when I go to websites and all those old Flash sites don't work anymore, but I get the "Quicktime Question Mark" logo. I've tried reinstalling Flash Player so many times but the quicktime logo keeps coming up. I've tried this both with Firefox and Safari and it just doesn't work.

View Replies !    View Related
If A Movie Is Made For Flash Player 6, Will It Work On Flash Player 5?
I doubt this, but I made an web application using MX features and some of my users use solaris/linux/other strange OS and there is no Flash Player 6 for it. Do I have no choice but to stop using Flash MX features?

View Replies !    View Related
Old Version Of Flash Player And Location Of Flash Player In The Computer?
Hello forum!

I want to test the update process of my site but already have the latest version of flash player. So I have two problems:

-the first one is that I can't find older versions (fp6 or fp7) on the internet

-the other one is that (don't smile) I can't manage to uninstall the latest version of flash player from my computer! I unistalled all flash player programs in the control panel of windows XP, I don't find flash player in the "program files" folder, however flash player is always working!!

View Replies !    View Related
Code Works For Flash Player 6 Settings But Not For Flash Player 8...
Hi,

I'm pretty new to Action script and I have a problem here that I can't seem to figure out.

I have this Action Script Code which is attached to a simple movieclip, and it all works IF the general settings are set for Flash Player 6.

It does not work for Flash Player 7 or above, which is probably because this is Actions Script 1 Code...

I attached the .fla file and also here's the code:


Code:
onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
Do I need to change the code ?

I wanna publish in Action Script 2 for either Flash player 8 or 9.

Thanx for your help in advance !!!

Mike

View Replies !    View Related
Tsunami Works Fine With Flash 5 Player But Not With Flash 6 Player
I downloaded this tsunami from a user on this forum. It works fine when I publish it in Flash 5 player format, but NOT when I publish it in Flash 6 player format.

Can anybody tell me which part of the actionscript needs modified?

Thanks.

Ian

View Replies !    View Related
Code Works For Flash Player 6 Settings But Not For Flash Player 8...
Hi,

I'm pretty new to Action script and I have a problem here that I can't seem to figure out.

I have this Action Script Code which is attached to a simple movieclip, and it all works IF the general settings are set for Flash Player 6.

It does not work for Flash Player 7 or above, which is probably because this is Actions Script 1 Code...

I attached the .fla file and also here's the code:


Code:
onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
Do I need to change the code ?

I wanna publish in Action Script 2 for either Flash player 8 or 9.

Thanx for your help in advance !!!

Mike

View Replies !    View Related
Publishing In Flash Player 6 Works. Flash Player 8 Doesn't.
I'm building a small quiz application in Flash 8. I started out targeting Flash Player 6 but have now decided that I need some of the features only available in Flash 8. When I try publishing to Flash 8 I get some weird behavior.

There aren't any AS errors, but where the application worked fine for Flash 6, now it gets stuck in a loop and never actually loads.

I've tried both Actionscript 1.0 and 2.0 as I'm pretty much just working in 1.0 on this project, and neither works in Flash 8.

Are there any known issues between version 6 and 8 that might cause something like this? I read on another forum that not initializing a numeric value that you're incrementing can cause this issue, but I've checked that and all my variables are being initialized to a value first.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved