Answer the question
In order to leave comments, you need to log in
How to make the flash drive find its components at the right URL?
Initial data
1) There is a spherical flash drive (swf) in a vacuum, consisting of several files.
2) The flash drive is located in a folder on the local computer and works properly
Steps
1) All parts of the flash drive are uploaded to the site in one directory and are available at a certain address www.site.com/uploads/articles/ - by directly accessing the link to the main file - flash drive works
2) The flash drive is inserted into the site page at www.site.com/article/123
3) The flash drive does not work
Problem
Judging by the web inspector logs, the main flash drive tries to find its components based on the address of the final page www.site.com/article/ 123 , i.e. is taken as the basis for the addresswww.site.com/article/ , although this is required to be www.site.com/uploads/articles/ , i.e. the path where the main flash file is actually located.
On the face of an incorrect calculation of the address. Those. the relative path is not taken as desired.
Question
Tell me, how and by what means it is possible to solve the situation that has arisen?
Is it possible to specify some parameters in the flash drive insertion code to solve this?
If not, what needs to be changed in the main flash drive so that the paths to the component files are calculated as expected. Those. based on the actual path of the flash drive, not the page.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
In order not to depend on the location of the components and the loader, it is best to pass the url-s of the component to the flash-loader via FlashVars (specified in the embed code), or by loading the xml-config. But with FlashVars it's easier. They can be accessed via loaderInfo.parameters["variable name"].
Relative url is calculated relative to the address of the page on which the flash drive is launched.
Component urls can be calculated from loaderInfo.url
+ "relative path from the actual path of the flash drive"
Judging by the behavior, relative paths are used, which is not always good, especially when a rewriter is used on the site.
If you plan to use the flash drive on only one site, then you can write paths from the root of the site (you can also without loader_info) in this case
componentPath = "/uploads/articles/" +component.swf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question