dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Useless Newbie needs help on button cmds!

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    4

    Useless Newbie needs help on button cmds!

    Okay...i'm sorry. I'm an absolute newbie, but as hard as i try i just cannot find this answered anywhere properly.

    I want to make a simple cross platform (PC & Mac) desktop button/menu in Flash that simply opens a selection of network folders.

    I can do this really easily for a PC using the get url command on a PC, but i just can't seem to replicate this command on a Mac.

    My only fear is that the info i did track down seems to say that from a Mac?? due to security reasons, you can only do this if you put everthing under a 'fscommand' subfolder and that's no use to me!
    Is this correct?

    If so, how come it's so easy to connect using a Flash button to any folder on our network drive on a PC?

    I know this is absolutely moron level, but some advice would be greatly appreciated.
    I just want to create a simple no-brainer button push for a number of people here to access certain folders that will be buried under difficult to find navigation otherwise for them.

    many thanks , alvin

  2. #2
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    You can still use getURL from the flash player on the Mac, but you must use standard file paths, \ will not work, as it's a Windows only path delimiter.
    So, if you use
    code:
    getURL("file:///Users/");

    on a Mac, it will open the Users folder. The problem is that it does this through the user's default browser (probably Safari), which will open first, and then open the window in the Finder.
    Another problem is that you cannot use relative paths as far as I'm aware, but assuming the drives are just network shares mounted normally, they'll be reference in /Volumes on Mac OS X.
    This means
    code:
    getURL("file:///Volumes/MyNetworkDrive");

    will work, for example.

    The fscommand folder security feature is part of the flash player, it's in both the Mac and PC versions.
    Probably the reason you came across this was because most people prefer to use Applescript to find/open documents through Flash on a Mac.
    The scripts you call with fscommand have to be within the fscommand folder, the actual locations they refer to do not.
    Then the script can be as simple as:
    Code:
    tell application "Finder"
            open file "/Volumes/MyNetworkDrive/"
    end tell
    See the FAQ for how this works.
    Sam



  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    4
    Thanks very much Sam for your advice and help.
    I've only just started playing in Flash and needed to get this little idea up and running ASAP.

    The concepts and language of Flash are of course new to me, so simple jumps in logic i just have to keep re-reading for it to make sense...very frustrating!

    Ok...I understand it would be more elegant on the Mac to use Applescript as you don't have to keep opening Safari as the intermediate, which in turn opens Finder.

    And yes, this is primarily a standard WAN network and the shared drive has already been 'connected' with a name so the Mac can see it from the desktop/volumes area.

    I'm creating this Flash file on a PC and exporting for a Mac, does this mean i need to drop individual applescipt files into each folder area on the network drive i wish to call (if i was going to say have multiple buttons to open multiple folders).

    And...does this also mean i would have to have a navigated path in the button script to find each applescript file buried under a fairly heavy folder path structure (this is across a network drive/main name/program name/something name/folder required...etc.etc.

    And did i read somewhere that there was also a file name/length limitation??, because i've got some long folder paths to link to.

    Your thoughts would be greatly appreciated.

    alvin

  4. #4
    Senior Member SJT's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    2,563
    No, for the applescripts to be called, they need to be within the fscommand folder, which has to be within the same folder as the projector itself. This is the security feature of the flash player you were talking about; it stops flash calling any old executable (e.g. format c:/).
    You'd then call the applescript with fscommand("exec","myscript");
    with the script being like the one above.

    File name length is not an issue, it was 32 characters in Mac OS 9, but that is per actual file name, not the complete path length.

    The one thing i'd say though, is this seems like a large amount of work to reproduce something the OS can do already. Why not create aliases to the folders and place them on the desktop?
    Aliases to folders on network drive in Mac OS X will automatically mount the network drive and locate the folder.
    Sam



  5. #5
    Junior Member
    Join Date
    Oct 2005
    Posts
    4
    Fine Sam, all starting to make sense. I'm itching to get back to the office after this longer w/end break to try the script.

    Regarding your aliases comments... well it's like this - there are approx 14 people accessing this particular network drive.
    There are about 6 Macs and the rest PCs.
    Most of the people are not really comfortable with file structures, especially somewhere like a network drive!

    On this drive we originally created a super folder for the project to last the year for a program we all worked on. Of course within this main folder came individual folders (private) and then many new folder areas to cope with the growing demands of the project. Some private, some view only and some shared (read/write privileges).

    This year it's going to happen again, but we don't have the time (nor the money) to set up some sort of web type interface and a relational database to handle all the many ways the information that's generated could be harnessed into a super file.
    So... what we have has worked well, the only problem has been the unsureness and many to find/drill down/trawl, etc,etc the folders they need to use daily.
    So...i thought well let's clean up the file/navigation and start off with folders that now suit our needs (we've had a year to stabilise) and give everybody a simple multibutton menu that takes them directly to the folders that they need to access with the name of the folder written of course on each button.

    If they get into trouble, they can still go up or down in the folder structure, but at least 9 times out of 10 they are going directly to the folders and able to open the word.docs they need.

    So... that's where i'm coming from.

    regards, alvin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center