all groups > flash actionscript > april 2004 >
You're in the

flash actionscript

group:

Newbie question about 'what is my path'


Newbie question about 'what is my path' Wordscapes
4/21/2004 11:26:46 PM
flash actionscript:
I am pre-newbie at Flash, but am fairly seasoned in XTalk coding and know
intuitively that the following can be done in Flash. But don't yet know syntax
well enough to know how.

I want a simple Flash movie, blank on the first frame with a script that asks
the equivalent of "what is my path?". If the Flash movie is within a directory
named "foo", I want the movie to go to a specific Frame and display a given
text message with a pre-described link. Or if the Flash movie's path starts
with C:/, then I want it to jump to a different frame. Or if my file name is
"blah" the movie would do yet a third thing. There could be a dozen or so such
contexts.

Does anyone have a pointer of where to start, or an example file that does
something similar?

Appreciate any help.

Mark
Re: Newbie question about 'what is my path' d2kagw
4/22/2004 12:15:14 AM
bad news mate,

flash can't access the local file system.
In a case like this, its a good idea to think of flash as beign a page
coded in html, it can load graphics and link to files but unless you have
server side scripting or use some javascript you cant read the file system.

if its ok to have some manual intervention, you could have a text file located
in the same folder as the swf or exe containing:

[i]directory='directory name'[/i]

then just get the flash to read the variables in the file [using loadVars -
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/a
ctionscript_dictionary427.html ]
that way you just need to change the txt file and the swf would grab the
directory name from that.

Hope it helps

Cheers
Re: Newbie question about 'what is my path' mandingo
4/22/2004 12:21:15 AM
I think you will find that Flash is sandboxed and doesn't have access to
determine the path structure that it runs in.

To do that you will need a third party application... screenweaver or similar
is often recommended.

cheers,
AddThis Social Bookmark Button