Re: [Flashcoders] Flash and ASP/MSSQL
Amanda Kuek wrote: Thanks James. It's a good idea, but I think for this project I'll go with the "Javascript sets hidden form fields" idea. But thanks for adding this idea to my spongey brain! Yeah I like the JavaScript method too. One thing you might might to do is have a message for people who have JavaScript disabled. Something like This form requires the use of JavaScript. Please make sure you are using a browser that supports JavaScript and has it turned on. JOR ___ === James O'Reilly === === SynergyMedia, Inc. === www.synergymedia.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Thanks a heap Dominic and Richard! You're right - that flash demo at http://www.cybergrain.com/tech/demos/flashhtml/ was of extremely great use. It's always nice to do something for the first time in Flash, that you didn't think was possible. Cheers again. On 01/11/05, Dominic Fee <[EMAIL PROTECTED]> wrote: > Hi Amanda > > This link may be of great use: > > Cheers > Dom > > http://www.cybergrain.com/tech/demos/flashhtml/ On 31/10/05, Richard <[EMAIL PROTECTED]> wrote: > Hi Amanda > > There's a reasonably simple javascript solution for you. > > Javascript > > > Add a hidden textfield to your form named XYlocation > > > In Flash swf > // > var xStyle_fmt = new TextFormat(); > xStyle_fmt.font = "_sans"; > xStyle_fmt.bold = true; > xStyle_fmt.size = 16; > //-- > this.onMouseDown = function() { > this.createEmptyMovieClip("x_mc", ); > with (this.x_mc) { > this.createTextField("x_txt", 1200, _parent._xmouse-10, > _parent._ymouse-10, 20, 20); > //_xmouse-10 and _ymouse-10 places the centre of the > text X at the mouse arrow point > this.x_txt.setNewTextFormat(_parent.xStyle_fmt); > this.x_txt.text = "X"; > this.x_txt.textColor = 0xFF; > } > }; > this.onMouseUp = function() { > var XYpos = "X=" + this._xmouse + " Y+" + this._ymouse; > trace("XY+" + XYpos); > getURL("javascript:setFormText(XYpos)") > }; > //-- > > > > HTH > > Richard ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Thanks James. It's a good idea, but I think for this project I'll go with the "Javascript sets hidden form fields" idea. But thanks for adding this idea to my spongey brain! On 31/10/05, JOR <[EMAIL PROTECTED]> wrote: > > I wouldn't hit the server until the location was considered final by the > user. Maybe have a "lock hole" or "finalize hole" button in the flash > movie that triggers the POST. It wouldn't work to put the POST on > something like a mouseMove event and I'd be hesitant about using mouseUp > either for the exact reason you mention. You don't want the user to > keep hitting the server over and over for nothing. > > The advantage to using the session object would be for two different ASP > pages... A) The one your Flash movie POSTs to behind the scenes and B) > the one your HTML form POSTs to when the form is complete. In order for > the two ASP pages to share data you need to store the X and Y locations > somewhere they both can access. Session seemed like a logical place but > you have other options like a database or even cookies. It's up to you > what makes the most sense for your needs. > > JOR > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Flash and ASP/MSSQL
Hi Amanda This link may be of great use: Cheers Dom http://www.cybergrain.com/tech/demos/flashhtml/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Amanda Kuek Sent: 30 October 2005 04:39 To: Flashcoders mailing list Subject: [Flashcoders] Flash and ASP/MSSQL Hello everyone, This is a question about Flash in an ASP form which communicates with an MSSQL db. I'm not really sure how to phrase the question, so I'm afraid that I'll just have to explain the story. Imagine an ASP page about faulty garments. Let's just say that if you had a hole in your T-shirt, you could visit this page to report it. The page would have normal HTML fields for name and email, and it would also have a SWF with a picture of a T-shirt. The disgruntled hole-y user clicks on the T-shirt to leave an X representing where the hole is. The form information (including that of the hole location, in the SWF) is then submitted using a normal HTML submit button and stored in the MSSQL db. I spose my question is, is this scenario possible? Is it only possible to store user-submitted information (in this case, the X,Y coordinates of the hole) by clicking on a "Send" button WITHIN flash, or is there another way? I'd like to avoid making a user explicitly submit the SWF information AS WELL AS the form information. Any ideas and comments much appreciated, Thanks muchly, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Flash and ASP/MSSQL
Hi Amanda There's a reasonably simple javascript solution for you. Javascript Add a hidden textfield to your form named XYlocation In Flash swf // var xStyle_fmt = new TextFormat(); xStyle_fmt.font = "_sans"; xStyle_fmt.bold = true; xStyle_fmt.size = 16; //-- this.onMouseDown = function() { this.createEmptyMovieClip("x_mc", ); with (this.x_mc) { this.createTextField("x_txt", 1200, _parent._xmouse-10, _parent._ymouse-10, 20, 20); //_xmouse-10 and _ymouse-10 places the centre of the text X at the mouse arrow point this.x_txt.setNewTextFormat(_parent.xStyle_fmt); this.x_txt.text = "X"; this.x_txt.textColor = 0xFF; } }; this.onMouseUp = function() { var XYpos = "X=" + this._xmouse + " Y+" + this._ymouse; trace("XY+" + XYpos); getURL("javascript:setFormText(XYpos)") }; //-- HTH Richard ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Amanda Kuek wrote: Hello there, On 31/10/05, JOR <[EMAIL PROTECTED]> wrote: Well, since you're using ASP you can take advantage of the Session object by storing the input from the flash movie in a session until the user submits the form. [snip] This is certainly an idea that hadn't crossed my mind. Is there any advantage to using the Session object? My only concern is that the user would constantly be hitting the ASP server whenever they position/reposition the marker (the marker for which the X,Y coordinates are stored). Thanks, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders I wouldn't hit the server until the location was considered final by the user. Maybe have a "lock hole" or "finalize hole" button in the flash movie that triggers the POST. It wouldn't work to put the POST on something like a mouseMove event and I'd be hesitant about using mouseUp either for the exact reason you mention. You don't want the user to keep hitting the server over and over for nothing. The advantage to using the session object would be for two different ASP pages... A) The one your Flash movie POSTs to behind the scenes and B) the one your HTML form POSTs to when the form is complete. In order for the two ASP pages to share data you need to store the X and Y locations somewhere they both can access. Session seemed like a logical place but you have other options like a database or even cookies. It's up to you what makes the most sense for your needs. JOR ___ === James O'Reilly === === SynergyMedia, Inc. === www.synergymedia.net ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Hello there, On 31/10/05, JOR <[EMAIL PROTECTED]> wrote: > Well, since you're using ASP you can take advantage of the Session > object by storing the input from the flash movie in a session until the > user submits the form. [snip] This is certainly an idea that hadn't crossed my mind. Is there any advantage to using the Session object? My only concern is that the user would constantly be hitting the ASP server whenever they position/reposition the marker (the marker for which the X,Y coordinates are stored). Thanks, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Well, since you're using ASP you can take advantage of the Session object by storing the input from the flash movie in a session until the user submits the form. In your Flash movie you would POST your X,Y variables to an ASP script which in turn stores them as Session("X") and Session("Y") or however else you would like to name them. The ASP then returns to Flash a response so that Flash knows the data was retrieved ok and can display some sort of success response. I typically just do a Response.Write("OK") or "NOTOK" or in more complex scripts an actual error code. Then on the HTML side your form submits it's data to your form handling ASP script as normal and the ASP uses the Session("X") and Session("Y") as normal. If the session vars are empty you could return the user back to the form with a form incomplete message. Or if everything is ok, processing the form, empty the session vars. JOR ___ === James O'Reilly === === SynergyMedia, Inc. === www.synergymedia.net Amanda Kuek wrote: Hello everyone, This is a question about Flash in an ASP form which communicates with an MSSQL db. I'm not really sure how to phrase the question, so I'm afraid that I'll just have to explain the story. Imagine an ASP page about faulty garments. Let's just say that if you had a hole in your T-shirt, you could visit this page to report it. The page would have normal HTML fields for name and email, and it would also have a SWF with a picture of a T-shirt. The disgruntled hole-y user clicks on the T-shirt to leave an X representing where the hole is. The form information (including that of the hole location, in the SWF) is then submitted using a normal HTML submit button and stored in the MSSQL db. I spose my question is, is this scenario possible? Is it only possible to store user-submitted information (in this case, the X,Y coordinates of the hole) by clicking on a "Send" button WITHIN flash, or is there another way? I'd like to avoid making a user explicitly submit the SWF information AS WELL AS the form information. Any ideas and comments much appreciated, Thanks muchly, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
On 31/10/05, Mick Gow <[EMAIL PROTECTED]> wrote: > Have you thought about not using flash? You could create an imagemap (even > though they're old hat) with about 15 pre-defined regions over an image (I'm > guess that's as accurate as you need it). Clicking a region could run a > javascript function that tells the form what region it is an submits it. > I have suggested imagemaps actually, seeing as I'll essentially be creating an imagemap in Flash. Unfortunately, in this project, 'tis not for me to question why...Thanks for the suggestion though! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Thanks very much everyone. Not only has it been explained very well, but I am now also armed with that highest of argument-stopping qualifications: "People on Flashcoders said so!" Cheers all! On 31/10/05, Benjamin Herholz | [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: [snip] > - you have a html form with a flash movie embedded. > > - the html form calls a server side script to submit the data of the > form to a database. > > - the html form can only send variables which are in its scope. > > - as you have a flash movie embedded in your form you have to make the > variables of the flash movie available to the html form. > > -to do so, you have to send the the variables in the flash movie to the > html form, or as Michael Bedar said: "You would need to call a > javascript function from AS when the user clicks the inside swf and set > the value of a hidden form field". > > - you call a javascipt function from a flash movie like: > getURL("javascript:processFlashData(" + xVal + "," + yVal + ")"); > > - the js function needs to write the variables into hidden fiels in the > html form. > > one more thing: > "I've always thought you used loadVariables to call an (in my > experience) ASP or PHP page that talked to the database." > thats true, but you dont want to send the variables from the flash movie > to the db, you want the html form to do that... > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
"Sure Flash can talk straight to a database! All you need to do is set the connection string or something!" -> shure it can not, it needs a server side language of your choice to do so. to clear things up. - you have a html form with a flash movie embedded. - the html form calls a server side script to submit the data of the form to a database. - the html form can only send variables which are in its scope. - as you have a flash movie embedded in your form you have to make the variables of the flash movie available to the html form. -to do so, you have to send the the variables in the flash movie to the html form, or as Michael Bedar said: "You would need to call a javascript function from AS when the user clicks the inside swf and set the value of a hidden form field". - you call a javascipt function from a flash movie like: getURL("javascript:processFlashData(" + xVal + "," + yVal + ")"); - the js function needs to write the variables into hidden fiels in the html form. one more thing: "I've always thought you used loadVariables to call an (in my experience) ASP or PHP page that talked to the database." thats true, but you dont want to send the variables from the flash movie to the db, you want the html form to do that... gr, ~ Benjamin Herholz | Code www.dawn2.com Hamburg - Copenhagen m: +49 (0) 160 96670732 ~ Amanda Kuek wrote: On 30/10/05, Michael Bedar <[EMAIL PROTECTED]> wrote: You would need to call a javascript function from AS when the user clicks the inside swf and set the value of a hidden form field.. then the user can click the HTML send button and send everything. Thank you very much. I haven't done this before, but from some quick googling, I assume that one would use something like fscommand or getURL? The person who gave me the brief said something along the lines of "Sure Flash can talk straight to a database! All you need to do is set the connection string or something!" I hitherto hadn't realised this was possible - I've always thought you used loadVariables to call an (in my experience) ASP or PHP page that talked to the database. Can anyone clear this one up for me please? Thanks very much, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
Have you thought about not using flash? You could create an imagemap (even though they're old hat) with about 15 pre-defined regions over an image (I'm guess that's as accurate as you need it). Clicking a region could run a javascript function that tells the form what region it is an submits it. On 10/30/05, Martin Wood <[EMAIL PROTECTED]> wrote: > > > The person who gave me the brief said something along the lines of "Sure > > Flash can talk straight to a database! All you need to do is set the > > connection string or something!" I hitherto hadn't realised this was > > possible - I've always thought you used loadVariables to call an (in my > > experience) ASP or PHP page that talked to the database. Can anyone > clear > > this one up for me please? > > Im pretty sure that unless someone has done some magic ive not heard of, > you will need to use some kind of middle layer to talk to the database. > > thanks, > > Martin > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
The person who gave me the brief said something along the lines of "Sure Flash can talk straight to a database! All you need to do is set the connection string or something!" I hitherto hadn't realised this was possible - I've always thought you used loadVariables to call an (in my experience) ASP or PHP page that talked to the database. Can anyone clear this one up for me please? Im pretty sure that unless someone has done some magic ive not heard of, you will need to use some kind of middle layer to talk to the database. thanks, Martin ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
On 30/10/05, Pascal FODOR <[EMAIL PROTECTED]> wrote: > > [snip] The whole thing would just be handled by flash. [/snip] > > Alas, unfortunately I don't have the option of having the whole form done in flash - but thanks for the suggestion! ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
On 30/10/05, Michael Bedar <[EMAIL PROTECTED]> wrote: > > You would need to call a javascript function from AS when the user > clicks the inside swf and set the value of a hidden form field.. then > the user can click the HTML send button and send everything. > > Thank you very much. I haven't done this before, but from some quick googling, I assume that one would use something like fscommand or getURL? The person who gave me the brief said something along the lines of "Sure Flash can talk straight to a database! All you need to do is set the connection string or something!" I hitherto hadn't realised this was possible - I've always thought you used loadVariables to call an (in my experience) ASP or PHP page that talked to the database. Can anyone clear this one up for me please? Thanks very much, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
You could just do a flash form that sends the values of your flash input fields through a LoadVars object along WITH the value of a X,Y coordinate corresponding to where some "hole-y" MC was drag above a T-shirt MC. The whole thing would just be handled by flash. On 30/10/05 6:49, "Michael Bedar" <[EMAIL PROTECTED]> wrote: > You would need to call a javascript function from AS when the user > clicks the inside swf and set the value of a hidden form field.. then > the user can click the HTML send button and send everything. > > > > > On Oct 30, 2005, at 12:38 AM, Amanda Kuek wrote: > >> Hello everyone, >> >> This is a question about Flash in an ASP form which communicates >> with an >> MSSQL db. I'm not really sure how to phrase the question, so I'm >> afraid that >> I'll just have to explain the story. >> >> Imagine an ASP page about faulty garments. Let's just say that if >> you had a >> hole in your T-shirt, you could visit this page to report it. The >> page would >> have normal HTML fields for name and email, and it would also have >> a SWF >> with a picture of a T-shirt. The disgruntled hole-y user clicks on the >> T-shirt to leave an X representing where the hole is. The form >> information >> (including that of the hole location, in the SWF) is then submitted >> using a >> normal HTML submit button and stored in the MSSQL db. >> >> I spose my question is, is this scenario possible? Is it only >> possible to >> store user-submitted information (in this case, the X,Y coordinates >> of the >> hole) by clicking on a "Send" button WITHIN flash, or is there >> another way? >> I'd like to avoid making a user explicitly submit the SWF >> information AS >> WELL AS the form information. >> >> Any ideas and comments much appreciated, >> >> Thanks muchly, >> >> Amanda. >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > __ Pascal FODOR http://www.flashavplayers.com __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Flash and ASP/MSSQL
You would need to call a javascript function from AS when the user clicks the inside swf and set the value of a hidden form field.. then the user can click the HTML send button and send everything. On Oct 30, 2005, at 12:38 AM, Amanda Kuek wrote: Hello everyone, This is a question about Flash in an ASP form which communicates with an MSSQL db. I'm not really sure how to phrase the question, so I'm afraid that I'll just have to explain the story. Imagine an ASP page about faulty garments. Let's just say that if you had a hole in your T-shirt, you could visit this page to report it. The page would have normal HTML fields for name and email, and it would also have a SWF with a picture of a T-shirt. The disgruntled hole-y user clicks on the T-shirt to leave an X representing where the hole is. The form information (including that of the hole location, in the SWF) is then submitted using a normal HTML submit button and stored in the MSSQL db. I spose my question is, is this scenario possible? Is it only possible to store user-submitted information (in this case, the X,Y coordinates of the hole) by clicking on a "Send" button WITHIN flash, or is there another way? I'd like to avoid making a user explicitly submit the SWF information AS WELL AS the form information. Any ideas and comments much appreciated, Thanks muchly, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Flash and ASP/MSSQL
Hello everyone, This is a question about Flash in an ASP form which communicates with an MSSQL db. I'm not really sure how to phrase the question, so I'm afraid that I'll just have to explain the story. Imagine an ASP page about faulty garments. Let's just say that if you had a hole in your T-shirt, you could visit this page to report it. The page would have normal HTML fields for name and email, and it would also have a SWF with a picture of a T-shirt. The disgruntled hole-y user clicks on the T-shirt to leave an X representing where the hole is. The form information (including that of the hole location, in the SWF) is then submitted using a normal HTML submit button and stored in the MSSQL db. I spose my question is, is this scenario possible? Is it only possible to store user-submitted information (in this case, the X,Y coordinates of the hole) by clicking on a "Send" button WITHIN flash, or is there another way? I'd like to avoid making a user explicitly submit the SWF information AS WELL AS the form information. Any ideas and comments much appreciated, Thanks muchly, Amanda. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders