View Full Version : How do I open my local 'My Documents' folder from a flash button link?
AdvancedNoob
10-03-2010, 02:39 AM
I browse through several different folders all day at work (...in and out - open and close - minmize maximize - in and out - open and close). It's a part of my job to access these files at random times when needed, but it's getting on my nerves and it's driving me insane.
Of course the simple thing to do is make shortcuts to all of these folders and problem solved; however,...
I wanted to do something a little more fancy than make a boring folder full of shortcuts... ...because staring at your typical boring folder full of icon shortcuts is just not satisfying for me Lol.
I thought if I could simply make a nice clean elegant organized flash template of simply just buttons, then I could link them as shortcuts to these folders the same way (but in elegant style and user friendly ease).
Keep in mind, all I am trying do is open up local folders (not local html files).
I have the flash template tip top, and all the buttons work to real web URL's (google, yahoo, etc..)
However,
None of my local folder shortcuts will open up.
I test the link in my browser and it works. I test it in windows explorer and it works, but when I place that same link in my XML file nothing happens.
Here is an example link from XML file:
<button name="HOME" linkType="_blank"link="C:\Users\Anonymous\Documents" />
Does anybody know how to a link local folder in an XML document? Surely this is far too simple to be impossible, I just can't seem to get it right though.
I can provide whatever you need me to give you a visual of what I'm looking at.
Thanks in advance for anyone who resolves this for me.
bluewalrus
10-03-2010, 05:35 AM
You need to call it via "file:///" because it isnt on the http or ftp protocols.
<button name="HOME" linkType="_blank" link="file:///C:\Users\Anonymous\Documents" />
I think would do it, dont have access to a pc right now that also assumes
<button name="HOME" linkType="_blank" link="http://www.google.com" />
loads google into a new window.
jscheuer1
10-03-2010, 11:55 AM
You may even need:
file://localhost/C:/Users/Anonymous/Documents/
In any case, the slashes must all agree (all / or all \). IE will sometimes accept \ for local files, but even it will sometimes balk at that. Other browsers do not accept \ for anything.
In an xml file, depending upon how it's being interpreted, \ may be seen as an escape character. If so, it's skipped.
There are security restrictions on Flash that are greater than those on browsers. These may or may not be a factor here.
If having:
a boring folder full of shortcuts
is all you want to avoid - Once you have your shortcut, you can choose any icon you like for it. You can even make your own. Icon files (.ico) may be constructed with numerous sized icon versions inside them. These can each be different, or simply different resolution versions of the same image. Which version is used in the folder view depends upon the OS and the view settings for that folder. By playing with the two parts of this that you can easily change (the icon file and the folder view), you can get a fairly interesting looking interface.
Even without making your own .ico file, there are many many icons to choose from in Windows icon libraries both on your computer already in the library offered for a program with no internal icons and in the various programs around your hard drive that have icons. Also, icons and icon libraries may be downloaded from the web.
AdvancedNoob
10-03-2010, 04:18 PM
First of all I would really like to thank the bluewalrus and jscheuer1 for giving me a few toys to play with (the lines of code), it really does help to know you have support with techinical issues like these.
What Ive found actually works is:
<button name="HOME" linkType="_blank" link="file:///C:\Users\Anonymous\Documents" />
-(and or also)-*they both work
<button name="HOME" linkType="_blank" link="file://localhost/C:/Users/Anonymous/Documents/" />
However, the URL's to real web pages only open up if I upload the template to my server (but the local links do not).
No worries on that though, because I can use local batch files to call the real URL web pages (even though I have that "Run - Save" security warning each time).
My next question though however, is now that I have successfully found a working local link, now it seems the local link only opens up behind the browser page I'm opening it from.
Is there anyway I can code this to open up the window front and center right in front of my template so that it pops up right in front without me clicking the window to the front?
bluewalrus
10-03-2010, 04:28 PM
Removing linkType="_blank" should make it load up in your current window.
jscheuer1
10-03-2010, 04:35 PM
I don't know enough about Action Script to say. But in javascript (for IE and Firefox only) that would be focus(). You would obtain a reference to the window and do:
win.focus();
Generally whenever the browser opens a new window it gains focus unless you are simply populating an existing window, in which case it maintains the level of focus it has. Are you sure you are opening a new window, or are you just changing the 'page' in an existing one.
But it might have to do with what is opened. If it's an Internet Explorer browser window, it should be fine. If it's Windows internal Explorer (file manager type thingy), tough to say.
AdvancedNoob
10-03-2010, 05:16 PM
Here is one thing I didn't mention for the sake of everyone thinking I was nuts. Lol
This flash template is in an excel file. Lol That's right, I'm calling all of these local folders from a flash template in a web browser object embedded within an excel file.
...yeah.. what the??? lol
Of course you may be wondering why... and that's because I work with this excel file in addition to these folders. The opening and closing of folders and back and forth to this excel file makes me dizzy as much as I do this from day to day at work.
Consolidation, speed, and compact ease is my primary focus.
That's why I'm trying to consolidate all shortcuts and folders in this excel file in one place. My goal is to leave this excel file as few times as possible.
To bluewalrus: When I remove linkType="_blank", it opens the folder up actually in the excel file. You would think this would be all fine and dandy for me; however, when the folder is opened in the actual excel file window itself I have no back folder browser buttons, and to make matters worse they default in "tile folder view".
You can call me picky or borderline OCD, but I work fast in and out of these folders and I can't quickly see the folder I need to jump into in a matter of seconds if they're in "tile view". Not to mention if I can't back out of any folder once I dive into one.
What I'm doing may sound ridiculous. But believe me the code you guys have already helped me with is almost there, and the progress I could make with this excel flash consolidated web template is substantial.
This is the most simple complicated idea I've ever come across.
jscheuer1
10-04-2010, 12:54 AM
I still think the solution might be in the ActionScript used to make the swf you are using. ActionScript is derived from javascript, so perhaps there is an equivalent for focusing the window once it's opened.
However, throwing Excel into the mix might obviate that.
You still haven't answered my question though. What opens? Is it the browser, or the native Windows Explorer (file manager type thing)?
Anyways, I Googled: ActionScript window.focus
and this was the first result that looked promising:
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/html/HTMLHost.html
In it is indicated that the ActionScript method is:
windowFocus
However, that would only focus the current window (Excel in this case). What you might be able to use is:
windowBlur()
to hopefully get the Excel window to recede after launching the new window. I'm not sure exactly how to code that in ActionScript, or if it would work, considering that the Excel window isn't a browser window.
davelf
10-07-2010, 02:44 AM
what happen if i upload that flash file to the server.
Is this script will work and open local my document that everyone click on it?
If that could work out, so i can force someone to open some program to right, in their own computer? like Notepad / Microsoft Office something?
jscheuer1
10-14-2010, 08:00 AM
what happen if i upload that flash file to the server.
Is this script will work and open local my document that everyone click on it?
If that could work out, so i can force someone to open some program to right, in their own computer? like Notepad / Microsoft Office something?
That's an interesting question. I'd have to say no because the browser and/or the Flash plugin should 'know' that's an unsafe operation and either block it or raise a warning, unless the settings on your end (the user's end) were such as to allow it in general or for that domain specifically.
Unsafe because once you run any application on the user's HD, you can potentially run any other.
This would depend upon the browser and/or Flash plugin version (in the case of the browser, also upon which browser it is). In certain cases, the OS itself might block it. And, as I say, upon the settings in those (if any) visa vis allowing that sort of operation.
davelf
10-15-2010, 09:56 AM
ah, i get it. I just think to prank some joke to my friend, hehe.
So back to the question, i don't understand why he use flash instead of java / VB6, the desktop programming. I think it's more simple than flash??:confused:
Is there any reasons for senior programmer to choose, flash / web programming instead java / Visual basic.
jscheuer1
10-15-2010, 10:49 AM
It depends. If you are running these on the client side, Flash is the way to go. It has the widest installed base. If on the other hand everything you are doing is server side, one of the other two, or whatever you are most comfortable with would be far better choices because to do Flash on the server side would probably require a Windows server and interfacing with its browser as a PHP or other server side language's COM object, which can get messy. I'd expect that adding in Flash to the mix could present extra difficulties. With a compiled application in C or whatever, you could use PHP's exec() (or equivalent for other server side languages) on any platform.
As to surprising your friend, if s/he has an older system and hasn't kept their browser and Flash updated, there may still be exploits you could employ. One that might work with any setup though is tricking them into approving the 'attack'.
davelf
10-16-2010, 07:38 AM
hmm, that's make sense.. Thx you
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.