Communation between ASP.Net and Flash CS5

ek0

New Member
here is my situation, I have a page called (WebForm1.aspx) and I embedded a flash object called (Untitled-3.swf) in the page using the code: \[code\]<embed height= "500px" type="application/x-shockwave-flash" width="500px" src="http://stackoverflow.com/questions/Untitled-3.swf" fullscreen="no"></embed> \[/code\]and I had a button in this flash object that will send a variable to the ASP.NET page using this ActionScript-3 in the flash file : \[code\]btn.addEventListener(MouseEvent.MOUSE_DOWN,senddata);function senddata(e:MouseEvent){var scriptRequest:URLRequest = new URLRequest("../WebForm1.aspx");var scriptLoader:URLLoader = new URLLoader();var scriptVars:URLVariables = new URLVariables();scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);scriptVars.var1 = "one";scriptRequest.method = URLRequestMethod.POST;scriptRequest.data = http://stackoverflow.com/questions/8685664/scriptVars;scriptLoader.load(scriptRequest);function handleLoadSuccessful($evt:Event):void{ txt.text="sent"; trace("Message sent.");}function handleLoadError($evt:IOErrorEvent):void{ txt.text="failed"; trace("Message failed.")}}\[/code\]I got this code from searching in the internet, anyway, and then I used the asp.net page and requested the variable which is (var1) and I put that in the Page_Load which is : \[code\] public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.Form["var1"] != null) { TextBox1.Text = Request.Form["var1"]; } } }\[/code\]However, the problem is the everything is going very good and the variable is been passing successfully and when I put a BreakPoint in:\[code\] TextBox1.Text = Request.Form["var1"];\[/code\]in the debugging mode it shows me that the TextBox1.text = "one" , but it does not appear in my page ! please help me with this problem excuse my poor English best Regards, Hassan
 
Top