![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
When I load an mp3 using the Sound component, with the relative path
"medias/test.mp3", it works. When I try to load a flv using the VideoDisplay component, with the relative path "medias/test.flv", it doesn't work! VideoDisplay seems to build the path to the flv from the directory where the .swf is, not from where the webpage is... Webpage is : /blabla/index.html Swf path is: /blabla/swf/main.swf Medias path: /blabla/medias/... Is there a way to tell the VideoDisplay component to load a relative path starting at the level where the webpage is? Thanks in advance! |
| Sponsored Links |
|
|||
|
"tata668@gmail.com" <webforumsuser@macromedia.com> wrote in message news:gdilgt$qku$1@forums.macromedia.com... > When I load an mp3 using the Sound component, with the relative > path > "medias/test.mp3", it works. > > When I try to load a flv using the VideoDisplay component, with the > relative path "medias/test.flv", it doesn't work! > > VideoDisplay seems to build the path to the flv from the directory > where > the .swf is, not from where the webpage is... > > Webpage is : /blabla/index.html > Swf path is: /blabla/swf/main.swf > Medias path: /blabla/medias/... > > Is there a way to tell the VideoDisplay component to load a relative path > starting at the level where the webpage is? Relative paths are_always_ relative to the swf, regardless of the media type. Note that media is actually _already_ plural ;-). So try: "./medias/test.flv" or possibly "../medias/test.flv" |
|
|||
|
Have almost the same problem:
public class SoundPlayer extends Sprite { private var url:String = "sound.mp3"; private var soundFactory:Sound; public function SoundPlayer() { var request:URLRequest = new URLRequest(url); soundFactory = new Sound(); soundFactory.load(request); } } sound.mp3 file is placed in the same directory as flex-config.mxml SoundPlayer class is in /sample package. However, when I use something like [Embed(source="sound.mp3")] in my mxml file, it works well. Could you please help me how to resolve it? =( |
|
|||
|
This does not precisely answer the question, but...
I got so tired of wrestling with relative path issues that I began passing "root urls" in to my application via flashvars in the html wrapper. This lets me have multiple apps reunning from the same code base by having multiple versions of the html wrapper. It also supports multiple launch configurations from within Flex Builder. I no longer have any pathing issues. Tracy |
|
|||
|
Tracy
Sounds like an excellent idea. Can you please post a quick example? I run into the problem that I keep having to change the path to my xml depending on if the file is local or on one of the test servers, so this might help there. |
|
|||
|
Tracy
Sounds like an excellent idea. Can you please post a quick example? I run into the problem that I keep having to change the path to my xml depending on if the file is local or on one of the test servers, so this might help there. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise