?
Solved

Flash, Forms and LINE BREAKS

Posted on 2003-03-02
12
Medium Priority
?
293 Views
Last Modified: 2012-06-27
I'm using FLASH on my ASP site and am having a small formatting problem.

Any help would be much appreciated.

I have a flash input box on one page. It submits to another page (with another flash form) where users can Verify what they typed in before they submit it.

My problem. - How can I keep the Line Breaks between pages?

On the first form the content is entered like this…

“Hello world

Hello again”

But after I submit it to the second flash form (dynamic text box with variable) it looses all of its formatting and ends up like “Hello worldHello again”

Any Ideas?

Multiline is ON in the flash files..
Form is submitting with ‘get’ action.

I guess in short what I'm trying to do is Submit one flash form to another while keeping all paragraph breaks.

gawd it's urking me.

thanks
Rob101
0
Comment
Question by:Rob101
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
12 Comments
 
LVL 5

Expert Comment

by:elhy
ID: 8055889
do you mean this?:

- page1.asp contains the input box.
- page2.asp contains another flash form
- you passed the values of the input box to page3.asp then pass back to page2.asp?

or

- you passed the values of the input box straight to page2.asp?
- How did you do your passing of variables?
- What method did you use when passing the values? "GET" or "POST"?
0
 
LVL 6

Expert Comment

by:henryww
ID: 8056727
hi Rob101,

if u are having a page only for user confirmation u don't have to submit to another file

1) page1.asp -> flash form (input fields - text boxes) -> "submit" button goes to another frame -> flash text (static label only) -> confirm (this does the real submit) -> page2.asp

2) did u escape the text before u send it? if not it will disappear in the querystring, escape the text "CR" becomes %0D then u have to play around with it depends on where u going to save it, u can do replace(formText,"%0D",vbcrlf) etc ...

3) use "POST" instead. (u will still have to play around with CR/LF etc, flash uses only CR for newline, asp(windows) cr/lf combine.)

have a try and see :)

cheers
0
 

Author Comment

by:Rob101
ID: 8059357
Hi all

Thanks for your time..

Here is how I have it set up.

I have 2 asp pages. Each with a flash form. I’m trying to send the contents of one input box to another without loosing the formatting.

henryww -  I’ve tried replacing the line breaks with the code below and no luck.

<%= Replace(Request.Form("TextInfo"), "vbCrLf", "%0D") %>

is that about right? I’ve had no luck replacing any line breaks so far but I think I must be close. I’m getting the %20 spaces, but still no line breaks.

My first flash form is named TextInfo and submits with post.

My second flash form has the code below add to it.

 <embed src="../images/PrintTextBox.swf?textInfo=<%= Replace(Request.Form("TextInfo"), "vbCrLf", "%0D") %>" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="576" height="756">
    </embed>

I have a Dynamic Text Box on my second page with a Variable Name called Text Info.

Doh. Little hair left to pull out!

Any other suggestions?

Thanks in advance all!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:henryww
ID: 8059462
<%= Replace(Request.Form("TextInfo"), "vbCrLf", "%0D") %>
u got this the wrong way round!!??
the correct syntas should be

replace(request.form("TextInfo"),"%0D",vbcrlf)
vbcrlf - NO QUOTE, it is built-in for cr/lf

BUT ... since u are passing it again back to another swf...
using querystring like xxx.swf?.... here u don't have to replace the %0D ...

well, i still don't know why u have to use 2 asp & 2 swf for the confirmation, but i suppose there must be a reason u have to do it that way....

now ... can u get the text in the second flash ...?
since i don't haven't seen ur code and don't know what exactly it looks like, so it is a bit hard to guess what it goes wrong...

is there a link to the files??

0
 
LVL 6

Expert Comment

by:henryww
ID: 8059535
u can also do a very simple test here
txt = unescape("This+is+line1%0Dand+this+is+line2");
have a dynamic text box set the variable to txt
and u will get 2 lines ...

<.... >
<PARAM NAME=movie VALUE="Untitled-1.swf?txt=This+is+line1%0Dand+this+is+line2">  
<... >
<EMBED src="Untitled-1.swf?txt=This+is+line1%0Dand+this+is+line2" ....>
<... >

i just did that exact same thing to a swf with a dynamic text box variable is txt ... and it works fine ... got 2 lines

a few steps to debug

