Google Answers Logo
View Question
 
Q: FLASH - Dynamic base paths ( No Answer,   1 Comment )
Question  
Subject: FLASH - Dynamic base paths
Category: Computers > Programming
Asked by: antiflash-ga
List Price: $25.00
Posted: 26 Sep 2005 12:28 PDT
Expires: 26 Oct 2005 12:28 PDT
Question ID: 572876
We have a swf which has navigation and other UI (a.swf).  From this
file, we dynamically load external swf's (x.swf) based on user
interaction.  The paths to these swf's are stored in a database, and
do not share any common path.

Loading the external movie (x.swf) is no problem, but when a
particular movie has external assets itself (such as flv's etc), file
paths become invalid, since a.swf and x.swf are not on the same
relative path.  Is there a way to dynamically set, or change the base
path for x.swf when its loaded, so that all relative paths for
external assets become valid for x.swf?

Thanks for any help.

Clarification of Question by antiflash-ga on 26 Sep 2005 14:53 PDT
Ok, we have found how to do this with some external javascript...

---------------
m = document["movieID"];
m.base = "newPath";
---------------

Now, can anyone tell me how to do this from within the actual swf (not
using javascript)?
Answer  
There is no answer at this time.

Comments  
Subject: Re: FLASH - Dynamic base paths
From: liquidc-ga on 12 Oct 2005 10:13 PDT
 
Paths can be completely dynamic. Declare a variable on the _root
timeline in your "a.swf" file as follows:

var xPath:String;

Then in your loaded (x.swf) files, you can change that variable to
reflect the path you require:

_root.xPath = "yourPath/";

To load elements in that path, you would have to reference the xPath
variable and then concatenate any additional parameters onto that, as
follows:

loadMovie(_root.xPath + "myMovie.flv", "yourTarget");

Hope this helps, I can get more specific if needed.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy