logo-dw

Go Back   Dreamweaver Club Forums > Graphic Design > Flash
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-11-2010, 02:20 AM   #1
kearnsy
 
Join Date: May 2009
Location: Liverpool
Posts: 164
Default Linking to an xml file to display swf content

Right, i'm not sure if what i'm trying to do is what's meant to happen, but here goes.

I've downloaded an xml file thats linking to an swf file for an experiment, so what i've done is, made a couple of div tags, and i'm trying get the swf file to display the content that's inside of the xml file to show up when i preview it in the browser.

i get an error saying 'error opening data.xml'

what's meant to happen is the swf file is supposed to display what i've typed inside of the xml file. when i play the swf on it's own it works fine. I just can't work out how to embed it into the html in dreamweaver

i've tried linking the swf file to the xml file in the src properties, but that doesn't seem to work

any ideas on what to do folks?

thanks
kearnsy is offline   Reply With Quote
Old 02-11-2010, 10:50 AM   #2
kearnsy
 
Join Date: May 2009
Location: Liverpool
Posts: 164
Default

Any help with this ladies & gents?

is even what i'm trying to do possible? or do i have to start with an xml file?
kearnsy is offline   Reply With Quote
Old 02-12-2010, 09:10 AM   #3
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by kearnsy View Post
Any help with this ladies & gents?

is even what i'm trying to do possible? or do i have to start with an xml file?
Can you post a link or your code, so that we can see what you have embed so far in your HTML?
gentleone is offline   Reply With Quote
Old 02-12-2010, 03:22 PM   #4
kearnsy
 
Join Date: May 2009
Location: Liverpool
Posts: 164
Default

I've erased the file now sorry gentleone

Basicaly, i was trying to understand how the relationship works between an embedded swf file and an xml file inside of a html file,

i was having trouble getting the swf to display the text inside the xml file,

Does anyone know how to do this?

Merci.
kearnsy is offline   Reply With Quote
Old 02-12-2010, 05:51 PM   #5
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Moved to Flash
domedia is offline   Reply With Quote
Old 02-12-2010, 06:02 PM   #6
kearnsy
 
Join Date: May 2009
Location: Liverpool
Posts: 164
Default

aha, so is this a flash issuse then domedia? and not a html or xml issue?

it's driving me mad, i just can't work out what to do.

i'll insert the code of a new experiment i'm doing. all i want to do is just get the html page to display the swf and the data from the xml.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>

<body>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="575" height="350">
  <param name="movie" value="record_player2.swf" />
  <param name="quality" value="high" />
  <param name="wmode" value="opaque" />
  <param name="swfversion" value="7.0.70.0" />
  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you donít want users to see the prompt. -->
  <param name="expressinstall" value="Scripts/expressInstall.swf" />
  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="record_player2.swf" width="575" height="350">
    <!--<![endif]-->
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="7.0.70.0" />
    <param name="expressinstall" value="Scripts/expressInstall.swf" />
    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
    <div>
      <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
    </div>
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>
<script type="text/javascript">
<!--
swfobject.registerObject("FlashID");
//-->
</script>
</body>
</html>

all i've done folks is dragged the swf file into a blank html document.


here's the xml file data....


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- TURN AUTOSTART TO "yes" OR "no", BGIMAGE TO "wood", "cement", "other" or LEAVE IT BLANK and ROTATION VALUES SHOULD BE KEPT BETWEEN 20 AND 40 -->
<player autoStart="yes" bgImage="image2">
    <song path="music/tune1.mp3" title="Wild Nights" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="20" art="art/cover.jpg" volumeNum="95" />

<song path="music/tune2.mp3" title="Gang Trouble" artistName="Station 8 and the Sundays" albumName="Goin' All the Way" rotation="22" art="art/cover2.jpg" volumeNum="95" />

<song path="music/tune3.mp3" title="Livin' in te Hood" artistName="Station 8 and the Sundays" albumName="Fire and Ice" rotation="24" art="art/cover1.jpg" volumeNum="95" />
   
 <song path="music/tune1.mp3" title="Tender Thoughts" artistName="Station 8 and the Sundays" albumName="Double Trouble" rotation="26" art="art/cover.jpg" volumeNum="95" />

<song path="music/tune2.mp3" title="Touchy, Aren't You?" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="28" art="art/cover.jpg" volumeNum="95" />
   
    
<song path="music/tune3.mp3" title="The Crying Game (Redux)" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="30" art="art/cover.jpg" volumeNum="95" />

<song path="music/tune1.mp3" title="Fishing for Love" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="32" art="art/cover2.jpg" volumeNum="95" />

<song path="music/tune2.mp3" title="Common Area" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="34" art="art/cover1.jpg" volumeNum="95" />
    
    
<song path="music/tune3.mp3" title="The Sky's Not the Limit, Fool" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="36" art="art/cover.jpg" volumeNum="95" />