1)in page2.asp check the post from the 1st asp page1.asp
make sure u get the correct result ...
if u escape the text before it is post that's ok, u can also escape the text within asp using server.URLEncode("string") ... response.write it somewhere u can see...

2)check the "Dynamic Text Box on YOUR second page " and see if it has multiline on

3)can u see the textinfo on ur second swf??? without newline??

post more code or give me a link to the files :)

cheers
0
 
LVL 6

Expert Comment

by:henryww
ID: 8059550
remember u don't have to replace the "%0D" the way u are passing variables ... u don't have to replace anything ... it is the correct format ... :)

just in case i didn't explain it well ...
0
 

Author Comment

by:Rob101
ID: 8059896
Wow, thanks for all your help. It helps HUGE.

After doing a few tests from your above code, I can see that my original form is SENDING plain characters. No %20, or + chars.

I put the “This+is+line1%0Dand+this+is+line2” and it worked. Kewl! (thanks)

But how can I encode the form contents leaving my first form? I can see that
“Big Bad Dog” goes to “BigBadDog” as soon as I submit it. Hmm I’m trying not to get confused here but it might be too late. Been trying to many things. But everything you suggested makes total sense.

How is it I am getting this wrong? One flash form submits to another!??
The characters that are passed to the second page have no formatting (BigBadDog) so the server.URLEncode("string") won’t work.

I must have a problem(?)  On my first form. I’ll go look again.

Thanks again for your help and time.
0
 
LVL 6

Expert Comment

by:henryww
ID: 8060070
in ur 1st file / 1st flash

say u have the same textinfo to send to page2

then u will do

textinfo = escape(textinfo);

before sending the data ...

but i still don't know why u want 2 flash ... just to confirm?

no there is nothing with with 2 flash 2 forms 2 asp page, is just that if the sole purpose of the 2 swf if to let user confirm what they had entered ... why don't you just have an extra frame for the confirmation ... merget the 2 flash together, have 1 asp only ... ok ...

// frame X
where u have the from, and all the input boxes
stop(); here
a button to "sumbit" or "confirm" etc the goto the X+N frame

//frame X+N (n frames later .. not sure what u want to do in between ...)
then here u display all the information again, change the input boxes to dynamic text boxex only so user can't change here ... then have a button for them to go back to change in frame X (on(release) gotoAndPlay(X);

another button to do the actually submit ...

so to save u from posting from form1 to from2 and back & forth ... user also don't need to re-enter everything, it is already there. they only need to change what they need to change ...

... .. .. ..

maybe u do have a peculiar reason for that .. i am not sure ...

0
 

Author Comment

by:Rob101
ID: 8061066
Wow, thanks for all your help. It helps HUGE.

After doing a few tests from your above code, I can see that my original form is SENDING plain characters. No %20, or + chars.

I put the “This+is+line1%0Dand+this+is+line2” and it worked. Kewl! (thanks)

But how can I encode the form contents leaving my first form? I can see that
“Big Bad Dog” goes to “BigBadDog” as soon as I submit it. Hmm I’m trying not to get confused here but it might be too late. Been trying to many things. But everything you suggested makes total sense.

How is it I am getting this wrong? One flash form submits to another!??
The characters that are passed to the second page have no formatting (BigBadDog) so the server.URLEncode("string") won’t work.

I must have a problem(?)  On my first form. I’ll go look again.

Thanks again for your help and time.
0
 
LVL 6

Accepted Solution

by:
henryww earned 400 total points
ID: 8073379
got it all working yet?
0
 

Author Comment

by:Rob101
ID: 8101142
wow. what a long time that took me. And i like to think of myself as a knowledgeable coder. Ouch. I’ve formatted content from databases, text files etc, but never with that much trouble. I followed your tips on the replace method and new I was close. Then I tried..

  <%
  comm=request.querystring("Tbox")
  comm=replace(comm,CHR(13),"%0D")
  %>

and it worked! The CHR(13) is what worked here. Why? Don’t know. (well I do know why it worked, just don’t understand why your code did not) Doh.

You totally helped. Thanks for your ideas and suggestions. Without them I would not have gotten it going. Cheers to you dude!

peace!

Rob101
0
 
LVL 6

Expert Comment

by:henryww
ID: 8101274
chr(13) = vbcr

hmmm ... that's interesting ... i would like to see ur source too and to see why it wouldn't work with the original script.... interesting ....

it shouldn't be a very hard problem... but u never know as it turned out....

thanks & cheers
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

770 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