Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

mixed up with paths

15 replies [Last post]

COULD SOMEBODY HELP?

THE FOLLOWING WORKS ON MY PC WITHOUT PROBLEMS

<script type='text/javascript' src='../../../vid_player/swfobject.js'></script>

<div id='mediaspace'>This text will be replaced</div>

<script type='text/javascript'>
var so = new SWFObject('http://www.macedonia.org.uk/bakolas/vid_player/player-viral.swf','mpl','587','400','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('file','http://www.youtube.com/watch?v=bLhxLfi5Ccw');
so.addVariable('image','http://www.macedonia.org.uk/bakolas/jpg/bakolas_p1.jpg');
so.addVariable('autostart','true');
so.addVariable('dock','true');
so.addVariable('displayclick','none');
so.write('mediaspace');
</script>

IF I CHANGE THE LINE
var so = new SWFObject('http://www.macedonia.org.uk/bakolas/vid_player/player-viral.swf','mpl','587','400','9');
TO
var so = new SWFObject('../../../vid_player/player-viral.swf','mpl','587','400','9');
IT DOES NOT WORK.

THE SAME APPLIES IF I CHANGE
so.addVariable('image','http://www.macedonia.org.uk/bakolas/jpg/bakolas_p1.jpg');
TO
so.addVariable('image','../../../jpg/bakolas_p1.jpg');

DO I HAVE TO USE ABSOLUTE LINKS TO URL

THE REASON I WANT TO USE RELATIVE LINKS IS BECAUSE THE PAGES ARE LOADED TO A NUMBER OF DIFFERENT DOMAINS AND I DO NOT WANT TO HAVE TO CHANGE THE
http://www.macedonia.org.uk
EVERY TIME
THANKS

Hi Chris,

You need to make sure that all of the files you are referencing in the paths actually exist.

Where are you running this code?

Best,
-Ethan

Hi Chris,

You need to make sure that all of the files you are referencing in the paths actually exist.

Where are you running this code?

Best,
-Ethan

Hi Ethan,

Thanks for the reply.

All the files exist OK. If you notice when I use the exact path i.e. http://www.macedonia.org.uk/bakolas/vid_player/
in the line
var so = new SWFObject('http://www.macedonia.org.uk/bakolas/vid_player/player-viral.swf','mpl','587','400','9');
It works.

If I change it to ../../../ i.e. yhe line in the html file is now
var so = new SWFObject('../../../vid_player/player-viral.swf','mpl','587','400','9');
IT DOES NOT WORK.
The files are there - thats why it works in the first case.

In the first case it spells out the path while in the second it is refferenced to it.

Hi Ethan

the above code can be seen at
www.macedonia.org.uk/bakolas/sound_vision/vision/ioannou/ioannou.htm

look at the lines of the code

var so = new SWFObject('http://www.macedonia.org.uk/bakolas/vid_player/player-viral.swf','mpl','587','400','9');

and

so.addVariable('image','http://www.macedonia.org.uk/bakolas/jpg/bak_politistika');

Hi Chris,

www.macedonia.org.uk/bakolas/sound_vision/vision/ioannou/ioannou.htm works fine.

What is the issue?

Best,
-Ethan

Hi Ethan,

thanks for the reply. Of course it works. But please read the comment bellow.

look at the lines of the code

If you notice when I use the exact path i.e. http://www.macedonia.org.uk/bakolas/vid_player/
in the line
var so = new SWFObject('http://www.macedonia.org.uk/bakolas/vid_player/player-viral.swf','mpl','587','400','9');
It works.

If I change the exact path to ../../../ the line in the html file is now
var so = new SWFObject('../../../vid_player/player-viral.swf','mpl','587','400','9');
IT DOES NOT WORK.
The files are there - thats why it works in the first case.

In the first case it spells out the path while in the second it is refferenced to it.

Can I avoid using the exact path and use the relative instead? I host the site in a number of servers and if I can use the relative address it will save me a lot of work.

Thanks

It should work with relative as well. Can you put up a demo where it is not working using relative paths? Thanks.

Hi Ethan,

you are right. I works. But It did not in the past. Maybe I was missing something. Sorry to have bothered you.

you can see it at the following link
www.bakolas.gr/sound_vision/vision/balkanika/balkanika 1 test.htm

One last thing
If I run the htm locally on my hdd, it loads the player, it displays the jpg to be displayed during loading (ie the so.addVariable('image','../../../jpg/bak_politistika.jpg');)
but I then get an error #2035 and no loading from Utube.

If I use exact paths with complete urls it works fine.

Any ideas?

many thanks again

Chris

It works here - http://www.bakolas.gr/sound_vision/vision/balkanika/balkanika%201%20test.htm

It will not work locally because you are trying to connect to YouTube and the file is only local on your computer.

Hi Ethan,
I do not quite understand your response.
The call for the player is as follows.

<script type='text/javascript'>
var so = new SWFObject('../../../vid_player/player-viral.swf','mpl','587','400','9');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('title',' Balkanika Prize 1999 ');
so.addVariable('description',' Balkanika 1999');
so.addVariable('file','http://www.youtube.com/watch?v=Goj3rA3UHbU');
so.addVariable('start','00:24');
so.addVariable('image','../../../jpg/balk 1999.jpg');
so.addVariable('autostart','true');
so.addVariable('dock','true');
so.addVariable('displayclick','none');
so.write('mediaspace');
</script>

When I run it locally, the player loads, the image in the addVariable IS LOADED, and I then get the error #2035.
The addVariable for the 'file' to be dispayed is an http address and I am always connected to the web via ADSL. So the Utube file can be loaded.

But is is not loaded.

Why do I get the error #2035 message and what does this error mean?

Rgrds

Chris

Error 2035 is the error that the file cannot be found, or the stream cannot be found. I would expect this to happen since you are running it locally.

Even when the file is defined by a URL?

so.addVariable('file','http://www.youtube.com/watch?v=Goj3rA3UHbU');

Is there something in the code of the player that strips the above URL, when it runs locally?

Thanks

Since you are running locally, and trying to connect to YouTube, that is why it is not working. This is due to a Flash Security. If you are running it from a website or at least on a server, it should work.

It is clear now. Thank you very much for your time.

NP! :)