Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > flash (macromedia) > april 2006 >

flash (macromedia) : loding swf files into swf files


Motion Maker
4/20/2006 10:36:09 AM
Yes, an externally loaded swf can load more external swfs or (media: mp3,
flv, jpg, gif, png) and so on.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Hi,

If i have a swf fil locally which loads a number of other swf files from a
server, can i have the loaded files load other files? I have a tool which
loads
different presentations from different folders but the swf files in the
presentations may them selves load other swf files. Is there a method to
handle
this?

Jesper

Motion Maker
4/20/2006 12:53:04 PM
Still not enough information.

I am guessing you have attached the onPress to the blank movie clip loader.
If so, it is destroyed once you load an external movie or more generally
when you load an external movie into a movie clip or a level all functions,
data, everything is destroyed.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Sorry i didnt explain my self well enough,

My main problem is that when i load movieclips the second time, as far as i
can se flash is having a very hard time handling the path to the movieclips.
So
then i press a movieclip with an onPress function which activates a
(instance).gotoAndPlay() the flash player cant handle the reference to the
instance. Does anyone know how to handle this?

JesperBisgaard
4/20/2006 1:04:29 PM
Hi,

If i have a swf fil locally which loads a number of other swf files from a
server, can i have the loaded files load other files? I have a tool which loads
different presentations from different folders but the swf files in the
presentations may them selves load other swf files. Is there a method to handle
this?

Jesper
JesperBisgaard
4/20/2006 2:57:36 PM
Sorry i didnt explain my self well enough,

My main problem is that when i load movieclips the second time, as far as i
can se flash is having a very hard time handling the path to the movieclips. So
then i press a movieclip with an onPress function which activates a
(instance).gotoAndPlay() the flash player cant handle the reference to the
instance. Does anyone know how to handle this?
JesperBisgaard
4/21/2006 12:00:00 AM
thanks for your reply,

To describe the problem in greater detail:

I work for a company which produces presentations in flash. Each presentation
has a folder of its own on our server and these folders are organised under the
companies who ordered them. The presentations are composed of a number of swf
files which are loaded into a main presentation control file. Now i am looking
to build a tool which can load each of these presentations depending on what
the customer would like to see. I would like this tool to be plased in a folder
of its own so i dont have to place one in each presentation folder.

But my problem is that when i try this i find that most often flash cant
handle the relative paths in the movies loaded by the presentation control
file. Example: If i in the presentation load a file with a graf and the graf
contains a button with an onRelease = function() { instance.gotoAndPlay(2) }
flash has a very hard time determining which movieclip to run the command on.

Is there a way to handle this?
Motion Maker
4/21/2006 9:34:05 AM
Having one player find with relative paths folder grouped or data based
grouped is very doable in Flash.

Look at the _url property for the player and pop off the swf name at the end
and you have the path of the player. Then concatenate the relative paths
from there.

The player base url can be attained with

urlBase = _url.substr(0,_url.lastIndexOf("/")+1)

then you concatenate

Ex:

aChildFolder = urlBase + "theChildFolderName/"
aSiblingFolder = urlBase + "../theSiblingFolderName/"

Then concatenate the swf name to those.



--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
thanks for your reply,

To describe the problem in greater detail:

I work for a company which produces presentations in flash. Each
presentation
has a folder of its own on our server and these folders are organised under
the
companies who ordered them. The presentations are composed of a number of
swf
files which are loaded into a main presentation control file. Now i am
looking
to build a tool which can load each of these presentations depending on what
the customer would like to see. I would like this tool to be plased in a
folder
of its own so i dont have to place one in each presentation folder.

But my problem is that when i try this i find that most often flash cant
handle the relative paths in the movies loaded by the presentation control
file. Example: If i in the presentation load a file with a graf and the graf
contains a button with an onRelease = function() { instance.gotoAndPlay(2) }
flash has a very hard time determining which movieclip to run the command
on.

Is there a way to handle this?

JesperBisgaard
4/21/2006 1:20:34 PM
hi, thanks for the reply.

The problem is: tool.swf loads -> presentationControl.swf which then loads ->
presentationpages.swf

So when i in the try to activate a button in presentationpages.swf though
tool.swf the relative paths will refer to
tool.swf - presentationpages.swf instead of
tool.swf - presentationControl.swf - presentationpages.swf.
fenrisform
4/21/2006 8:42:52 PM
[quoted text, click to view]
here are some actionscripts to load an swf externally into an swf.

onRelease(){
loadMovie("folder_name/clip.swf", mc_holder);
}

or

onRelease(){
this.loadMovie("folder_name/clip.swf", mc_holder);
}

i don't know if this is the one you're looking for but i gotta see your
AddThis Social Bookmark Button