PDA

View Full Version : [AS2] Loading root directory


inertiat
01-18-2010, 03:43 PM
Hi, if I have this script:

loadMovie("mymovie.swf");

applied to a button in a swf called movie1, with a file structure that looks like this:

Root:
-mymovie.swf
Folder 2:
-movie1.swf

What line of code do I use to make Flash look back one folder and load mymovie.swf? I don't know how to make it look back 1 folder to the root and load the movie from there.

I can't use the full path of my HDD because these files will be burned to a CD and so C:/My Desktop (which is the root folder btw) won't exist any more. Instead I just need to tell Flash to 'look back one folder'. Is this possible?

Many thanks

fulanitok
01-18-2010, 03:53 PM
Hei inertiat,

So if I understand you the "folder 2" is into the "root" folder.

Why not just put the "movie1.swf" into the "root" and the "myMovie.swf" into the "folder 2".

inertiat
01-18-2010, 04:00 PM
Hi fulanitok, thanks for the reply.

I can't do that because basically, mymovie.swf is my portfolio of work. So when the client loads the CD all I want them to see is mymovie .swf and this folder2 which is where all my external content is loaded from. movie1.swf is one of those pieces of work which is to be loaded externally. That piece of work has an exit button, which when pressed I want it to load mymovie back up again, which requires it looking back to the root folder.

I have tried loading the content into a container in mymovie but the playback is very sluggish and it is more desirable for me to open a new swf and then reopen the mymovie from that swf when its finished with. Is it possible to make it look back one folder?

fulanitok
01-18-2010, 04:06 PM
Hei man,

Why not just make a empty .exe where all will be loaded from "folder2", "myMovie.swf" and "movie1.swf" as well.

inertiat
01-18-2010, 04:24 PM
You sir are a genius!
Thanks so much! :D

inertiat
01-18-2010, 05:14 PM
Actually, I have a problem unfortunately.
Loading mymovie.swf from the empty .exe works fine, but when I click on a button to load movie1.swf the window just goes white.
This is odd because if I play mymovie.swf directly, I can go back and forth from mymovie.swf and movie1.swf.

This is what my code looks like:
For the empty .exe I have this placed on the first frame of the timeline:
loadMovieNum("Folder2/mymovie.swf", 0);

In mymovie.swf I have this on the button to go to movie1.swf:
on (release) {
loadMovieNum("movie1.swf", 0);
}

And in movie1.swf I have this on the button to go back to mymovie.swf:
on (release) {
loadMovieNum("mymovie.swf", 0);
}


Any help would be great. I'm using AS2. I'm not a coding master so I don't know exactly what I'm doing :p