Solved

Text file and Flash

Posted on 2002-04-18
14
240 Views
Last Modified: 2010-05-18
Hello everyone,

Here's whay I need to know and if it's possible, for someone to help me set it up.  I need a text files which will serve as a master file for a flash movie.  It needs to be sort of like a database, only that the files are not going to be on the server, they are going to be on a computer harddrive.  What I need to do is to make some text in flash and make them links, but since the links can change I need to create a text file from which the flash will will call upon this text file to pull info from it and place appropriate links in it.  I know how it works when the files are on the server and how to load additional movies into flash and all, but never done this stuff with text and text files.  Is it possible? Please help me out.  Thanks, I really appreciate your help.

--
cyberspy.
0
Comment
Question by:cyberspy
  • 7
  • 3
  • 2
  • +2
14 Comments
 
LVL 5

Expert Comment

by:stef4s
ID: 6953341
so you need to read and/or save to the clients machine?
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6953980
Which is most definitely NOT going to happen. Flash doesn't have that capability.

If they're on the SERVER, fine. If they're on the CLIENT, forget it.
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6954342
stef4s,
I need to create the flash and text file so that the client will use it on his machine to make the changes to the links, that's all.
Thanks.

0
 
LVL 19

Expert Comment

by:webwoman
ID: 6954794
And then what?
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6954810
He needs to have a master file in case the links change or somthing, so he can edit them in this text file and not have to go in the flash demo to do it.  He doesn't have flash and doesn't know how to use it, so I was thinking if this can be done with a text file and variables (?).
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6955441
Should work... you'll have to make sure that everything is in the same folder, but you should be able to do it.

But he'll need all the files, and they'll be on his machine, not on the net for general access. Of course, he could always upload them somewhere...
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6955454
Could you help me set this up? What should be put in the text file? If  this could be done, I need to know how? Thanks.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 4

Expert Comment

by:RoyKruyshaar
ID: 6961234
Hi Cyberspy,

That's easy!

Create a txtfile that looks like:

&var1=blabla&var2=blablabla&var3=bladiebla

now when you use the following actionsscript:

loadVariablesNum ("myTxtFile.txt", 0);

in your flash there wil be three variables named var1, var2, var3 with the values "blabla", "blablabla",
"bladiebla". Now when you create a dynamic txtfield maned var1, var2 and var3, the text is then in the
textfields.

This is the actionscript for Flash 5

Well, this is it, but when you have further questins, please feel free to ask.

Greetings,

Roy
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6961421
Hi Roy,
Thanks for your help.  But how do I make this text have links in it so that anyone can edit these links whenever they need to ?
Thanks.

0
 
LVL 4

Accepted Solution

by:
RoyKruyshaar earned 100 total points
ID: 6962071
Hi Cyberspy,

Suppose that the textfile loks like:

&text1=SearchEngine1&url1=http://www.google.com&
&text2=SearchEngine2&url2=http://www.yahoo.com&

Ehen you load the txt-file, in your flash are the variables text1, url1, text2, url2

Now, when you make a button with the following actionscript:

on (release) {
  getURL (url1, "_blank");
}

Everything has to work.
Dont's forget to check the 'Expression' checkbox.

Greetings,

Roy
0
 
LVL 6

Expert Comment

by:rootdir
ID: 6966464
If you wanted to anyone can edit these links
whenever they need to do then,

you have take those links into flash variables.

Pass those variables to either ASP,PHP page or any serverside scripting page.

Then that page either update or save variables to serverside text file.

You can write clientside text file by calling javascript from flash,  but you have to modify some code bellow

<SCRIPT LANGUAGE="JavaScript1.2">

function setFile(str) {
self.blur();
var frame = new java.awt.Frame();
var dlog = new java.awt.FileDialog(frame, "Save As...", java.awt.FileDialog.SAVE);
dlog.show();
var filename = dlog.getDirectory() + dlog.getFile();
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
var outputStream = new java.io.FileOutputStream(filename);
var writer = new java.io.BufferedWriter(new java.io.OutputStreamWriter(outputStream));
writer.write(str);
writer.flush();
writer.close();
outputStream.close();
dlog.dispose();
netscape.security.PrivilegeManager.disablePrivilege("UniversalFileWrite");
}

</SCRIPT>
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6982636
Hi Roy,

I have just got to making the text file and it works.  Only thing I need to understand how the url thing works.  I have created a dynamic text field in my flash movie and placed action script to load variables and defined the variables.  Now, if I have a url1 as a variable in my text file how is that going to be done in Flash? If my text field is var1, do I create another text field for url1? or how does this work?  what do I make a button and how the var1 text field and url1 are connected? please explain.  Thanks, I appreciate your help.
0
 
LVL 1

Author Comment

by:cyberspy
ID: 6982653
Roy,
I'm thinking maybe you didn't understand completely what I needed...What I need is for the actual word to be a link, like for example "Search Engine", it has to be clickable and to be a link itself not have a url next to it to be clickable. Can this be done? Thanks.

0
 
LVL 1

Author Comment

by:cyberspy
ID: 6989185
I'm gonna give you these points anyway, I basically got how to make this work.  Thanks for your help!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now