ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Who's good at Flash on here?



  Rav4
Relatively simple, but can't get my head around it, being a r****d.

I have a flash form which is using a .php file to send the email.

If that email has been send succesfully, I want it to inform Flash that it did a good job.

Here is my Function for sending the email and what I am trying to get working is handleLoadSuccesfull, but can't.

PHP:
 public function sendThisBloodyForm(event:Event)
        {
            var scriptRequest:URLRequest;
            var scriptLoader:URLLoader;
            var scriptVars:URLVariables;
            var handleLoadSuccessful:Function;
            var handleLoadError:Function;
            var event:* = event;
            handleLoadSuccessful = function (event:Event) : void
            {
                if (scriptLoader.data.ok)
                {
                    userfield.text = "Form sent!";
                }
                else
                {
                    userfield.text = "failed on server! ";
                }
                return;
            }// end function
            ;
            handleLoadError = function (event:IOErrorEvent) : void
            {
                resp.text = "failed! " + event;
                return;
            }// end function
            ;
            form_subm.mouseEnabled = false;
            scriptRequest = new URLRequest("http://domainamecom/send_email.php");
            scriptLoader = new URLLoader();
            scriptLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
            scriptVars = new URLVariables();
            scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
            scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
            scriptVars.form_1= 1.text;
            scriptVars.form_2= 2.text;
            scriptVars.form_3= 3.text;
            scriptVars.form_4= 4.text;
            scriptRequest.method = URLRequestMethod.POST;
            scriptRequest.data = scriptVars;
            scriptLoader.load(scriptRequest);
            return;
        }// end function
Obviously have taken other stuff out, but just can't get it working. Any thoughts?
 
  Clio Mk2 Phase 1
I hate seeing any flash on a website. Really don't like working with it.

Can't offer any help as of yet, but I'll keep looking around to see what I come up with.
 
  Rav4
I hate flash too, used to love it but don't anymore, nevertheless, the client wanted it like this, so he gets it like this.

Thanks,

G.

I hate seeing any flash on a website. Really don't like working with it.

Can't offer any help as of yet, but I'll keep looking around to see what I come up with.
 
  Clio Mk2 Phase 1
True. The website is tailored to a clients specification and not your own. This (however true it is) does not mean you can influence him to move to HTML / PHP / CSS / jQuery. Flash can be bitchy on different a different OS, Browser and even on Mobile Devices. It's not very cross platform friendly. Maybe you should tell him/her that you can re-create in PHP or the such and that it will please a wider audience.

There nothing I hate more than a flash object loading, NoScript ftw.
 
  Rav4
Certainly, however, when you have time restrictions and so on......

Anyhow, this semi works for the time being, once I have some spare time, I will rebuild it on jQuery, just need to work out how to implement the calculations on jQuery. As you have stated, all the problems are really obvious, nevertheless, the client knows best and that is what they will get.

Thanks for the info though.

True. The website is tailored to a clients specification and not your own. This (however true it is) does not mean you can influence him to move to HTML / PHP / CSS / jQuery. Flash can be bitchy on different a different OS, Browser and even on Mobile Devices. It's not very cross platform friendly. Maybe you should tell him/her that you can re-create in PHP or the such and that it will please a wider audience.

There nothing I hate more than a flash object loading, NoScript ftw.
 
  Bumder With A Buffer
Does this not do it??


var
scriptRequest:URLRequest = new URLRequest("http://domainamecom/send_email.php");
var
scriptLoader:URLLoader = new URLLoader();
var
scriptVars:URLVariables = new URLVariables();

scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);

scriptVars.var1 = "one";
scriptVars.var2 = "two";

scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;

scriptLoader.load(scriptRequest);

function
handleLoadSuccessful($evt:Event):void
{
trace("Message sent.");
}

function handleLoadError($evt:IOErrorEvent):void

{

trace
("Message failed.");
}




http://www.actionscript.org/forums/showthread.php3?p=927880
 
There nothing I hate more than a flash object loading, NoScript ftw.
+1

I hate seeing flash for 2 reasons. 1) It won't work on the iPhone/iPad. 2) It won't load with NoScript on the PC.

Still, the client knows best :boring:
 
  Rav4
This is pissing me off now, well annoying.

Will have to redo this later on down the line, don't like it.

How would you guys implement this, what framework would you use?
 


Top