Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I always seem to find what I need in previous threads without starting my own. I have started a couple but that's it..."

Geography

Where in the world do Tek-Tips members come from?
MrGNewport (Instructor)
30 Jun 10 16:04
I have created a media player but am encountering the folowing error: Error opening URL 'file:///C|/Program%20Files/xampp/htdocs/rro2/player/undefined'

I have used the following AS2.0:

CODE

strImage = "germany.png";
loadMovie(strImage,picture);

stop();
playlist = new XML();
playlist.ignoreWhite = true;
playlist.load("../history/germany/playlist.xml");
playlist.onLoad = function(success)
    {
    if (success)
        {
        _global.songtitle = [];
        _global.songtrack = [];
        _global.songfile = [];

        for (var i = 0; i<playlist.firstChild.childNodes.length; i++)
            {
            _global.songtitle[i] = playlist.firstChild.childNodes[i].attributes.name;
            _global.songtrack[i] = playlist.firstChild.childNodes[i].attributes.track;
            _global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
            }
        }
        _root.createEmptyMovieClip("sound_mc", 1);
    };
    
function timer(sound_obj)
    {
    time = sound_obj.position/1000;
    min = Math.floor(time/60);
    min = (min<10) ? "0"+min : min;
    sec = Math.floor(time%60);
    sec = (sec<10) ? "0"+sec : sec;
    timeDisplay_txt.text = min+":"+sec;
    }
    
MovieClip.prototype.songStarter = function(file, song, track)
    {
    if (this.sound_obj)
        {
        this.sound_obj.stop();
        delete this.sound_obj;
        }
    
    this.sound_obj = new Sound(this);
    this.sound_obj.loadSound(file, true);
    
    this.onEnterFrame = function()
        {
        if (this.sound_obj.position>0)
            {
            delete this.onEnterFrame;
            this._parent.titleDisplay_txt.text = "'"+song+"'";
            this._parent.trackDisplay_txt.text = track;
            this._parent.timeDisplay_txt.text = "00:00";
            timeInterval = setInterval(timer, 1000, this.sound_obj);
            }
        else
            {
            this._parent.titleDisplay_txt.text = "Loading...";
            }
        };

    this.sound_obj.onSoundComplete = function()
        {
        clearInterval(timeInterval);
        this._parent.timeDisplay_txt.text = "00:00";
        (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr], songtitle[song_nr], songtrack[song_nr]);
        };
    };
    
play_btn.onRelease = function()
    {
    clearInterval(timeInterval);
    this._parent.timeDisplay_txt.text = "00:00";
    _root.playHead._x = 7;
    this._parent.sound_mc.songStarter(songfile[song_nr], songtitle[song_nr], songtrack[song_nr]);
    };
    
stop_btn.onRelease = function()
    {
    clearInterval(timeInterval);
    _root.playHead._x = 7;
    this._parent.timeDisplay_txt.text = "00:00";
    this._parent.titleDisplay_txt.text = "";
    this._parent.trackDisplay_txt.text = "";
    this._parent.sound_mc.sound_obj.stop();
    };

This loads this XML file:

CODE

<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song name ="End of WWI and the Treaty of Versailles" track ="1" file="history/germany/01 End of WWI and the Treaty of Versailles.mp3" />
</songs>

I note the corrupted path but cannot see where it is deriving the full path from and therefore how to limit it to a relative path; which is what I was hoping for.

Any ideas anyone?
oldnewbie (TechnicalUser)
1 Jul 10 8:34
playlist.load("../history/germany/playlist.xml");

Have you tested this online with the same folder structure?

Relative paths like those have never worked for me when testing locally, only online.

Regards. CLICK HERE TO DONATE.

VISIT MY FORUM
TO GET YOUR OWN FREE WEBSITE HOSTING

MrGNewport (Instructor)
1 Jul 10 10:12
I have indeed.

The thing is that the image that this loads and the XML file are all loaded without issue.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close