Help with Debugging Widgets
Want to make sure that your widget will work correctly once you’ve developed it, and avoid common pitfalls before you begin development? This is the right place.
If you are familiar with Flash development, Launchpad Standard is essentially a sophisticated SWF (the container) that loads in your SWF from the URL location you specify in the console. As such, special attention must be made as you develop your SWF to make sure it will work correctly as a widget. This means you should familiarize yourself with the Clearspring widget development best practices document, and make sure you know that your SWF will be loaded into another SWF and design with that in mind.
What are the most notable impacts? In Action Script 2 (AS2), _level0 will be Launchpad Standard container and where the API services, such as menu.show, are available. When developing with AS2 you should reference _root instead of _level0. This concept also exists in Action Script 3 (AS3) with stage and root (note the lowercase and no leading underscore). In AS3 you should reference root rather then stage.
Similarly, you should strive to ensure that the scope of your objects would be consistent when your SWF is contained within another SWF and that absolute URLs are used, rather then relative URLs.
Below is a simple tool that emulates the Launchpad Standard container by wrapping your SWF. Specify the URL location in the form field below and play around with the newly ‘wrapped’ SWF!
Debug Container
Frequently Asked Questions
Issue Description: I built my own widget, and it is exhibiting odd behavior ONLY when inside the Launchpad Standard container. Symptoms: Some graphics cease to load, buttons don’t work, movie clips are not formatting properly.
Synopsis: This is most likely a scoping issue and your objects are not referenced properly when your SWF is contained within another SWF.
Solution:
If your SWF is written in Action Script 3:
Ensure that you are referencing root instead of stage, since stage is the absolute reference and your SWFwill relinquish that control once it is contained with another SWF.
If your SWF is written in Action Script 2:
Reference _root instead of _level0. These are the equivalent of the AS3 references. In general, when you are using the Launchpad Standard container, your SWF is loaded into another SWF (the container), which has the APIs such as showing the menu, or tracking custom events.
Issue Description: My Widget does not render correctly once wrapped in your container. I am expecting some content to load, from an XML file, to populate my widget.
Symptoms: XML feeds are not loading correctly.
Synopsis:
The XML feed containing content is not being read which maybe due to the URL of the XML file being relative and not absolute
Solution: In your Action Script, reference links and resource as absolute URLs, for example: “http://www.clearspring.com/myfeed.xml”, instead of relative URLs, for example: “/myfeed.xml”. If you are using relative URLs these URLs will be based from clearspring.com, because the widget is contained, and not the absolute location of the XML file.
Issue Description: I have an Action Script 3 (AS3) widget where tabbing and the scroll components do not work only when inside the Launchpad Standard AS3 container.
Synopsis:There are known issues with scroll components with the Launchpad Standard container.
Solution:The Launchpad Standard AS3 container is a hybrid of AS2 and AS3. The UI was built with AS2 MX components, which introduce known issues with scroll components, because they are treated as different entities than the AS3 container itself. At this time we suggest that you design your AS3 widget around this limitation by using Up/Down arrows instead of scrollbars. A future release of the AS3 container will be a pure AS3 container that will eliminate these issues.