Flash Mp3player Not Working
Hi!I've just finished the mp3player tutorial, and it works perfect when I run it local on my computer, but when I upload it on my server , the trackinfo field shows "undefined - undefined".can somebody help me?Thanks =)mp3player.asCode: var s:Sound = new Sound();s.onSoundComplete = playSong;s.setVolume(75);var sa:Array = new Array();var cps:Number = -1;var pos:Number;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");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].artist+' - '+sa[cps].track; playPause.gotoAndStop('pause');}function pauselt():Void { pos = s.position; s.stop();}function unPauselt():Void { s.start(pos/1000);}playPause.onRollOver = function() { if (this._currentframe == 1) { this.gotoAndStop('pauseOver'); } if (this._currentframe == 20) { this.gotoAndStop('playOver'); }};playPause.onRollOut = playPause.onReleaseOutside=function () { if (this._currentframe == 10) { this.gotoAndStop('pause'); } if (this._currentframe == 30) { this.gotoAndStop('play'); }};playPause.onRelease = function() { if (this._currentframe == 10) { this.gotoAndStop('playOver'); this._parent.pauselt(); } else { this.gotoAndStop('pauseOver'); this._parent.unPauselt(); }};next.onRollOver = function() { this.gotoAndStop('nextOver');};next.onRollOut = next.onReleaseOutside=function () { this.gotoAndStop('next');};next.onRelease = function() { this._parent.playSong();};mute.onRollOver = function() { if (this._currentframe == 1) { this.gotoAndStop('onOver'); } if (this._currentframe == 20) { this.gotoAndStop('offOver'); }};mute.onRollOut = mute.onReleaseOutside=function () { if (this._currentframe == 10) { this.gotoAndStop('on'); } if (this._currentframe == 30) { this.gotoAndStop('off'); }};mute.onRelease = function() { if (this._currentframe == 10) { this.gotoAndStop('offOver'); s.setVolume(0); } else { this.gotoAndStop('onOver'); s.setVolume(75); }};songs.xmlCode: <?xml version='1.0' encoding='UTF-8'?><songs><song url='song.mp3' artist='Artist1' track='Track1' /><song url='song2.mp3' artist='Artist2' track='Track2' /></songs>Song.asCode: 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; }}
General Flash
Posted on: Fri Jun 22, 2007 11:38 am
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Mp3Player
Hi I am trying to build a mp3 player in flash. I have been following a tuturial using a flash.fla file, writing the code in a flash.as file, and i wrote some more code containing the sonds in an xml file. Unfortunatly this does not seem to work when i load it. Do I have to link the .as file with the .fla file? all I have done is on an actions layer, I put #include "mp3Player.as"
I have been through all the code 3 times and it just does not work for me' an error pops up saying
Error opening URL "file:///Macintosh%20HD/Users/rlewis/Desktop/mp3player/tracks/1.mp3"
any help on this would be great
cheers
ohio
Mp3player Xml Flash
Hello flash people,
first of all, great site. I am new here. Thanks for all the great tutorials guys.
I am learning xml with flash now. I was reading an article about how to make an mp3player using xml together with flash.
http://www.kirupa.com/web/xml/examples/MP3playlist.htm
Very nice and usefull tutorial.
It works fine, but there are little things I want to change.
1: The player must start the song when entering the website so that the list can be removed.
2: When someone presses the next button the next song has to star immediately(hope i write this right ).
I am not that good in actionscript so maybe someone has some time to help me or someone with the same problems can help me?!
Thanks again for helping.
Greets,
Rulywaka
Flash Mp3Player
when u run a flash player (Flash/PHP or Flash only) on the net. and if u have a Download Software (GetRight,DP...) .. when mp3 file going to load in flash ,DL Software get it a dowload file and start to download it and Mp3Player Going down.
what can i do to solve this Problem (BUG) ???
Please help me ... TNX
Flash Mp3Player Part 2 TUTORIAL ...
I dont have much experience with AS, just a very basic understanding of how some of it works. With regard to this tutorial, the AS is setup so the first song starts playing automatically, but I'd like to have it so the user has to press the PLay button for the music to start.
My attempts at editing the AS to achieve this end up compromising the Pause/PauseIt functions from working, or no music at all. It's the principle/logic that I seem to be struggling with here.
I tried to work the 'playSong' function into the playPause=onRelease section, as well as some other things I'd rather not mention.
Any help would be greatly appreciated.
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
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 Music
function pauseIt():Void
{
pos=s.position;
s.stop();
}
//unPauses 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();
}
Flash Mp3Player Tutorial - Part 3 Actionscript Error
Hi,
First of all thanks to nebutch & yarcub for their halp on my last problem.
I have followed the video tutorial to get the song information to display through the dynamic text area but when I play the swf file I keep getting the same error. All I have done is added a year attribute to the xml file so that the year of the track may be displayed aswell. Can somebody please point out where I am going wrong again.
(ps; I am a newbie to all this coding!)
The error that comes up is below;
----------------------------------------------------------------------------------------------
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 2: ActionScript 2.0 class scripts may only define class or interface constructs.
{
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 3: Attribute used outside class.
public var earl:String;
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 4: Attribute used outside class.
public var artist:String;
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 5: Attribute used outside class.
public var track:String;
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 6: Attribute used outside class.
public var year:String;
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 8: Attribute used outside class.
public function Song(e:String, a:String, t:String, y:String)
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Player
ot working gotolearn.comSong.as: Line 15: ActionScript 2.0 class scripts may only define class or interface constructs.
}
Total ActionScript Errors: 7 Reported Errors: 7
Error opening URL "file:///D|/OFSYSTEMS/OFSYSTEMS%20WEB%20DESIGN/mp3Player/not%20working%20gotolearn.com/undefined"
---------------------------------------------------------------------------------
below is the actionscript for mp3Player.as:
// 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, nodes[i].attributes.year));
}
playSong();
}
xml.load("songs.xml");
//Play the mp3 player 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);
}
playPause.gotoAndStop('pause');
}
//Pauses the music
function pauselt():Void
{
pos = s.position;
s.stop();
}
//unPauses the music
function unPauselt():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.pauselt();
}
else
{
this.gotoAndStop('pauseOver');
this._parent.unPauselt();
}
}
//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('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);
}
}
---------------------------------------------------------------------------------------------------
Below is the actionscript for Song.as
classSong
{
public var earl:String;
public var artist:String;
public var track:String;
public var year:String;
public function Song(e:String, a:String, t:String, y:String)
{
earl = e;
artist = a;
track = t;
year = y;
}
}
Again your assistance is needed!!!
Flash Mp3Player Tutorial - Part 1 Actionscript Error
Hi,
I have followed the video tutorial to create a flash mp3 player but when I play the swf file I keep getting the same error with the .as file. Can somebody please point out where I am going wrong
The error that comes up is below;
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Playermp3Player.as: Line 19: Unexpected '}' encountered
}
**Error** D:OFSYSTEMSOFSYSTEMS WEB DESIGNmp3Playermp3Player.as: Line 23: Unexpected '}' encountered
}
Total ActionScript Errors: 2 Reported Errors: 2
Below is the script I have entered for the .as file
// 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 player file
function playSong():Void
{
if(cps == sa.length - 1)
{
cps = 0;
s.loadSound(sa[cps], true;
}
else
{
s.loadSound(sa[++cps], true);
}
}
Your assistance is needed!!!
Mp3player
I was looking to re-create something along the lines of this:
http://musicplayer.sourceforge.net/xspf_player_slim.swf
and I was wondering if anybody knew if there were any tutorials on how to make a playlist mp3 player. I'll take any tutorial/advice/.fla I can get.
[as]MP3Player With Xml Error.
Im having an error with my as that im writing. its for an MP3Player and in flash it says "A type identifier is need after the ':'/ function playSong():Void"
Heres the 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 MP3file
function playSong():Void
{
if(cps==sa.length-1)
{
cps=0;
s.loadSound(sa[cps],true);
}
else
{
s.loadSound(sa[++cps],true);
}
}
<mod edit> ALWAYS post your question only once while here at FK, as per the rules. Thanks in advance - gerbick (supermod)
Help Requested With ActionScript In MP3Player FLA
Hi All,
I have attached the Cleo2 MP3 player, written in Flash 5 by Den Ivanov, that uses Actionscript and an XML file.
I have also attached 5 very short sample songs (2 seconds each).
I am having a challenge. The default setting for the player is on track repeat ( _parent.repeat="track"; )
I would like for the default setting to be ( _parent.repeat="all" ;)
When I manually set that value to "all", the player picks songs randomly and not in order (1,2,3,4 etc)
Also is there a way to get the repeat to play (1,2,3,4,5...1,2,3,4,5 as opposed to 1,2,3,4,5...4,3,2,1?
Thank you.
You will find most of the actionscript in the MC controler (controller) via Movie Explorer.
How To Add A Loop Feature To Mp3Player.
I have an MP3Player where I want the user to be able to loop the music with a toggle button. I am confident in making the button (kind of)
however I am lost on making the music loop.
Here is the code I am using for the player...
PHP Code:
//--------------------------------------------------------------------------
_root.playlist == undefined ? playlist = "mp3player-loops.xml" : playlist=_root.playlist;
// stage variables
Stage.showMenu = false;
Stage.scaleMode = "noScale";
stop();
// player variables
volume = 60;
current_song = 1;
dipslay.equalizer._visible=0;
// playlist loading
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = loadData;
data_xml.load(playlist);
// parsing all xml data into flash
function loadData(success) {
if (success) {
// getting all titles and filenames
aPath = new Array();
songTitel = new Array();
audioTracks = new Array();
audioTracks.shuffle();
audioTracks = this.firstChild.childNodes;
song_total = audioTracks.length;
for (var i = 0; i<song_total; i++) {
aPath.push(audioTracks[i].attributes.path);
songTitel.push(audioTracks[i].attributes.title);
}
//checking autostart mode
autoStart = this.firstChild.attributes.autoStart;
if (autoStart == "yes") {
playSong();
play_btn._visible = 0;
} else if (autoStart == "no") {
play_btn._visible = 1;
pause_btn._visible = 0;
} else if (autoStart == "random") {
current_song = random(song_total)+1;
playSong();
play_btn._visible = 0;
} else {
current_song = int(this.firstChild.attributes.autoStart);
playSong();
play_btn._visible = 0; } }
// done ! all loaded succesfully. purging trash
delete audioTracks;
delete data_xml;}
// play function
function playSong() {
AudioPath = aPath[current_song-1];
// trying to loops the songs if loop is "yes in XML ???
if (loop == true and skipLoop != true){
MySound.stop();
MySound.start(0, 0);
} else {
// checking for pause > start from there
if (pausePos>0) {
dipslay.equalizer._visible = 1;
MySound.start(pausePos, 0);
pausePos = 0;
// startup new sound
} else {
MySound = new Sound();
MySound.setVolume(volume);
MySound.loadSound(AudioPath, true);
MySound.onSoundComplete = function() {
dipslay.equalizer._visible = 0;
if (autoStart == "random") {
current_song = random(song_total)+1;
} else {
current_song == song_total ? current_song = 1 : current_song++;
}
playSong(); }; }
// check loading bar
dipslay.track_load.onEnterFrame = function() {
total = this._parent._parent.MySound.getBytesTotal();
geladen = this._parent._parent.MySound.getBytesLoaded();
if (geladen != total) {
this._parent.load_display = Math.round((geladen*100/total))+"% Loaded";
this._xscale = Math.round((geladen*100/total));
} else {
this._xscale = 100;
dipslay.equalizer._visible = 1;
delete this.onEnterFrame;
delete this._parent.load_display; } }; }
// switch paly/pause buttons
play_btn._visible = 0;
pause_btn._visible = 1; }
// play button
play_btn.onRelease = function() {
playSong(); };
// pause button
pause_btn.onRelease = function() {
this._visible = 0;
play_btn._visible = 1;
pausePos = MySound.position/1000;
MySound.stop();
dipslay.equalizer._visible=0; };
// next button
next_btn.onRelease = function() {
delete pausepos;
current_song == song_total ? current_song = 1: current_song++;
MySound.stop();
playSong(); };
// previous button
prev_btn.onRelease = function() {
delete pausepos;
current_song == 1 ? current_song = song_total: current_song--;
MySound.stop();
playSong(); };
// updating time display
this.onEnterFrame = function() {
dur = int(MySound.duration/1000);
pos = int(MySound.position/1000);
playTime = {};
playTime.minutes = int((pos)/60);
playTime.seconds = int((pos)%60);
playTime.total = checkDigits(playTime.minutes)+":"+checkDigits(playTime.seconds);
trackTime = {};
trackTime.minutes = int(dur/60);
trackTime.seconds = int(dur%60);
trackTime.total = checkDigits(trackTime.minutes)+":"+checkDigits(trackTime.seconds);
if (dipslay.load_display == undefined) {
dipslay.display = playTime.total+" / "+trackTime.total;
} else {
dipslay.display = dipslay.load_display; }
if (dipslay.trackDrag != true) {
prozent = pos*100/dur;
dipslay.track_play._xscale = prozent; } };
// prefixing a 0 to the time
function checkDigits(toCheck) {
return (toCheck<10) ? toCheck="0"+toCheck : toCheck; }
// track progress slider functions
dipslay.track_back.onPress = function() {
this._parent.trackDrag = true;
this._parent.track_play.onEnterFrame = function() {
perc = (this._parent._xmouse-this._parent.track_back._x)/this._parent.track_back._width;
max = this._parent.track_load._width/this._parent.track_back._width;
perc > max ? perc = max: null;
perc < 0.01 ? perc = 0.01: null;
this._width = this._parent.track_back._width*perc;
this._parent._parent.pausePos = (perc*this._parent._parent.MySound.duration/1000); }; };
dipslay.track_back.onRelease = dipslay.track_back.onReleaseOutside = function () {
delete this._parent.track_play.onEnterFrame;
this._parent.trackDrag = false;
MySound.stop();
playSong(); };
// volume slider functions
vol_back.onPress = function() {
vol_front.onEnterFrame = function() {
perc = (_xmouse-vol_back._x)/vol_back._width;
perc > 0.95 ? perc = 1: null;
perc < 0.05 ? perc = 0: null;
this._width = vol_back._width*perc;
volume = Math.round(perc*100);
MySound.setVolume(volume);
dipslay.equalizer._yscale = volume; }; };
vol_back.onRelease = vol_back.onReleaseOutside=function () {
delete vol_front.onEnterFrame; };
vol_front.setMask(vol_mask);
// drawing equalizer in actionscript
dipslay.equalizer.setMask(dipslay.eq_mask);
dipslay.equalizer.onEnterFrame = function() {
i++;
this.createEmptyMovieClip("graph"+i, i);
with(this["graph"+i]) {
_x = 0;
_y = 0;
beginFill(0x666666, 50);
moveTo(0,0);
for (j=0; j< 9; j++) {
z = random(12)+8;
lineTo(j*6,-1);
lineTo(j*6,-z);
lineTo(j*6+4,-z);
lineTo(j*6+4,-1);
lineTo(j*6,-1); }
lineTo(j*6,0);
lineTo(0,0);
endFill(); }
i >= 3 ? i=0: null; };
// scrolling the display song title
function scrollTitle() {
dipslay.title.txt.autoSize = true;
if (songTitel[current_song-1].length > 20) {
dipslay.title.txt.text = songTitel[current_song-1]+" "+songTitel[current_song-1];
dipslay.title._x+dipslay.title._width/2 +4< dipslay.title_mask._x ? dipslay.title._x = dipslay.title_mask._x : dipslay.title._x--; }
else {
dipslay.title.txt.text = songTitel[current_song-1];
dipslay.title._x = dipslay.title_mask._x-3; } }
dipslay.title.setMask(dipslay.title_mask);
setInterval(scrollTitle, 40);
Help Requested With ActionScript In MP3Player FLA
Hi All,
I have attached an MP3 player, written in Flash 5, that uses Actionscript and an XML file.
I have also attached 5 very short sample songs (2 seconds each).
I am having a challenge. The default setting for the player is on track repeat ( _parent.repeat="track"; )
I would like for the default setting to be ( _parent.repeat="all" ;)
When I manually set that value to "all", the player picks songs randomly and not in order (1,2,3,4 etc)
Also is there a way to get the repeat to play (1,2,3,4,5...1,2,3,4,5 as opposed to 1,2,3,4,5...4,3,2,1?
Thank you.
You will find most of the actionscript in the MC controler (controller) via Movie Explorer.
Mp3player...title Scrolling?
hey there!
i got a question about scrollong text on a dynamic textfield....
here: http://www.billstedt.biz/audio/player.html
can see my mp3 player..it works fine..but now id like to add the scrolling title feature...but i dont know how? maybe anyone can help me?
thanks
tayfun
2 Problems ( 1 Mp3player)(2 Picture Won't Go Away)
Link to file
please take a look at my code and perhaps tell my why my mp3 player won't play?
I also have pic that loads with the screen and then when I click the
buttons the info loads under the picture, how can I make the picture
go away when the buttons are clicked?
A Little Mp3player Assistance Please..(mx2004)
I recently made an mp3 player that reads off of a text file so that users may cycle through a selection of songs. I'm trying to extend it a bit by setting up the mp3 player to display the songs names an their duration (5:45) I'm pretty confident this is possible and I've tried a number of things and read a number of threads and tutorials but I'm still stumped. Anyways, this is how the code reads...
// playlist
var tracks = ["****.mp3", "runnin.mp3", "getlow.mp3", "pimp.mp3", "ghost.mp3"], i = 0;
// define sound object
track = new Sound();
// load first track
track.loadSound(tracks[i], true);
// onSoundComplete play next track
track.onSoundComplete = function() {
i = (i+1)%tracks.length;
this.loadSound(tracks[i], true);
};
// stop track
stopBTN.onRelease = function() {
track.stop();
};
// play track
playBTN.onRelease = function() {
track.loadSound(tracks[i], true);
};
// play next track
nextBTN.onRelease = function() {
i = Math.min(i+1, tracks.length-1);
track.loadSound(tracks[i], true);
};
// play previous track
prevBTN.onRelease = function() {
i = Math.max(0, i-1);
track.loadSound(tracks[i], true);
};
//-----------------------------------------
Just curious as what I can add to this AS so that it may function in the way that I want! Thanks in advance..oh and how and the hell do you get the flashtrak eq's to function?!?
Mp3player Preloading With Scrub Bar
Hi everyone, I'm having problems creating an mp3 player, it's actually a plug-in component for our content management system so unfortunately I can't use the default component that flash provides.
I can load the mp3 fine by using loadSound(). And of course have the preloading option set to true.
So then I have an interval that updates every 100 miliseconds that tracks the position of the playhead.
If the user plays the file when it is still preloading the playhead goes all over the place. Look at the code I have below:
Code:
//---show the amount loaded
amountLoaded = (s.getBytesLoaded() / s.getBytesTotal() )
loader.loadBar._width = amountLoaded * 202.1
loader.scrub._x = s.position / s.duration * 202.1
So loader is the full bar which by default is empty.
loader.loadBar is the coloured bar inside which will show how much of the track has been loaded
loader.scrub is a little triangle pointing to your current place within the track.
202.1 is the width of the bar
The problem I have is that s.duration seems to take the duration of what's been downloaded, not the duration of the entire track. So if it has loaded 20 seconds of a 1 minute track, the pointer will show your position assuming you only have a 20 second track, so it will look like it is halfway through after just 10 seconds!
I have almost identical code for a video scrub bar and it works perfectly. So I have no idea what is wrong with this. Surely someone else must have had this problem!
2 Problems ( 1 Mp3player)(2 Picture Won't Go Away)
Link to file
please take a look at my code and perhaps tell my why my mp3 player won't play?
I also have pic that loads with the screen and then when I click the
buttons the info loads under the picture, how can I make the picture
go away when the buttons are clicked?
A Little Mp3player Assistance Please..(mx2004)
I recently made an mp3 player that reads off of a text file so that users may cycle through a selection of songs. I'm trying to extend it a bit by setting up the mp3 player to display the songs names an their duration (5:45) I'm pretty confident this is possible and I've tried a number of things and read a number of threads and tutorials but I'm still stumped. Anyways, this is how the code reads...
// playlist
var tracks = ["****.mp3", "runnin.mp3", "getlow.mp3", "pimp.mp3", "ghost.mp3"], i = 0;
// define sound object
track = new Sound();
// load first track
track.loadSound(tracks[i], true);
// onSoundComplete play next track
track.onSoundComplete = function() {
i = (i+1)%tracks.length;
this.loadSound(tracks[i], true);
};
// stop track
stopBTN.onRelease = function() {
track.stop();
};
// play track
playBTN.onRelease = function() {
track.loadSound(tracks[i], true);
};
// play next track
nextBTN.onRelease = function() {
i = Math.min(i+1, tracks.length-1);
track.loadSound(tracks[i], true);
};
// play previous track
prevBTN.onRelease = function() {
i = Math.max(0, i-1);
track.loadSound(tracks[i], true);
};
//-----------------------------------------
Just curious as what I can add to this AS so that it may function in the way that I want! Thanks in advance..oh and how and the hell do you get the flashtrak eq's to function?!?
Creating A Mp3player For Php Script
Wonder how i would make a flash mp3 player to run on a php script site. with a stop go button. also Is there a way to make a flash calender that would embend into the php script. thnx for help lemi.
Prob With Part 1 Of Lee's MP3Player
Hello.
I'm hung up on Part 1 of the mp3player.
I am getting the following error:
...mp3player1mp3Player.as: Line 28: '{' expected
function playSong():Void
-------------------
Here is my 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;
//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);
}
}
-------------------------------
Here is my songs.xml:
Code:
<?xmlversion="1.0"encoding="UTF-8"?>
<songs>
<song url="Track1.mp3"/>
<song url="Track2.mp3"/>
<song url="Track3.mp3"/>
<song url="Track4.mp3"/>
</songs>
---------------------------------
Here is what is in my 'mp3Player1' directory:
mp3Player.as
mp3Player.fla
mp3Player.swf
songs.xml
Track1.mp3
Track2.mp3
Track3.mp3
Track4.mp3
----------------------------------
Any suggestions or help would be greatly appreciated!
I've gone over this again and again.
Thanks
NIk
Mp3player Can't Find All The Xml Datas...
Hi !
I've tried to customise an mp3player, it work properly on my computer (local machine) and on Mozilla + Safari on Macintosh.
But on Internet Explorer PC I just can see the title of the song. The song don't start.
I think perhaps it's due to the path ???
I've tried to change several things but it doesn't work.
So here is a link with all the files: fla, swf, xml and an mp3
http://nonnonnonlesite.free.fr/player/
and here for the test:
http://nonnonnonlesite.free.fr/player/mzik.htm
Any HELP would really appreciated :D
THANKS A LOT
Problem With MP3player Class...
HI.
This is my code:
Code:
class com.mloncaric.soundPlayer {
var xml:XML;
var urls:Array;
var artist:Array;
var title:Array;
var album:Array;
var sound_obj:Sound;
var index:Number = 0;
//
var isPlaying:Boolean = false;
//
function loadXML(targetXML:String) {
xml = new XML();
urls = new Array();
artist = new Array();
title = new Array();
album = new Array();
sound_obj = new Sound();
//
xml.ignoreWhite = true;
//
xml.onLoad = function(success:Boolean) {
if (success) {
var temp:Array = this.firstChild.childNodes;
//
for (var i:Number = 0; i<temp.length; i++) {
artist.push(temp[i].attributes._artist);
title.push(temp[i].attributes._title);
album.push(temp[i].attributes._album);
urls.push(temp[i].attributes._src);
}
}
};
//
xml.load(targetXML);
}
//
function playSong() {
if (isPlaying == false) {
sound_obj.start(0, 100);
sound_obj.loadSound(urls[index], true);
sound_obj.setVolume(100);
isPlaying = true;
}
}
}
I'm working on this class for about 1 hour and still not getting it to work properly.
The problem is inside of for statement...
all Arrays inside of it should be filled with correct data and all what I get from tracers is undefined.
If anyone has any idea where is the problem please tell me (this is my first class so it is possible that I've done stupid mistake).
Thanks for now!
mloncaric
Mp3player.swf Wont Load In Movieclip
i dont get it. i have a main movie that has external movies load on button press, but tryin ta load this mp3player.swf just doesnt wanna work. anybody got any ideas as to why this wont work for me? ive tried levels, ive tried root, ive tried loadMovie, and lots of others. im not sure if it has to do with some of the other actionscript i have in my main movie but i also moved scripts around to fix that. still cant understand it. i even tried to use the same actionscript that the mp3player uses to load the mp3.swf, still nothing. i can bring up the mp3player.swf by itself and it will load the mp3.swf and play it just fine. but when i try to load the mp3player.swf in a movieclip on my main swf, i get nothing to load in that movieclip. ok, let me shut up. anybody got any ideas?
thanks for your time,
Struggle To Get Mp3player Funtional = Pweese Help
Hello
I've got an mp3player - decided to put it its own movieclip. Loads the initial track fine but won't play the menu track links.
The code for the track buttons:
on(release){
_level0.artist = "";
_level0.track = "'Falling Alone'";
_level0.newSong = "falling_alone_128k.mp3";
_root.gotoAndPlay("start");
}
Do I need to put the movieclip name in my code somewhere?
This is my script loading the initial track:
s = new Sound();
if(newSong !== undefined){
s.loadSound(newSong, true);
}
else{
s.loadSound("falling_alone_128k.mp3", true);
artist = "";
track = "'Falling Alone'";
}
s.onLoad = function(){
gotoAndPlay("Playing");
}
s.onSoundComplete = function(){
trackVar = "Please Choose Another Track";
gotoAndPlay("Paused");
}
In advance, many thanks
claude
The Missing GotoAndLearn.com Mp3player Code
Hello there,
I was wondering if anyone here happens to have the supplementry .zip file found on gotoAndLearn.com, that accompanied the last Mp3player tutorial before the site was pulled and the content rendered unavailable.
its a bit of a long shot, but i'd thought i'd ask. I just can't find it anywhere on the web, not even http://theflashblog.com/ .
thanks Cam
Problem With Volume Control For XML MP3Player
Hello there,
I'm super stuck on this (getting into the days catagory!) any help is much appreciated.
before i start, here's the link to what my XML MP3Player functions like atm;
http://www.oconnellconstruction.co.n...ayer/test.html
The foundations of the AS for this player are from the gotoAndplay.com tutorials, I'm having two problems with adding this volume slider control,
Firstly the SliderBar onload position, it is positioned on the far left of the screen, you can drag it towards the player, once you get it with'in the player it functions correctly moving between the designatd left and right x values correctly, but how can i get it to load into the player rather than out to the left?
And Secondly, by this stage you may have noticed no sound, i've tried alot of different things but to no avail?
below is the AS on the Volume slider with the instance name 'volslider'
Code:
onClipEvent (load) {
_root.shorat_mask._width = _root.volslider._x-_root.shorat._x;
left=(_root.volslider._x) - 48;
top=_root.shorat._y;
right=(_root.volslider._x) + 48;
bottom=_root.shorat._y;
_root.volslider._x=_root.shorat._width/2;
loadPosition=_root.volslider._x;
volCalc=_root.volslider._x-50
}
onClipEvent(mouseDown) {
startDrag(this, false, left , top , right, bottom)
}
onClipEvent(mouseUp) {
this.stopDrag();
}
onClipEvent(enterFrame) {
sliderx=_root.volslider._x; of slider
myMusicVolume=(sliderx-volCalc);value - n = 50
_root.s.setVolume(myMusicVolume);
_root.currentVolume=_root.s.getVolume();
_root.shorat_mask._width = _root.volslider._x-_root.shorat._x+12;
}
and this is the initial AS that loads the XML ;
Code:
// Setup sound object
var s : Sound = new Sound ();
s.onSoundComplete = playSong;
// 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");
could this VC method be done using fuse or MCtween instead ?
Many thanks to anyone who can help!
Mp3player Component List Selected
i have a as script that plays a mp3 and show the tittles in a list component
what i want to do is when someone clicks on a song that is on the list component , i want that song to play.
this is my code how would i make it work.
Attach Code
//Set up sound object
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
// url vars
mytxt = _root.vars;
//Array of songs
var sa:Array = new Array();
var p:Array = new Array();
//Currently playing song
var cps:Number = -1;
//possition of music
var pos:Number;
//Laod 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);
p.push(nodes[i].attributes.img);
theList.addItem((i+1) + ". " + nodes[i].attributes.alt,i);
}
playSong();
}
xml.load("songs.php");
// Play the MP3 file
function playSong():Void
{
s = new Sound();
s.onSoundComplete = playSong;
if(cps ==sa.length-1)
{
cps = 0;
s.loadSound(sa[cps],true);
}
else
{
s.loadSound(sa[++cps],true);
}
holder.loadMovie(p[cps]);
theList.selectedIndex=cps;
}
Problem With Volume Control For XML MP3Player
Hello there,
I'm super stuck on this (getting into the days catagory!) any help is much appreciated.
before i start, here's the link to what my XML MP3Player functions like atm;
http://www.oconnellconstruction.co.n...ayer/test.html
The foundations of the AS for this player are from the gotoAndplay.com tutorials, I'm having two problems with adding this volume slider control,
Firstly the SliderBar onload position, it is positioned on the far left of the screen, you can drag it towards the player, once you get it with'in the player it functions correctly moving between the designatd left and right x values correctly, but how can i get it to load into the player rather than out to the left?
And Secondly, by this stage you may have noticed no sound, i've tried alot of different things but to no avail?
below is the AS on the Volume slider with the instance name 'volslider'
Code:
onClipEvent (load) {
_root.shorat_mask._width = _root.volslider._x-_root.shorat._x;
left=(_root.volslider._x) - 48;
top=_root.shorat._y;
right=(_root.volslider._x) + 48;
bottom=_root.shorat._y;
_root.volslider._x=_root.shorat._width/2;
loadPosition=_root.volslider._x;
volCalc=_root.volslider._x-50
}
onClipEvent(mouseDown) {
startDrag(this, false, left , top , right, bottom)
}
onClipEvent(mouseUp) {
this.stopDrag();
}
onClipEvent(enterFrame) {
sliderx=_root.volslider._x; of slider
myMusicVolume=(sliderx-volCalc);value - n = 50
_root.s.setVolume(myMusicVolume);
_root.currentVolume=_root.s.getVolume();
_root.shorat_mask._width = _root.volslider._x-_root.shorat._x+12;
}
and this is the initial AS that loads the XML ;
Code:
// Setup sound object
var s : Sound = new Sound ();
s.onSoundComplete = playSong;
// 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");
could this VC method be done using fuse or MCtween instead ?
Many thanks to anyone who can help!
Mp3Player-volume Resets For Each Track
Hi folks
I have successfully taken the mp3Player tut and it works beautifully. Great tutorial by the way.
I am having an issue I do not know how to fix. I was hoping someone could assist me.
If I turn the sound off on any track, when the track completes and the next track loads, the next track loads with the volume on again. I realize that users should just pause the track instead of relying on volume to kill the sound, but try explaining that to someone who doesnt care. LOL !
I need the volume to stay off regardless of the next track loading.
Thanks in advance to anyone who has time to help with this issue.
Streaming Music, Playlist, Possibly Using XML, MP3player.
Ok I'm looking to get a working MP3 player sort of thing.
So the design and all will be done in flash, then this would link to a XML sheet with the playlist you want which has the name of the song and the URL then it streams and plays the song for you in the .swf.
I've seen something like this before it was called something like CoolPayer but it gave no code or how it's done so I didn't learn anything =/
If anyone could help me or maybe supply a partial and then help me like that it would be greatly appreciated, thanks for reading
How To Stop My Mp3Player To Reload With Every Page Change
Hi to all!
I got this problem, which I'm not very keen to solve, and would be cool if I can have some help from you guys..
I got AS2 mp3Player on my site's footer (asaucerfulofpixels.com/deuce) which is built with joomla. It's loaded with the XML playlist from the backend, but what is odd is that it reloads from the beginning every time the page is changed ie. clicked on the links in the top nav bar.
Is it possible to achieve that the player keeps playing the same song, once it's loaded, no matter on which page you are?
Thank you so much!
Help With "simple Mp3player" How To Make It Stop
Hiya all,
Unfortunately I need a helping hand again
On my website I've made a mp3player based on:
http://www.flashkit.com/movies/Soun...-9828/index.php
It's practically the same, except I've reskinned it. It loads external mp3 files to keep the size on the main swf file down. However my "stop" button doesnt function proper. When I pause a song, it simply pauses it for the duration of the clip, and as soon as the next song begin it starts playing again.
My pause button looks like this:
on (release) {
stopAllSounds();
}
How do I make a proper stop button for it?
Thanks in advance for any help, really appreciate it.
Flash MX TabIndex Only Working With Text Fields, Movies And Buttons Not Working :(
hey, has anyone heard of this, is it a known bug, or am i doing something wrong?
im using the following code to tab index a page, with text fields, buttons and movies that i would like to highlight to the visitor.
arrTabIndex = new Array("butAddress", "movEmail", "txtCC", "txtTelephoneNumber", "txtMobileNumber", "txtSubject", "txtSubject", "txtRealName", "txtBody");
for (var Count = 0; Count < arrTabIndex.length; Count++) {
eval(arrTabIndex[Count]).tabIndex = Count;
//eval(arrTabIndex[Count]).tabEnabled = 1;
//eval(arrTabIndex[Count])._focusrect = 1;
}
my problem is, that if i include movie clips or buttons, the first in the series does focus and show the colored square but the tab key does not move the focus to the next object.
if i only include text fields, the tab key works as normal
is this a bug, or am i doing something wrong?
many thanks, in advance
clive
GetURL Working In Flash Player 8 / Not Working In Player 9
Here I have the portfolio system I'm working at:
http://www.vamapaull.dxwebs.com/portfolio.html
when you click on the big image it should open a URL in a new window
When I test it on my computer is working fine(Flash Player 8), but when I test it in Firefox or IE (Flash Player 9) is now opening any URL... I think is some thing about the Flash Player 8 and Flash Player 9 compatibility... or some thing...
I don't know how to correct this problem... I need my portfolio working on Flash Player 8 and Flash Player 9 because now alot of users have Flash Player 9 on computers. :roll:
Any idea how to fix this issue? :?
Pass Variable To Custom Function Not Working In Flash MX For Flash 6 Player
I have a Flash application that I built in Flash 5 that I want to now output in Flash MX (not 2004, though) for Flash 6 Player. The problem is that part of my code, which works fine if published for Flash 5 Player, breaks if published for Flash 6 Player. I am loading text from an external text file, and then passing the text contents of each variable to a function (to strip line breaks). Following is the code... does anyone know how to rewrite this so that it will work as Flash 6 Player swf? The contents of the variable are not getting passed, and eval does not work on left side of expression... I've tried everything I can think of...
Thanks in advance for help.
-S
PHP Code:
/* content, correct, Q1, Q2, Q3, etc are all variable loaded from external text file. I am trying to pass contents of variables, which is why I need to eval them. This worked in Flash 5, but not in Flash MX if I publish as Flash Player 6 file. */
temp = stripLineBreak("content");
temp = stripLineBreak("correct");
for (i=1; i<=10; i++){
z="Q"+i
temp = stripLineBreak(z);
}
function stripLineBreak(x) {
tempArray = new Array();
tempArray = eval(x).split("
");
eval(x) = tempArray.join("");
tempArray.splice(0,tempArray.length);
tempArray = eval(x).split("
");
eval(x) = tempArray.join("");
tempArray.splice(0,tempArray.length);
}
Flash Working In Flash Player, But Not When Inserted In A Html Page
Hello guys. I have a very strange problem.
I have created a dynamic banner, made up of two simple combo boxes, with 3 parts actionscript.
The ideea is, when first loading the banner, the first combo box receives a lists of artists and it populates itslef with them. After selecting an option, it will send the id and receive a second list of tracks that belong to the selected artist.
After you select a track, you will be redirected to the page where you can listen to it.
MY problem is that while testing it, it works just fine in flash player, but after publishing it, my computer gets frozen up, untill a popup message appears, saying that my computer will become unresponsive do to the script.
This happens when i've uploaded the swf on the server. On my local computer, it only started to work in HTMl after i've modified the settings and set it up as trusted script.
ANy ideea how i can make it work in the browser?
Thank you for your help and here is the code of the banner:
!st code goes int he first frame:
Code:
myData = new LoadVars();
myData.load("http://website.com/banner/banner.php");
myData.onLoad = function() {
total_var=this.variabile;
myComb_cb.addItem({label:["Select an artist"]});
for (var i:Number = 1; i<=total_var; i++) {
myComb_cb.addItem({label:this["variabila"+i] },{data:this["variabila"+i]});
}
};
2nd code goes in the first combo box:
Code:
on(change) {
_root.myComb2_cb.removeAll();
var reply_lv = new LoadVars();
var send_lv = new LoadVars();
send_lv.id = this.selectedIndex;
send_lv.sendAndLoad("http://website.com/banner/banner.php", reply_lv, "POST");
reply_lv.onLoad = function() {
total_var=this.variabile;
_root.myComb2_cb.addItem({label:["Select a track"]});
for (var i:Number = 1; i<=total_var; i++) {_root.myComb2_cb.addItem({label:this["variabila"+i] },{data:this["id"+i]} );
}
}
}
And thirs code goes in the second combo box
Code:
on(change) {
getURL("http://website.com/banner/banner.php?id_piesa="+this.selectedIndex, "_blank");
}
Flash Site Not Working In IE7 But Ok In Firefox(Newbie To Flash Websites)
So i have created a simple 4 page flash site with CS3 as an actionscript 2.0.
My website works just fine in Firefox but does not work at all in internet explorer. Does anyone know if this is a Flash issue or Internet Explorer doing something weird. Feel free to check out my source file on the site.
I created the layout in Photoshop then imported it into Flash. From there all i did was hit publish. Am i missing a step?
The site is here
Any help would be greatly appreciated.
-shawn
I Started Exporting To Flash 8 Instead Of Flash 6 And My Loader Quit Working
I am using a loader component which I named tstone. I was setting the ContentPath to a variable on the first frame of the timeline containing this component by using:
tstone30.ContentPath=_root.page3_tphoto30;
However, I decided I wanted to take advantage of the justify feature for my dynamic text fields and began exporting to Flash 8 instead of Flash 6. For some reason, my loader quit pulling the images into the loader. If I switch back to Flash 6 it works again. Any ideas cause this is driving me crazy?
ActionScript Not Working Runs When Published In Flash 6 But Not In Flash 8
Hi,
I have this file which I created from http://www.tutorialized.com/tutorial...entation/11499 where the actionscript works in Flash Player 6 but when I publish into Flash player 7 or 8 it does not seem to want to play.
It gets a pop up message stating:
"A script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort?"
My purpose to get this working in Flash 8 is because I need to incorporate CSS Stylesheets externally.
Here is the following actionscript:
stop();
numberOfTabs = 3;
for (i=1; i<=numberOfTabs; i++) {
line = eval("tab"+i);
line.onRelease = function() {
for (i=1; i<=numberofTabs; i++) {
otherTabs =
eval("this._parent.tab"+i);
otherTabs.bottomLine._visible =
true;
}
this.bottomLine._visible = false;
contentFrame = Number (this._name.substr(3,
1));
this._parent.contents.gotoAndStop(contentFrame);
}
}
tab1.bottomLine._visible = false;
tab1.onPress = function() {
gotoAndStop("tab1");
};
tab2.onPress = function() {
gotoAndStop("tab2");
};
tab3.onPress = function() {
gotoAndStop("tab3");
};
How does it need to be changed?
Extension Working In Flash MX Cannot Work In Flash MX 2004
Hello,
I bought a flash extension last year which was working fine in flash MX. For your information, the flash extension was used to produce some flying effect.
However the flash extension cannot work in Flash MX 2004. The problem should be that the extension used ActionScripts 1.0 to produce the effect and Flash MX 2004 is using ActionScripts 2.0
Are there any softwares that can convert AS 1.0 to AS 2.0? If yes. Is it possible that, I used flash MX to produce a FLA file then use the software to convert AS 1.0 to AS 2.0. Or there are some other better ways to do that....
Thanks and best regards
Alex
My ActionScript Not Working When Published Works In Flash 6 Not In Flash 8~
Hi,
I have this file which I created from http://www.tutorialized.com/tutorial...entation/11499 where the actionscript works in Flash Player 6 but when I publish into Flash player 7 or 8 it does not seem to want to play.
It gets a pop up message stating:
"A script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort?"
My purpose to get this working in Flash 8 is because I need to incorporate CSS Stylesheets externally.
Here is the following actionscript:
stop();
numberOfTabs = 3;
for (i=1; i<=numberOfTabs; i++) {
line = eval("tab"+i);
line.onRelease = function() {
for (i=1; i<=numberofTabs; i++) {
otherTabs =
eval("this._parent.tab"+i);
otherTabs.bottomLine._visible =
true;
}
this.bottomLine._visible = false;
contentFrame = Number (this._name.substr(3,
1));
this._parent.contents.gotoAndStop(contentFrame);
}
}
tab1.bottomLine._visible = false;
tab1.onPress = function() {
gotoAndStop("tab1");
};
tab2.onPress = function() {
gotoAndStop("tab2");
};
tab3.onPress = function() {
gotoAndStop("tab3");
};
How does it need to be changed?
Scroll Button In Flash 6, Not Working In Flash 8
on (press) {
_root.right = "1";
}
on (release, releaseOutside) {
_root.right = "0";
}
this code is not working in flash8, i'm using flash 6 before then i upgrade it into flash 8, then when i published my swf, the button isn't working... any help? please... my head is really exploding searching for solution....
Pop-up Window From Flash 8 Not Working (but It Works From Flash 6 MX)
Hi!
This sure is a silly thing although I haven't been able to find the solution yet.
I always used this in order to open a Pop-up window from Flash MX, however, this same piece of code does not work when exporting the movie for a Flash 8 player.
code: on (release) {
getURL("javascript:newWindow=window.open('PopIC.ht ml','MYGALLERY','height=550,width=450');newWindow. focus(); void(0);");
}
(NOTE: It's 'MYGALLERY', don't know why it displays 'MYG ALLERY' in this AS code above... )
Any help please?
Thank you very much.
Best regards,
Manare
Flash 6.0 Source Not Working With Flash Player 8.0
Hi all,
I found a cool movement script in a flash book i bought years ago, it has been written in the flash 6 environment. It works fine when i publish it in 6.0.
My problem is that i want to use this script inside a flash 8 project of mine but the script won't work when i publish my file for the eightth player.
I tried to fix it but finally i can't figure out what's wrong with my code.
Im more a designer than a coder so i would be glad if someone could help me with this issue.
here's the code
PHP Code:
body = function () {
this.onEnterFrame = function () {
if (modus != 0) {
if (modus == 1) {
if (modus_time == 1) {
modus_time = 0;
nmx = _root._xmouse;
my = _root._ymouse;
mx0 = nmx;
my0 = my;
dmx = nmx - mx0;
dmy = my - my0;
} else {
nmx = (_root._xmouse + nmx) / 2;
my = (_root._ymouse + my) / 2;
dmx = nmx - mx0;
dmy = my - my0;
mx0 = nmx;
my0 = my;
}
fx = (dmx - vx) * M;
fy = (dmy - vy) * M;
ldx = nmx - nx;
ldy = my - ny;
if (fx == 0) {
mlength = ldx;
mforce = fy;
torque = mforce * mlength;
} else if (fy == 0) {
mlength = ldy;
mforce = fx;
torque = -mforce * mlength;
} else {
k = fy / fx;
kx = (-k * k * ldx + k * ldy) / (-k * k - 1);
ky = k * (kx - ldx) + ldy;
mlength = Math.sqrt (kx * kx + ky * ky);
mforce = Math.sqrt (fx * fx + fy * fy);
if (fx * ky > 0) {
torque = -mforce * mlength;
} else {
torque = mforce * mlength;
}
}
vx = dmx;
vy = dmy;
nx = nx + vx;
ny = ny + vy;
vr = vr - torque / inertia;
ldx = nmx - nx;
ldy = my - ny;
var cos = Math.cos (vr / 180 * 3.141593E+000);
var sin = Math.sin (vr / 180 * 3.141593E+000);
addx = ldx * cos + ldy * sin - ldx;
addy = -ldx * sin + ldy * cos - ldy;
nx = nx + -addx;
ny = ny + -addy;
} else if (modus == 2) {
if (modus_time == 1) {
modus_time = 0;
vx = vx - addx;
vy = vy - addy;
}
torque = 0;
addx = 0;
addy = 0;
nx = nx + vx;
ny = ny + vy;
if (Math.abs (vx) < min && Math.abs (vx) < min && Math.abs (vr) < min) {
modus = 0;
// delete loop
_root.del++;
delete this.onEnterFrame;
}
}
if (modus == 3) {
if (modus_time == 1) {
modus_time = 0;
}
vx = (vx + (originx - nx) / backa) / backb;
vy = (vy + (originy - ny) / backa) / backb;
vr = (vr - (originr - r) / backra) / backrb;
nx = nx + vx;
ny = ny + vy;
}
if (nx < -margin) {
nx = nx + (nw + margin * 2);
}
if (ny < margin) {
ny = ny + (nh + margin * 2);
}
if (nw + margin < nx) {
nx = nx - (nw + margin * 2);
}
if (nh + margin < ny) {
ny = ny - (nh + margin * 2);
}
vr_txt = Math.round (vr * 100) / 100;
r = r - vr;
this._x = nx;
this._y = ny;
this._rotation = r;
vx = vx / b;
vy = vy / b;
vr = vr / b;
}
_root.updateAfterEvent ();
};
};
Flash Form Not Working In Flash Website
I have a Flash Contact form that works perfectly by iteself on a server when I embed it into a HTML doc. The information comes right to my designated email I inputted. I have another Flash Website Movie that I want this Flash Contact Form to work in but every time I try to import the Contact Form movie it does not even show the form it only shows the "Connecting to Server" layers that appear when you click the Submit button. When I import it automatically turns the Form into a Graphic which I changed to a Movie but it still just shows the "Connecting to Server" screen instead of the form. Like I stated the Contact form by itself works perfectly fine when embedded into a HTML doc. Please anyone that can help would be most appreicated.
AS Created In Flash MX Not Working With Flash Player 8
I have some dropdowns created in MX that when selected allow a button to open the link. Now that the player has been updated to 8,0,22,0 these buttons do not work. Can someone tell me if there needs to be a change to the embed protocol and what that would be?
THanks
Duff
Flash 6 Vs Flash 8, Script Not Working, Fla Attached
Can some please help me and tell me why the action script which makes the pictures enlarge on mouseover works with flash 6 publish settings but not flash 8.
...nevermind, figured it out, thanks....
Thanks a million!
Rich
Edited: 02/20/2007 at 05:14:03 AM by RichieDee
Problem With My Preloader- Working Under Flash Mx But Not In Flash 8
hi guys, actionscript guru! i need your help, ive been using this preloader since flash mx, but now its not working propely under flash 8, im getting an error now, could someone help me fix the code so it will work in flash 8? many thanks in advance guys!!
heres the file:
|