PDA

View Full Version : Possible to load text with .exe file?


praxxis
08-27-2004, 10:51 PM
Hello all,

I created an intro and mini-web site for a client and used the LoadVars object to apply a CSS style to a text field and then load the text into it.
It all worked out well but now the client wants it to burn it on cds that would autorun, and send it out to potential clients. He wants people who don't have Flash to be able to play the presentation on their computers. I can easily make an .exe that bundles the Flash player with the .swf but it won't load the external text. I could just put the .swf and the text files on a cd and make it autorun but then what about people who don't have the flash player installed on their machine? Is there any way to make the file an .exe that will load the text?

Vince

CyanBlue
08-27-2004, 11:01 PM
Howdy and Welcome... :)

So, the question is how to load text when your Flash movie is a projector file, right???

My answer is that it should work as if it is run from the SWF file... So, there might be something else that's preventing to get it work, maybe??? Something like path to the text file... I don't know... Maybe you want to show some code???

praxxis
08-28-2004, 12:05 AM
Thanks for the quick reply! I am still relatively new at that so the code might not be pretty!
Here is the code to create the two variables I need. One (cssStyles) for the stylesheet to be applied to the text field and one (myLV) to load the text into.

//set up text field
allInfo.html = true
allInfo.condenseWhite = true;

//new variable to load text
var myLV:LoadVars = new LoadVars();
myLV.onData = function(info:String):Void {
allInfo.htmlText = info;
}

//new variable to load style sheet
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("docs/styles.css");

//load style sheet and text
cssStyles.onLoad = function (success){
if(success){
allInfo.styleSheet = cssStyles;
myLV.load("docs/hometext.txt")
}
}

after that I just have code like this on various buttons. This code just loads the document "microSmbusiness.txt" into the variable myLV.

on(release){
myLV.load("docs/microSmbusiness.txt");
allInfo.scroll = 1;
}

It seems to me that the problem is that when you create an .exe file it only includes what is in the .fla. Everything on the stage and in the library is included but as you said a path has to be defined from the .exe to the .txt files. If you or anyone else could figure something out I would appreciate it.

Vince

praxxis
08-30-2004, 03:36 AM
Well it looks like a .exe works the same as a .swf. Cyanblue you had it right. The problem was that I put the .exe in a different folder than the .fla or .swf so that the path written in the as would not work. It all works great now and the client loves it so it all turned out great! This is my first paying Flash gig and I hope there will be many more!

Vince
:D