<song path="music/tune1.mp3" title="ZZ Top Ain't Got S**T on Me" artistName="Station 8 and the Sundays" albumName="See You on the Flip Side" rotation="38" art="art/cover2.jpg" volumeNum="95" />

<song path="music/tune2.mp3" title="2 for the Road (and 1 for the Fuzz)" artistName="Station 8 and the Sundays" albumName="Too Much Too Soon" rotation="40" art="art/cover1.jpg" volumeNum="95" />

</player>




Here's the help file that the guy included with the download

Quote:
Hi All,

Thanks for downloading my Record MP3 Player!

Below is a breakdown of some of the editable features the player offers and a few general notes.

GENERAL NOTES:
YOU DO NOT NEED THE FLASH APPLICATION TO USE THIS PLAYER. You can add it to your html page, as is, and simply edit the xml info. The Flash movie is set to run on Flash Player 7 and above. There is a blank record, with no artwork in the images/flash images folder if you'd like to create your own artwork. The file is larger for that reason and needs to be scaled for adding to the fla.

XML:
In the xml document you can add info for:

1. MP3 Path
2. Song Title
3. Artist Title
4. Album Title
5. Needle Rotation Value
6. Album Cover Art
7. MP3 Volume

You can also set the player to Autostart (yes or no or random) and load an external jpg as a background for the swf.

MP3 Path:
Make sure the path name is exact - in relation to your swf. If you take the music out of the music folder, make sure you note that in the xml.

Song - Album - Artist Title:
Letters or Numbers

Needle Rotation:
Keep the rotation between 20 and 40 to keep the needle on the record. Use whatever number between those 2 you'd like.

Album Cover Art:
Make sure the path name is exact - in relation to your swf. If you take the art out of the art folder, make sure you note that in the xml. Thumbnail size for the art should be 95x95. And needs to be normal jpg format. NOT A PROGRESSIVE JPG!

bgImage:
This changes the background image in the swf. Inserting "image1" loads the image1.jpg texture from the images folder. "image2", the image2.jpg texture. "other" is for an alt bg image of your choosing (name it image3.jpg) or you can leave it blank for the default gradient bg. The bg is 575x350. And the images needs to be jpg as well. DO NOT CHANGE THE NAME OF THE IMAGES FOLDER OR REMOVE THE BG IMAGES FROM THAT FOLDER - THE PATH IS HARD CODED IN THE THE AS.

MP3 Volume:
Since mp3 volume can be all over the place, I've set it up so you can set a separate volume value for each mp3.

Final xml note: make sure to always keep the xml doc in the same folder as your swf.

THE FLASH (FLA) FILE:
If you do choose to edit the flash file all the code is fairly well commented. You can change the record effects. Or remove the record sounds outright. You can easily change font types and colors and rearrange the elements to match your design needs.

Well, I believe that's it.

here's hoping someone can help, i've been trying for 24 hours to get it to work.

Last edited by kearnsy; 02-12-2010 at 06:05 PM.. Reason: forgot something
kearnsy is offline   Reply With Quote
Old 02-12-2010, 06:53 PM   #7
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Maybe I jumped the gun. But you're having issues displaying the swf, right?
domedia is offline   Reply With Quote
Old 02-13-2010, 02:11 PM   #8
kearnsy
 
Join Date: May 2009
Location: Liverpool
Posts: 164
Default

Pretty much yeah, I figured it out in the end after many hours of googling.

In case anyone has the same problem in the future the answer is...

All of the files have to be in the same folder.

that's the xml file, the swf file, and the page you're trying to display the swf file on

The problem i had was, my index file that i was trying to display the content on was in a different folder to the xml and swf, put them all in the same folder....problem solved.

It's amazing how something as simple as that can cause hours of headaches.
kearnsy is offline   Reply With Quote
Old 02-13-2010, 04:50 PM   #9
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
Originally Posted by kearnsy View Post
All of the files have to be in the same folder.
That's exactly what the developer said in the help file
Quote:
Final xml note: make sure to always keep the xml doc in the same folder as your swf.
gentleone is offline   Reply With Quote
Old 02-13-2010, 09:42 PM   #10
gentleone
gentleone's Avatar
 
Join Date: Nov 2009
Location: Rhodes, Greece
Posts: 2,837
Default

Quote:
The problem i had was, my index file that i was trying to display the content on was in a different folder to the xml and swf
Oh and... you can have your page in a different directory as long as you change the paths in the flash object script.

So your page is in the root directory, but for example you have your swf, xml and mp3's in the directory 'audio', then your paths to the swf file in the flash object script should be like this:
Code:
<param name="movie" value="audio/record_player2.swf" />
And in the IE version underneath like this:
Code:
data="audio/record_player2.swf"
The swf and the xml file has to be in the same directory, because the path to the xml file is in the swf file and the developer linked it probably so that they have to be in the same directory. You can change this path as well, but then you have to edit the fla file and publish it again in Flash, but why should you
gentleone is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com