Change Button Colour When Press In Visual Studio C ASP Net and Flash Communication

You are searching about Change Button Colour When Press In Visual Studio C, today we will share with you article about Change Button Colour When Press In Visual Studio C was compiled and edited by our team from many sources on the internet. Hope this article on the topic Change Button Colour When Press In Visual Studio C is useful to you.

ASP Net and Flash Communication

In this article you will learn about Flash and ASP.NET development. I have recently created a website, which explains all the Flash to ASP.NET communication methods mentioned in this article, as well as a step-by-step introduction to ASP.NET and C# development using the cool Visual Studio.NET IDE and Adobe Flash CS.

Part 1

Open Adobe Flash CS. Create a new document by selecting Flash File (Action Script 2.0). You may be interested in Action Script 3 (AS3) but I prefer Action Script 2 (AS2) for easy understanding. Just walk with me and I guarantee you, you will be a great Flash developer after reading this article. Now you will see one tab which is ‘Untitled 1’ in Adobe Flash. When you save the ‘Untitled 1’ file it will be replaced with your favorite name. I named it ‘AspFlash.fla’. Remember FLA is a flash source file and the output movie will be SWF, which must be included in the ASP.Net ASPX file later.

Adobe Flash split into multiple windows, don’t get confused. You don’t need to know all the window features. Start with the one on the left called ‘Tools’, on the top middle window called ‘Timeline’, the next window down called ‘Scene’, the next window down called ‘Properties’ and the right window with more windows ‘Color’, ‘Combine. ‘, ‘Components’ and ‘Libraries’. Both windows can be toggled on/off with the ‘Window’ menu. Look at the ‘Scene’ window which will be your scene. From the “Properties” window you can change the colors and sizes according to your needs.

Part 2

Now add another component from the ‘Components’ window expand ‘User Interface’. Oh! many things. Drag one ‘TextInput’ and one ‘Button’ together on your ‘Scene’ screen and align them properly. Select ‘TextInput’ and enter the model name (for example TextInput1) from the ‘Properties’ window. Without an instance name, Action Script will not recognize any components. Do the same for the ‘Button’ instance name (eg SendData) and from ‘Parameters’ change the ‘Button’ icon (eg Send Data).

Part 3

Here we start the main coding part. Select ‘Layer 1’ in the ‘Timeline’ window and press F9 (keyboard). You will see the ‘Activities’ window, where you enter your AS code. Type or download the following codes.

SendData.onPress = function ()

//Declare and initialize the variable

var send_lv:LoadVars = new LoadVars();

//Providing a value to a parameter, such as an Asp.Net QueryString

send_lv.mydata = TextInput1.text;

//Sending data

send_lv.send(‘default.aspx’, ‘_self’, ‘GET’);

;

The LoadVars object is used to exchange data between the flash – server. The LoadVars object can send data to the server for processing, load data from the server, or send data to the server and wait for a response from the server in a single operation. The LoadVars object uses value-value pairs to exchange data between the client and server. The LoadVars object is best used in situations that require two-way communication between the Flash Movie and the server-side process, but do not require data to be passed.

The send method sends the variables in the send_lv object to the specified URL. This string is sent to the URL using the HTTP GET method, so that ASP.Net can easily read the mydata variable in the QueryString.

Section 4

Write or download the following codes to read QueryString in Flash – Action Script 2. In Action Script 2 there is no method like ASP.Net provides, so I wrote the following codes to get QueryString from URL. The _url method returns the URL of the ‘AspFlash.swf’ file that loaded the ASPX page.

//Reading QuarryString

myURL = this._url;

myPos = myURL.lastIndexOf(“?”);

