Developers > Learning Center > Existing Widget Tutorail
Add wAPI code to your existing widget and publish into the yourminis widget platform:
Download wAPI, un-zip, and double-click the widget.mxp to launch the adobe extension manager.
If you don't have Flash CS3 or you are unable to install the .mxp for whatever reason, not to worry... You can still add the dynamic wAPI calls and compile your widget without this download. However, you will have to upload in order to test your widget.
This
panel allows you to click a button within the IDE to TEST your widget. Open up the
Widget Panel under Window -> Other Panels -> Widget Panel as shown:
You can move this panel and size it to your liking, and when you are ready, simply click the "LAUNCH" button to test out your widget locally before uploading to the yourminis widget platform.
Read
the wAPI Reference within the Flash Help Panel to get the details on the wAPI code
you'd like to add. You can also view the wAPI Reference online.
The yourminis.api.Widget class is the main class that provides an ActionScript 3.0 API to the yourminis Widget Platform. All wAPI widgets will have a "widget" variable of type yourminis.api.Widget automatically set before the onWidgetLoaded event within the top level DisplayObject.
You can add one or more wAPI calls to your existing widget code as you see fit. Here is a list of some common wAPI changes you may be interested in:
- Myspace URL clicks / tracking - If you are interested in enabling URL click tracking and supporting myspace URL clicks, replace any of your calls to "navigateToURL(URLRequest)" with "widget.navigateToURL( URLRequest, [[target=_blank], [track=true]])"
- RSS Caching - If you are already parsing RSS feeds and just want to leverage the yourminis RSS Cache, use the RSSLoader instead of a URLLoader.
- Background / Coloring - If you want to quickly enable the crisp looking, standard yourminis widget backgrounds with user configurable color picker, check out the widget.chrome property.
- Targeting - You may want to personalize the widget based on geolocation or other user information. Check out widget.reporting.getTrackingData()
- Custom tracking - You may want to start tracking and reporting on some custom user action such as video tag searches or foobar requests. If so, check out widget.reporting.trackCustom(...)
Code
Hints - If you forget the wAPI call, the automatic code-hints should help
you. All of the classes with the wAPI and instance properties of the Widget class
will display codehints within the Flash IDE as you add wAPI code.
If your widget variable name ends in *widget, the code-hints will be enabled for the object. All wAPI widgets will have a "widget" variable automatically set before the onWidgetLoaded event within the top level DisplayObject. If you want to use your own variable, be sure to assign your variable on the onWidgetLoaded event
Publish your widget: In this step, you will select a name, upload your .swf and thumbnail files, enter in details about your widget, then click publish. After you click "Publish", Click "Return to Previous Page" to get back to these instructions.
You can now see your widget in the dashboard. Use the dashboard to view reports and manage your widget configurations and access restrictions.
yourminis