ActionScript 2.0 :: Change Song Using Attribute From XML In Flash
Nov 4, 2010
I have an mp3 on my site that is loaded via an xml. I have an action on the xml that allows any song to be played first by assigning an attribute. However, I want another song to play when a selected button is pressed on the flash file. But I do not want to load a new xml, instead, I want to change it using an attribute. Any who, here is the code that is used to create a sound and play selected song.
//this function selects the music assigned with "musicnum" variable
selectmusic = function() {
//create a new sound variable
sound = new Sound();
//load the music
sound.loadSound(songs[musicnum].attributes.src, true);
//set volume
[Code] .....
View 2 Replies
Similar Posts:
Aug 19, 2009
I have a list of mp3-songs, when song 1 is clicked it gets streamed, a stop-button appears, if this Btn is clicked, this Btn disappears as it should - but if user forgets to click for stopping sound and clicks song 2, stopBtn 1 remains and the new stopBtn 2 also appears. there should be only one stopBtn, the one next to the song is playing.
I would like to move the stopBtn and I have tried several approaches move; graphics.moveTo; if(stopButton !=null) {removeChild (stopButton)}; I packed the var stopButton:Sprite in the header and so on.
Code:
SoundMixer.stopAll();
import flash.display.Sprite;[code]..........
View 0 Replies
Feb 15, 2010
I am writing a mp3 player and having some issue getting the song length before the entire song has been loaded - which messes with my position indicator, as it needs to know the track length. I thought I could get the length from an ID3 tag, problem is ID3.TLEN returns undefined, though if I right click the track and show properties, the summary tab shows song duration, bitrate, etc... how I can retrieve the song length before the entire thing has been downloaded?
View 4 Replies
Oct 20, 2010
For example
i want to change
<item id="1"/>
to
<item code="1"/>
View 1 Replies
Jun 29, 2010
How can we change the attribute name ows_Attachments to Attachments in runtime ??
ActionScript Code:
<rootNode>
<data>
<row ows_Attachments="0" ows_LinkTitle="1" ows_productNo="1" ows_purchaseDate="2010-06-09 00:00:00" xmlns="#RowsetSchema"/>
[code]....
View 2 Replies
Mar 15, 2012
I'd like to change icon of the node according to the attribute automatically/dynamically in Flex.[code]
View 1 Replies
Jan 5, 2012
[Code]....
I am currently updating page level "visited=true" programatically/runtime. I wanted to roll up to topic level(all parent levels) once I have shown visited state "true" to all pages in topic.
View 2 Replies
Dec 15, 2006
I have been trying to figure out how you could add in custom attribute tags that flash can recover.
EX:
<param name = "movie" value = "somefile.swf">
<embed src = "somefile.swf" width = "550" height = "400">
Except, that I would like to add a Custom tag, like "randNum" so that the tag user could input some number, or rather, a flash movie could generate a tag with a number already put in...Basically, heres a really basic version of the idea.There is a Flash Movie.In the movie, you can input text into a textfield.Upon finishing your message, you click a button "save".
The flash movie then:
1. Comes up with a random number unique to the message.
2. Assigns that number to a variable... "randNum".
3. Saves message as a xml file to the server as "filename" + randNum.
4. Outputs into a textfield a generated HTML tag that a user can post on myspace and such so that it will load in the flash movie.
Except... in the tag, there will be a custom attribute. If the random number variable "randNum" was 00112233, the custom attribute will be 00112233.
EX:
<embed src = "somefile.swf" width = "550" height = "400" randNum = "00112233">
So when the movie opens, it retrieves that randNum from the tag and can use it inside flash. How can this be done? Sorry this post was so long, but I wanted everyone to understand the concept.
View 8 Replies
May 13, 2009
I am having trouble parsing some xml that has a few attribute names with : characters in them. The compiler is not throwing any errors and when I trace my complete xml object out it is all there, however when I try to trace out any element or node it keeps comming up undefined. I removed the attribute names with : characters in them and everything works fine. I cant seem to target the attributes either to delete them.
View 3 Replies
May 10, 2010
I need to make player like this one URL...Is there a tutorial for this on this site already? If not does anyone know any good tutorials?
View 3 Replies
Sep 11, 2011
I am loading mp3's externally as to not bloat the swf. However, only 1 out of 3 songs play (2nd song plays) for this jukebox I'm having to create for an assignment. I would think if one song played, they all would. I've checked the AS2 code and it all seems right to me; the song names and button instance names. I sure could use some insight as to why the 1st and 3rd song doesn't play. My jukebox is at: [URL] and here is my simple code in the first Actions frame. This is the only code I used for the jukebox.
[Code]...
View 3 Replies
Jan 15, 2012
i got a question about song problem. if i make a website or a flash template and i put a song inside ,well any song exp like "Party at USA" , will song own sue me ? i am selling the website and template.
View 3 Replies
Sep 17, 2008
I have just created an xml/flash mp3 player in flash 8 for a website that I am working on using Lee's excellent tutorial. Everything is working perfect except for the scrolling titles. His code had it so that the title would scroll across and then reverse back but it really didn't work with the titles of the songs I was using no matter how much I altered the code. I wanted the titles to scroll from right to left and then repeat over and over until the song ended or the person clicked on the next button. I have managed to get the titles to scroll once in one direction completely but then nothing else happens.
// Text scroller
var size:Number = 35;
var textPos:Number = 0;
[Code].....
View 2 Replies
Mar 15, 2012
okay.. i'm using a xml n URLrequest to bring up the song n song list in a listbox but, I want the song hold for x seconds (because there r a silent opening first, then I want the the song start when the silent opening ends). Perhaps there r code to add delay just to the song so it not autoplay? Plus I dont know where to put the code..
here's the code for frame 1
[Code]...
View 6 Replies
Nov 12, 2010
What do I need to put in my code to tell my mp3 player to grab its songs from a folder on my server via an xml doc I outputted from my sql server? (The mp3 player is also on the server).
Here's my code:
import flash.events.MouseEvent;
import flash.media.Sound;import flash.net.URLRequest;
import flash.media.SoundChannel;import fl.events.SliderEvent;
var myMusic:Sound = new Sound();
var soundFile:URLRequest = new URLRequest("lpwfte.mp3");
var channel:SoundChannel = new SoundChannel();
[Code] .....
View 1 Replies
Dec 22, 2010
I downloaded player from [URL].. but I don't know why what the problem it had with with playlist. I had a playlist in xml file with songs. When i deleted the mp3 from the server, it is still playing. and when i changed the mp3 files it is still playing the original files. I don't know where these files were saved. I thought it was saved in my browser cache and i cleared it but it didn't work. I thought it was cached in my server, but in my localserver , i had the same problem.
So, again i downloaded the player, and this time it played different song, that i put. I have a hypothesis. Does flash player (swf object) absorb mp3 files?? i don't think so but how come player is playing the mp3 that has been changed or deleted? if it was in server cache then how long will it take to clear the cache and play new file. However, i don't remember coding something like 'cache'
View 2 Replies
Jan 17, 2012
I'm playing a song and syncing up some visual changes with that song. The issue is that in order for the song to play when I preview my changes to the animation, I have to start playing my flash project from frame 0. This becomes a problem when I am trying to sync to things that occur later in the song. For example, if I'm trying to sync something at frame 300 then I have to re-play the entire animation from frame 0 in order to hear the song at frame 300 and beyond.
Is there any way to get the song to play, starting from the correct position, regardless of where I start running my animation while developing? I could hack something up in action script to move the play head and play the song if it currently isn't being played but I'd rather not go down that route as there must be a simple solution to this problem.
View 2 Replies
Sep 7, 2011
I have a flash website that uses an XML player to play the artist's songs. The player works great. Now, I need a specific button in the flash document to call and play a specific song title from the XML list. The button I tried and that is showed in the flash code has an instance name of "santaBaby", calling a function I named "sampleSong1"Here's my XML playlist:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<jukebox>
[code]......
View 9 Replies
Apr 28, 2009
I am making flash CS4-based music player with ActionScript 3. When I host the player on my site, e.g. [URL], and play an mp3 on the server of my site, e.g.[URL], it works well.
When I link to an mp3 of another site, e.g. [URL], in my local machine, it also works. However, when I host the music player in my site [URL], and play an mp3 of [URL], then it can't be played.
View 8 Replies
Apr 12, 2012
I'm having some trouble with the code below. the flash player has a default volume slider, but I want to use the jQuery slider to change the volume. the volume value(nr) is changing while I move the slider, but the volume of the song doesn't.
<!DOCTYPE html>
<script type='text/javascript'>
$(document).ready(function(){
[Code].....
View 1 Replies
Jan 20, 2010
I'm creating a new look for the xspf player: [URL]The playlist highlights the current song being played. I'd like to change the color but can't find where that option is listed in the .flv file, or in the actionscript file.
View 2 Replies
Feb 19, 2010
Here is the xml file
<glossary>
<alphabet id="A">
<term heading= "Anchor" definition="A mechanical device that prevents a vessel from
[code]......
View 1 Replies
May 20, 2011
Not sure how I would check to see if the value of a nodes attribute "action" is equal to "left". My XML looks like the following:
<track timestamp="18/05/2011 13:21:49-0400" id="3" action="track">
<coordinates> test 1</coordinates>
</track>
[code]......
View 1 Replies
Feb 14, 2011
very simple question, i have this: (only a part of the complete rss file)
<item>
<title>Ok, de regalo de San Valentin me pueden dar un viaje a Playa del Carmen! Digo, entre todos lo pagan! No?? #SoñarNoCuestaNada</title>
[code]........
View 1 Replies
Nov 10, 2011
I use this code in as3 in order to find node with specific id value but it is working for 2 depth
elementsToDraw = elementsList.*.(@id=="hello");
For example at this xml node can be found
<nodes>
<node id="d">
<node id="hello">
[Code]....
What should I write for searching in any depth element with id="hello"?
View 1 Replies
Aug 19, 2010
'm building a very dynamic app in flash that gets all UI values from XML. Everything's been working fine and then I start having trouble accessing an XML object that only contains attributes. For some reason I can only get it to work if the XML object has content within the opening and closing object tags.Here's the basic AS3 code:
ActionScript Code:
this._uiXML = new XML(this._xml.elements('tag'));
I've also tried...
[code].....
View 6 Replies
Jul 22, 2010
I am new here at Kirupa. I have read the xml tutorial by kirupa but I have problem with filtering my xml. Following is the situation. I have an XMLList : list =
[Code]...
So If there is more than one result no problem! Problem comes only when I have only one result.
View 1 Replies
Dec 14, 2011
I have a flash app generating xml and it seems to just put the attributes for tags in a fairly random order. The problem is that I need them to be in a specific order because of circumstances outside my control. Is there a way to do this while still using the XML object and/or E4X? Or even XMLNode or XMLDocument? I'd really rather not have to resort to working with Strings.
View 2 Replies
Jun 17, 2007
I have a Flash MP3 player that loads the song list from an XML file. I'm trying to set it up to take the customer to the online store to purchase the currently playing song. The player successfully loads the track name, artist name, and url to the song, but for some reason does not appear to the load the new attribute of buylink that I have just added. Given the code below, my buylink value is returned as undefined.
View 3 Replies
Dec 27, 2007
I am quite new to using XML in Flash.My problem is: I want to load an attribute called "title" from XML to Flash, and arrange them along the width of Flash screen (just like a navigation). I wrote the code, but it does not work (see attachment)
View 2 Replies