I put the example code in a package, custom and tried to create an
object, but I get this message:
1131: Classes must not be nested. NavigateToUrl/custom
NavigateToURLExample.as line 10 1190745321328 1289
What am I doing wrong ? code is below.
package custom
{
public class NavigateToURLExample
{
import flash.display.Sprite;
import flash.net.navigateToURL;
import flash.net.URLRequest;
import flash.net.URLVariables;
public class NavigateToURLExample extends Sprite {
public function NavigateToURLExample() {
var url:String = "http://www.adobe.com";
var variables:URLVariables = new URLVariables();
variables.exampleSessionId = new Date().getTime();
variables.exampleUserLabel = "Your Name";
var request:URLRequest = new URLRequest(url);
request.data = variables;
try {
navigateToURL(request);
}
catch (e:Error) {
// handle error here
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import custom.NavigateToURLExample;
var myurl:NavigateToURLExample=new NavigateToURLExample();
]]>
</mx:Script>
</mx:Application>
Muzak wrote:
>
> look up navigateToURL() in the docs.
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED] <mailto:info1%40reenie.org>>
> To: <[email protected] <mailto:flexcoders%40yahoogroups.com>>
> Sent: Tuesday, September 25, 2007 2:30 AM
> Subject: [flexcoders] simple form post
>
> > How do I go about doing this:
> >
> > I have form in a flex application
> > I hit the submit button
> > The form is posted to a PHP page.
> > I can access the form variables on that PHP page.
> >
> > I heve been looking for an example for weeks, but I don't see any. They
> > all post to a php page, then whatever is printed on the PHP page shows
> > up in flex. I don't want that. I want to actually end up on the the PHP
> > page.
> > Please if you know of any examples, provide me with a link.
> > Thank you.
> >
>
>