if (myPos > 0) {

var myRawParam = myURL.substring(myPos + length(‘mydata=’) + 1, myURL.length);

myParam = myRawParam.toString().split(“‘”).join(“”);

if (myParam != undefined)

TextInput1.text = myParam;

Section 5

Save your file from the File menu. Now we need to create the final SWF and upload it to the ASPX page. From the File menu click ‘Print Settings’ and you will see a new window with three tabs (Formats, Flash and HTML). In the Formats tab check the Flash and HTML formats, so you can find the SWF code in the HTML page. Now click the ‘Publish’ button to make the final move. If there is no error, flash will give you two files (eg ‘AspFlash.swf’ and ‘AspFlash.HTML’) in the root folder where the ‘AspFlash.fla’ file is located.

Section 6

Now start Visual Studio.Net (VS) and create a new page and name it ‘AspFlash’. VS create a default page which is ‘Default.aspx’. From the solution explorer double click on the ‘Default.aspx’ file to view the Markup code (also called Inline code) as follows.

Now copy ‘AspFlash.swf’ and ‘AspFlash.HTML’ files into your root directory. I mean ASPX, SWF files should be in the same directory. Open the ‘AspFlash.HTML’ file and copy the entire ‘item’ tag and paste it inside the ‘Default.aspx’ file.

After you stop this code it changes a few parts of ‘AspFlash.swf’ like this. Look at the ‘AspFlash.swf?mydata=”’ line that we have added. Flash read _url data with mydata which will be provided by ASP.Net later.

Finally, add two ASP.net controls to the ‘Default.aspx’ page i.e. TextBox and Button. Change the button text to ‘Send Data’.

Section 7

In this step you need to open the ‘Default.cs’ file by clicking ‘View Code’ to point to ‘Default.aspx’ from VS’s Solution Explorer. By default VS is added on the Page_Load event. You need to add text on the Page_Load event event along with the button1_click event as follows.

protected void Page_Load(object sender, EventArgs e)

if (!IsPostBack)

if (Request[“mydata”]!= on)

textbox1.Text = Request[“mydata”].ToString();

protected void button1_Click(object sender, EventArgs e)

Response.Redirect(“~/default.aspx?mydata=” + textbox1.Text);

Section 8

Now create the page using F5 (keyboard key) and type in the Flash movie and click ‘Send Data’ to send the Flash data to the ASPX page. You will see the ASPX text ‘TextBox’ has been replaced with your Flash text ‘TextInput’.

Similarly type text in ASPX ‘TextBox’ and click ‘Send Data’ Button to send ASPX data to Flash movie. Enjoy the interface between ASP.Net and Flash. If you need further assistance, feel free to email me.

Video about Change Button Colour When Press In Visual Studio C

You can see more content about Change Button Colour When Press In Visual Studio C on our youtube channel: Click Here

Question about Change Button Colour When Press In Visual Studio C

If you have any questions about Change Button Colour When Press In Visual Studio C, please let us know, all your questions or suggestions will help us improve in the following articles!

The article Change Button Colour When Press In Visual Studio C was compiled by me and my team from many sources. If you find the article Change Button Colour When Press In Visual Studio C helpful to you, please support the team Like or Share!

Rate Articles Change Button Colour When Press In Visual Studio C

Rate: 4-5 stars
Ratings: 5479
Views: 88069206

Search keywords Change Button Colour When Press In Visual Studio C

Change Button Colour When Press In Visual Studio C
way Change Button Colour When Press In Visual Studio C
tutorial Change Button Colour When Press In Visual Studio C
Change Button Colour When Press In Visual Studio C free
#ASP #Net #Flash #Communication

Source: https://ezinearticles.com/?ASP-Net-and-Flash-Communication&id=3304920

Related Posts

default-image-feature

Change Button Colour When Press In Visual Studio The Game Audio Explosion – A Guide to Great Game Sound Part I: Pre-production and Sound Design

You are searching about Change Button Colour When Press In Visual Studio, today we will share with you article about Change Button Colour When Press In Visual…

default-image-feature

What To Say When Giving Two Weeks Notice In These Present Times How Worried Should We Be?

You are searching about What To Say When Giving Two Weeks Notice, today we will share with you article about What To Say When Giving Two Weeks…

default-image-feature

What To Say To A Family When Someone Dies The Soft Touch of Sorrow

You are searching about What To Say To A Family When Someone Dies, today we will share with you article about What To Say To A Family…

default-image-feature

Challenges When Applying Technology To Corporate Financial Management 5 Benefits of Financial Technology

You are searching about Challenges When Applying Technology To Corporate Financial Management, today we will share with you article about Challenges When Applying Technology To Corporate Financial…

default-image-feature

What To Know When Buying A Fixer Upper How I Got Started Investing in Fixer Uppers

You are searching about What To Know When Buying A Fixer Upper, today we will share with you article about What To Know When Buying A Fixer…

default-image-feature

Ch Of The Following Metrics Is Available When Site Search Top 3 Important E-Commerce Processes

You are searching about Ch Of The Following Metrics Is Available When Site Search, today we will share with you article about Ch Of The Following Metrics…