PDA

View Full Version : from .txt to flash to .asp


acperez
07-21-2003, 06:07 PM
Hello,

New to the board, new to flash, you name it I'm a newbee..:D
Anyway,
I have created a flash presentation. I have decided, for updating purposes, to make some of my pages use a dynamic text box with a scroller which receives its data from an .html formatted .txt file. This works fine.

What I need to do is:
Supply a user with a print button on that scene, which will take the data from the .txt file, load it into a pop-up window which will be an .asp page, and automatically prompt the user to print.

I have tried to use the print () with flash and realized that it will only print the part of the dynamic text box that is visible.

Again, the reason I do not want to put it manually into the .asp page is because I want to be able to have anyone update the .txt file which will automatically update both the print file and the dynamic text box.

Any help on this would be greatly appreciated.

Thanks in advance!

jaybee
07-22-2003, 10:46 AM
just launch a popup that contains an asp script that loads the same txt file as the flash movie - it will still only need maintaining in one place....to launch your popup make a getURL action like this:


getURL("javascript:window.open('printFile.asp','','width=2 00,height=200');void(0);");


*there is no space in javascript*

...I don't know asp so can't advise you there...the javascript to print it at that end though is window.print() if that's any help:)

acperez
07-22-2003, 11:25 AM
This is actually a good idea. I tried the actionscript that you suggested and I'm getting two windows. One with the javascript:windowopen in the address bar, and then it opens up the printFile.asp page. Any suggestions? I've successfully used the getURL before, but did not know how to make it open a window to the size that I wanted.

jaybee
07-22-2003, 11:44 AM
have you included the void(0) command? Iy may be worth putting this into a function in some javascript in yr html page then just calling the function, might eliminate some problem, might not, but it always seems nicer to keep javascript out of flash to me....

acperez
07-22-2003, 11:50 AM
Yes, I included the void(0) command. I'll try your suggestion and let you know how it ends up. Thanks for your help.

acperez
07-22-2003, 11:55 AM
Question,

If I get this to work, how do I pass a variable using the getURL?
Would I just input something like:
printURL = http://myTextFile.txt
after the getURL?

The reason behind this is because I want the flash file to tell the .asp file which .txt file to open so I do not have to create multiple .asp pages.

Thanks.

jaybee
07-22-2003, 12:12 PM
put it in the querystring:

getURL("javascript:window.open('printFile.asp?var=1234','' ,'width=200,height=200');void(0);")

still got 2 windows?:confused:

acperez
07-22-2003, 12:22 PM
No kidding about appending the variable to the URL!!! Man, I can't believe I missed that! Please wait until I go outside and kick myself!!!

Ok, I'm back!!

I was in the mindset of thinking Flash loadVariablesNum....

Anyway, I'm still getting two windows.

The first window says:

in the address bar, and:
[object]
in the page itself.

After this page, the correct page is opened.

I don't get it....:(

acperez
07-22-2003, 12:23 PM
OOPS forgot...

The first window says:
javascript:window.open('http://cdt/print.asp?printURL=http://cdt/textFiles/nonExemptBks.txt','','width=500,height=500');void( 0);

in the address bar.

jaybee
07-22-2003, 12:46 PM
its not going to like your url there - try using a relative path or file: if you're opening files locally - you should be able to pass just the file name in the querystring rather the whole path too?

acperez
07-22-2003, 12:55 PM
tried the relative path..

still opens up two windows... :confused:

acperez
07-22-2003, 01:03 PM
Got it..

It was my goof. I was trying to access certain files remotely and keep some of the files on my PC, for ease of development...

Once I put everything up on the server it worked fine... no extra window... kind of weird....

Anyway, now to try to get the .asp file to work...:eek:

thanks for your help....