Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text entry arguements in Windows run command

Status
Not open for further replies.

kitten

Technical User
May 1, 2001
64
AU
I'm not sure if this is possible!
I want to be able to enter the executable file name into the Windows run command followed by the person's username... so it automatically loads the flash file with the user logged in...
eg: run--> Open: flashfile1 jsmith
(the username is jsmith)
Can this be done, and how would I integrate it into my flash movie?

thanks :)
 
hi kitten

Do you mean from the desktop toolbar (i.e.: Start>Run......)?

WOW! ;-) All I know is that if your file is contained in the windows directory you can call it direct from the Start>Run... dialogue box without have to type in a route to the file. But as far as specifying a user goes, I'm stumped, and I doubt if it's possible at all. No doubt it's a question for another Windows-specific Forum on Tek-tips, but what about logging the user in when the Flash movie opens?

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
You could always do something sneaky, like write a batch file and pass the user as parameter into that (I think you reference it as %1 in the batch file, or something - going daft in me old age ;) ) and then output that to a text file on disk (erm, something like %1 > my_file.txt (don't quote me on that!)) and then call flash... which would read the text file... and voila! Bonjour! and Abergavenny (or however you spell it).

Might work anyway =)

P.
 
Something a bit like this in a file called soemthing like start_flash.bat (or similar!)

------------------

.echo off
echo username=%1 > userfile.txt
flash.exe

------------------
(Obviously without the dashes...)
Just put it in the same directory as flash, or put the directory structure before flash.exe, then run it with:
'start_flash petitpal' from the Start>Run thingy.

It should then create a file called userfile.text with the username in... and I guess you could then load it from flash. You should be able to check the value of %1 as well... and check if no user was entered - but I can't remember how at the moment! Failing that just throw a check into your flash movie...

Hope this is of use... anyway, better stop avoiding work now!!!

=)

P.
 
Thanks so much! :)
I've been trying to figure that out for so long.... I'll go see if your idea works ^-^
 
If you pass parameters (this isn't exactly correct) for example:

//<object file=&quot;hello.swf&quot;>
//<param name=&quot;username&quot; password=&quot;password&quot;>
//</object>

can flash read them? :)
 
Erm.... no idea, sorry. =)
Embedding objects into batch files doesn't work, obviously, because batch files don't have anything to do with anything that isn't arcane or related to DOS 6.1 (or prior)!!!

As far as I know, and this is by no means conclusive, you can't set-up your own parameters to pass into Flash from the HTML file. What you could do though is pass them in the HTML header. So for example when you call the page with your movie on call it with something like:
'my_page.html?username=petitpal&password=petitpal&'.

Obviously this has certain security issues, so you could put the variables into a form on the previous, calling, page and do a submit, which passes them in a 'hidden' way. Again though this has secruity issues.

If you want to do either of these then when you go into the Flash movie you do a 'load variables' jobby and you get the username and password variables passed into your movie from the HTML page.

The only real way to get decent security though is to use something like ASP on an SQL database, or just an SQL database, and process the secruity stuff on the server side. Any client side secruity thing you do with Javascript, etc, is just going to be dodgy.

I suppose the way round it (not that I'm thinking as I'm typing you under stand ;) ) would be (and I know this is a bit of a bodge) to pass the username in via a batch file, or HTML page header / form variable and then have a text file with a list of users passwords. Set-up something like this:

petitpal=petitpal&nigel=havers&username=password&

You could then do an eval() on the username (so it reads the contents of the username variable as a variable in its own right, and then check that when the user enters their password it matches this...

Anyway, that long winded mail brings me to a halt. =)

If i've gone a bit incoherent half way down (which is possible) - just let me know or e-mail me or something =)

bye for now!

=)

PetitPal.
 
Forgot to say (can you believe it with all that!) YOu may be able to pass parameters into a 'Smart Clip'. No idea if this is true, or how you do it - but look about Smart Clips in the Flash help files...

Bye for now!

=)

Petitpal
 
Thanks, you've been so helpful ^-^
I'll give this a go.... I had originally set up a password/username login in flash .... but i thought maybe I could use that....
yeh... i'm trying to avoid using SQL databases though ^-^'''
guess that will be the most secure route to take though... ^-^

thanks so much for your help! ^-^

Kitten ^_-
 
I know this post is ancient now and the problem has probably been sorted, but I did say I would look up the batch file command thing from earlier in the thread; so here it is!

This one should only run flash if a user was entered...

---------------------

@echo off

if &quot;%1&quot; == &quot;&quot; goto nouser

:nouser
echo.
echo Please enter a user name.
goto end

:runflash
echo username=%1 > userfile.txt
flash.exe
goto end

:end
echo.

-----------------

As an alternative, this runs flash regardless, but if will setup the text file with a user if the batch file was called with a &quot;-u&quot; flag...

@echo off
if &quot;%1&quot; == &quot;-u&quot; goto checkuser
goto blankuser

:checkuser
if &quot;%2&quot; == &quot;&quot; goto nouser
echo username=%2 > userfile.txt
goto runflash

:nouser
echo.
echo Please enter username!
goto end

:blankuser
echo username= > userfile.txt
goto runflash

:runflash
flash.exe <moviename>

Anyway, like I say you've probably sorted it, or this idea didn't work at all... but there you go... I said I'd find out and I did *grin*

=)

PetitPal
 
Thanks heaps ^-^

yeh, I have solved it doing something else (html)
but thanks so much... I might test this one to see which is better ^-^

Kitten ^_-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top