Learn how to create your own web browser by using the HTML component in AIR.
The HTML component displays full HTML content within your AIR applications. In this tutorial we are going to build our own web browser with an adress bar and forward and back history controls.
1. To get started, create a new Air project named WebBrowser that will also create an mxml file named WebBrowser.mxml. Open it so we can begin to add our code and set the layout of the WindowedApplication to vertical.
2. Insert the following code between the WindowedApplication tags :
<mx:ApplicationControlBar dock="true" fillAlphas="[1.0, 1.0]"
fillColors="[#0E0847, #FFFFFF]">
<mx:Label text="AIR WEB BROWSER" fontWeight="bold"
fontSize="12" color="#990000"/>
<mx:Label text="Enter URL:"/>
<mx:TextInput id="urlInput"/>
<mx:Button label="GO"()" />
<mx:Spacer width="100%"/>
<mx:Button label="Back" />
<mx:Button label="Forward"/>
</mx:ApplicationControlBar>
<mx:HTML id="browser" height="100%" width="100%"/>
This is the base of our code. We have just added the controls and the HTML component.
3. Let’s add the functions. To…
4325 readers
1294 readers
444 readersBelow code shows you how to set cursor position at the end of a TextInput control in Flex 4. import mx.events.FlexEvent; // Flex 4 private function creationComplete(event:FlexEvent):void { textInput.selectRange(textInput.text.length, textInput.text.length + 1); textInput.setFocus(); }
276 readersThere are times were you need to take an FXG (Flash XML Graphic) from Photoshop, Illustrator or Flash Catalyst and load it during runtime. FXG is usually handled by the MXMLC which turns the declarative language into ActionScript code. The utility class will do just that and convert the text string into ActionScript
1433 readers
701 readersThere are cases where you need to find out position and measurements for Flex Spark Label component. There are many cases where you will find the code useful, such in case you need to calculate the width of a text string in pixels during runtime. Take a look at the following code snippet: var label:Label
18131 readers
453 readersI came across a question in an interview the other day about event propagation and I thought it would be a good topic to blog about. Most of the time you never need to know the details of event propagation in Flex. Is all you normally do is setup your event listener either inline on
971 readers
41 readersIn this Quick Tip, I will show you how to create a basic search application featuring the Google search engine. Final Result Preview Let’s take a look at the final result we will be working towards: Step 1: Brief Overview Using a TextField and some Events, we’ll send the search terms to Google and display
8,013
Subscribe to RSS headline updates from:
GurusUnleashed
Powered by FeedBurner
Curious what others are searching for? Below are the most popular search terms over the last 30 days.

