Developers > FLEX Learning Center > Hello World Tutorial
Welcome to the obligatory "Hello, World!" tutorial. In this lesson, you will learn to build the most simple of widgets using the wAPI. Once you have completed this and the subsequent tutorials, you'll be well on your way to becoming a veritable widget master!
The first step in this tutorial is to open create a new flex mxml file for your widget. You can use your favorite text editor or Flex IDE.
This will be the main application for the widget
In this step, you will add <mx:Application ... initialize="onLoad()" ... and initialize access to the widget container runtime. Create a <mx:Script> tag and add a function onLoad() as below.
The main difference with using Flex and the yourminis wAPI is that the initialize="onLoad()" event handler needs to be added to your flex application.
Minimal Widget API Flex code:
Add the following mxml for the helloworld label:
Add the following code to the onLoad event handler:
myLabel.text = "Hello, World!";
The resulting code should look like this:
Congratulations! You've created your first flex widget using the wAPI.
Check out the rest of our API documentation and tutorials including building a RSS Flex Widget. Everything else with the AS3 wAPI applies to flex widgets except for the points noted above.
yourminis