Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path problems

Status
Not open for further replies.

artboy1261

Technical User
Jun 6, 2007
8
US
I've created a flash movie (Intro.swf)
This movie has a navigation loaded into it:
mcLoader.loadMovie("siteNavigation.swf", "_level1")

Both of these movie clips exist in folder main > movieclips
the html file is located in the main folder

I have the paths in the sitenavigation.swf file as:
on(release){
getURL("mypage.html","_self")
} which should call another page from the main folder

when I try to click on the link I get a cannot find the file error in ie. I've tried about every combination of URLs but cant seem to understand how to call these pages. Any insight would be appreciated. Sorry to appear so needy, but I guess I am.
 
Thanks for responding Kenneth,

The navigation works now but only in the Intro movie. Other movie clips which incorporate the same navigation movie clip display but the links dont work. All movie clips are in the same folder with the HTML just outside that folder. all are using an empty movieclip labled mcLoader with the following actionscript
mcLoader.loadMovie("siteNavigation.swf", "0")

I get a "Cannot find file error...Make sure the path or address is correct." If you have some insight into this I'd be grateful to hear it.

 
Thanks Again Kenneth

The error messages are:

Firefox
File not found
Firefox can't find the file at ///server/Users/Name/Desktop/reports/TheLast/theLast/MovieClips/collection.html.


IE
Cannot Find File: ///server/Users/Name/Desktop/reports/TheLast/theLast/MovieClips/collection.html.
Make sure the path or Internet Address is correct.
 
I have the code below:

<div id="flashcontent">
<script type="text/javascript">
// <![CDATA[
var fo = new FlashObject("MovieClips/AFMainMC.swf", "mymovie", "800", "315", "6", "#282921");
fo.addParam("base", ".");
fo.write("flashcontent");// ]]>
</script>
</div>
 
Thanks Kenneth, I really appreciate the help

I tried that but when I do the navigation doesn't show up at all.

The main movies (on pages that aren't the index page) incorporate two other movies, a slideshow and the navigation. They both show up and the slideshow runs the navigation displays with all the rollovers and such but the links just dont work. If I remove fo.addParam("base", "."); neither the slideshow or nav MCs show up.

I have this on the index page:
<div id="flashcontent">
<script type="text/javascript">var so = new SWFObject("MovieClips/mainMC.swf", "mymovie", "800", "315", "6", "#282921");
so.addVariable("variable", "varvalue");so.write("flashcontent");</script>
</div>

This is confusing
 
Sorry I forgot I was the one told you to put [tt]fo.addParam("base", ".");[/tt]!

When you embed the Flash, the hosting HTML page becomes the base of the relative URL even if the SWF is not in the same directory as HTML.

"BASE" attribute is to change that to any directory specified. Setting the BASE to "." means setting the relative URL base to the directry where the SWF sits.

In your case "loadMovie()" wasn't working because the URL specified will not be found using HTML directory as the base.

Setting the BASE to "." solves this issue because the relative URL to the SWF is now based on the SWF directory, not the HTML directory.

But now getURL() is not working because it cannot find the target relative URL based on the SWF directory.

What I usually do is this.
1. Remove "BASE" attribute so that the relative URL base is back to tje HTML directory.
2. Change all the URLs used in the Flash movie to load external assets to:

[tt]this._url.substr(0, this._url.lastIndexOf("/")+1) + "yourAsset"[/tt]

So,
[tt]loadMovie("yourMovie.swf");[/tt]
will become
[tt]loadMovie(this._url.substr(0, this._url.lastIndexOf("/")+1) + "yourMovie.swf")[/tt]

"_url" tells you the location of the movie.

Hope this makes sense.

Kenneth Kawamoto
 
Kenneth,

Thanks a million! That worked great. I can't tell you how much I appreciate the help.

Thanks Again
 
Seems like this may help answer the question I have as well... but I'm missing the connection (if there is one).

I have a FLA movie that loads in other movies from other folders. Then these movies that are loaded in load in images from the folder they come from.

So... I have:

Main Site Folder
> main.swf

>> Sub-Folder01
>>> sub.swf
>>> image.jpg

"main.swf" loads "sub.swf" (from Sub-Folder01) which in turn loads "image.jpg" (also from Sub-Folder01).

However... since the "sub.swf" loads into the "Main Site Folder" directory, I have to hard code the "image" path in the "sub.swf" file. Like this: "Sub-Folder01/image.jpg"

This is bad because I have multiple sub-folders... "sub-folder01", "sub-folder02", etc... etc...
SO... every time I make a new sub-folder I have to edit the FLA file to change "Sub-Folder01/image.jpg" to "Sub-Folder02/image.jpg"

If there is a way to force the "sub.swf" to always get its files from its OWN directory then I could just make one set of files and copy them as many times as I wanted with the image code simply being "image.jpg".

Is this possible?
 
Thanks... I'm trying it now.

My problem (now) is that I've used the "Loader" component and "dynamicTextFeeder" (from flashloaded.com) for all my loading of external stuff for years, so I have to re-learn how to load stuff the other way.

I will let you know if it works! :)
Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top