/    Sign up×
Community /Pin to ProfileBookmark

Internal Flash function to load a new MP3

I am having trouble writing a function to load and play a new mp3 file in flash and I cant find any examples….Any code or links to code would be appreciated – wasted too much time on this already
Thanks

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@mwpwalsheauthorAug 10.2007 — function updateSong() {

var fo = new SWFObject("flash/previewplayer.swf", "mp3player", "300", "350", "8.0.15", "#ffffff", true);

// need this next line for local testing, it's optional if your swf is on the same domain as your html page

fo.addParam("allowScriptAccess", "always");

fo.addVariable("file","flash/test.mp3");

fo.write("flashcontent");

}

I have this function and it working to update, but it creates a new object everytime which is not what I want, I can get my original object via:

var flashMp3Player;

function init() {

if (document.getElementById) {

flashMp3Player = document.getElementById("mp3player");

}

}

surly I can just update this object:

flashMp3Player. "load new song" ????????

Any Ideas
×

Success!

Help @mwpwalshe spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...