PDA

View Full Version : How do i Stop the browse folder dialog ?


lyndonboyd
11-14-2003, 11:46 PM
I am trying to save text from an EditField to a text file in
a default directory. How do i Stop the browse folder dialog from opening up. I want to set the default directory myself.
I tried %SrcDir% instead of %FullPath% , but it didnt work.

**trying to save (input)text file to my default directory**

%ObjectText% = EditFieldObject[EditField1].GetText
%page1% = "button1=%ObjectText%&"
TextFile.Write ("%FullPath%\content.txt", "%page1%")
TextFile.InsertLine ("%FullPath%\content.txt", "end", -1)


http://www.flashwebtech.com
:confused:

JimS
11-15-2003, 04:51 AM
I’m not exactly sure what you want to do here. You ask how to stop the browse folder dialog? If you remove it from the page On Show event it will go away. The problem here is that you are using it to set your %FullPath% variable. You’ll need to set this variable a different way if you don’t want to use the browse folder dialog.

%SrcDir% will be whatever folder your project/program is in. It shouldn’t be a problem to write to a file located in the %SrcDir% as long as your finished project/program is located on a writable drive (the user’s hard drive for example) Since CD ROMs aren’t writable, if your project/program will be on a CD instead of the user’s hard drive, you will have to write to a different directory.

Is this a file that will only be written to once, or will the user keep writing to it multiple times? Do you want the user to pick what folder the file gets saved in, or do you want to decide what folder to use as default? Do you want the folder to be the same file that the project/program is located in, or a different folder?

Are you trying to just save the text from the EditField? or do you want the saved text to be preceded by “button1=” and followed by “& End” ?

I’ve uploaded a sample project with a couple of different examples, but since I’m not really sure what you are trying to do, I don’t know if they’ll be much help. Maybe you can describe a bit better what you want it to do. Are you setting it up like a journal? or are using it to set value a single time?

Corey
11-15-2003, 10:40 AM
Hi. In your example it appears you haven't set the value of the variable %FullPath% so it is a blank variable. Try setting the value of that variable to contain a valid folder path.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

lyndonboyd
11-15-2003, 11:44 AM
Thanks Guys,
You both were correct. My AutoPlay Media Studio 4.0 was holding its script functions even after i changed them. I started a new project with the same scripting and it worked , but you both were right. Thanks for the Example JimS. It is what got me to thinking.
I was trying to Write a app that can edit dynamic flash import Text files. I was using MMB but AutoPlay Media Studio is so much better.

I am also trying to create a browse for jpg dialog with preview that allows a user to visually choose a jpg picture then have it copied to a predefined location.

Here is an example of text writing to variable.:D

JimS
11-15-2003, 02:01 PM
Something to think about, the page itself has events that you can set actions to. The page events are On Initialize, On Show, On Close, and On Destroy. Maybe you forgot that you were setting the %FullPath% variable on the page’s “On Show” event. That’s why the folder browse dialog kept coming up.

I’m glad you got it working.

As far as creating a browse for jpg dialog with preview, the preview part will be a bit difficult with version 4. I think that version 5 would make it much easier, because of the dynamic image abilities at run time.

It’s not impossible in version 4, just harder. One way to do it would be to have your project dynamically write a webpage with the picture embedded in it, then show that webpage in a web browser object. Each time the user selects a different picture from the browse file dialog, you overwrite the webpage to embed the new picture, then refresh the web browser object to show the new webpage.

JimS
11-15-2003, 03:20 PM
Here is a sample project with the jpeg browser I suggested above. You might want to check it out for ideas.