Hey there.
I am learning XML and Actionscript.
I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like: - <?xml version="1.0" ?>
-
<playlist>
-
<song title="Alliance" artist="Jack Hammer & B Mac" src="../content/music/Alliance.mp3" />
-
<song title="Black Friday" artist="King Gregor" src="../content/music/BlackFriday.mp3" />
-
<song title="A Dangerous Man" artist="Jack Hammer" src="../content/music/DangerousMan.mp3" />
-
</playlist>
And my actionscript, which admittedly I did copy and paste from a tutorial and have little idea of how it all works, I just know that it doesn't: - XMLNode.prototype.moveBefore = function(beforeNode){
-
if (this == beforeNode) return (0);
-
beforeNode.parentNode.insertBefore( this.cloneNode(true), beforeNode);
-
this.removeNode();
-
}
-
Clamp = function(min, n, max){
-
if (n<min) return min;
-
if (n>max) return max;
-
return n;
-
}
-
-
-
-
var song_spacing = 20;
-
var over_node;
-
GenerateSongListing = function(playlist_xml, target_mc){
-
-
target_mc = target_mc.createEmptyMovieClip("list_mc",1);
-
-
var songs = playlist_xml.firstChild.childNodes;
-
for (var i=0; i<songs.length; i++){
-
var song_mc = target_mc.attachMovie("song", "song"+i, i);
-
song_mc._y = i*song_spacing;
-
-
song_mc.node = songs[i];
-
song_mc.title_txt.text = songs[i].attributes.title;
-
song_mc.moved = false;
-
-
song_mc.select_btn.onPress = function(){
-
this._parent.onMouseMove = function(){
-
if (!this.moved){
-
dragline_mc._visible = true;
-
dragline_mc._y = playlist_mc._y + this._y;
-
highlight_mc._visible = true;
-
highlight_mc._y = playlist_mc._y + this._y;
-
this.moved = true;
-
}
-
}
-
}
-
-
song_mc.select_btn.onDragOver = function(){
-
over_node = this._parent.node;
-
dragline_mc._y = playlist_mc._y + this._parent._y;
-
}
-
-
song_mc.onMouseUp = function(){
-
if (this.onMouseMove){
-
delete this.onMouseMove;
-
dragline_mc._visible = false;
-
highlight_mc._visible = false;
-
if (this.moved){
-
this.node.moveBefore(over_node);
-
GenerateSongListing(playlist_xml, playlist_mc);
-
}
-
}
-
}
-
-
song_mc.select_btn.onRelease = function(){
-
if (!this._parent.moved){
-
SetSong(this._parent.node);
-
}
-
}
-
-
}
-
}
-
-
-
var playlist_xml = new XML();
-
playlist_xml.contentType = "text/xml";
-
playlist_xml.ignoreWhite = true;
-
playlist_xml.onLoad = function(success){
-
if (success){
-
GenerateSongListing(this, playlist_mc);
-
}else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
-
}
-
playlist_xml.load("../xml/playlist.xml");
-
-
dragline_mc._visible = false;
-
highlight_mc._visible = false;
-
I'm sure it's just a simple issue. Something that I'm not aware of or haven't done properly. I'm a total newbie with XML and Actionscript and have tried most everything I could think of but so far no answers. Can anyone help?
Cheers.
Jack.
0 2234 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Emil |
last post by:
This is my problem:
I'm writing a script that...
1. creates a customized pls/m3u playlist
2. sends the pls or a m3u playlist to the webbrowser.
The browser should open Winamp/Windows Media Player and load the
downloaded playlist.
|
by: Randy |
last post by:
Flash Remoting is a way for Flash applications to make "native" method
calls in Action Script to a server side program, using the AMF binary
format.
Flash has commercial versions of a Flash Remoting servers. There are
open-source alternatives for php, java, and perl. But alas, no
Python.
Does anyone have any interest in a project like this? It would be
port for the most part; the AMF format is already well known. In
|
by: Konaje |
last post by:
Hi,
I am creating a web application for slideshow. Idea is to create a
playlist of different media files like JPG/SWF/MOV etc. and play them
one after the other.
For flash files I can not depend on duration, but I need to display the
flash movie entirely before I switch to the next media file.
Can someone please guide me, how to get the end point of a flash file
using C#/Flash/HTML.
|
by: manoj |
last post by:
hi,
I am developing a Player like windows media player.
I added some components from WMP.
I want to load a playlist directly when .wpl file is
loaded , can some one tell me how to do it.
for example
to add a song ::
Playlist.appendItem(Player.newmedia(url)));
|
by: Tony |
last post by:
I'm working on project that plays movies using Windows Media Player and
I'm controlling everything with JavaScript. Per the client I only need
to support IE 6 or greater which happens to make things a bit easier.
What I need to do is create a playlist and play it using JavaScript. I
keep on getting close but not close enough to play the dang files. Has
anyone done this before and can shed some light on what worked for them?
| |
by: crisscross27 |
last post by:
Hi, I found a page called "myflashfetish" where you chan choose mp3 players for my space, well the problem is this, I wanted to place 2 or more players in myspace in a particular place, I read another sources how to do that, so i tried to add "position:absolute;left:525px;top:250", i succeed moving the first player but i couldn´t move the second, in change it appears besides the first one every time i move the first one, could you help me? how...
|
by: thomasc |
last post by:
Hello,
This question is about VB.NET2003.
I have a WindowsMediaPlayer Control on a windows form.
Now I want to create a playlist for the control so it plays
all the media files specified in the playlist. But I haven't
been able to how to create a playlist and make my WindowsMediaPlayer
Control play it.
|
by: jiwas78 |
last post by:
Hey there.
I am learning XML and Actionscript.
I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like:
<?xml version="1.0" ?>
<playlist>
<song title="Alliance" artist="Jack Hammer & B Mac" src="../content/music/Alliance.mp3" />
<song...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |