Talk:Sample Banner Widget

From Chumby Wiki
Revision as of 12:37, 23 January 2008 by Wansti (Talk | contribs)

Jump to: navigation, search

A few notes on configuring a widget that may explain the process a little better:

  • for each Chumby widget there can be an associated configuration widget
  • the configuration widget is a Flash movie (but it could, in theory, just be an Ajax app)
  • the configuration widget doesn't have to be a FlashLite movie (or limited to Flash 7) as long as the user has the right Flash plugin installed
  • the configuration widget receives a "pointer" to a widget profile (configuration file) for each user using the Chumby widget
  • the widget profile is an XML file that can be read and rewritten by the configuration widget
  • the basic format of the widget profile is the following:
 <widget_instance id="...">
   <widget_parameters>
     <widget_parameter>
       <name>parameter name</name>
       <value>parameter value</name>
     </widget_parameter>     
   </widget_parameters>
 <widget_instance>
  • the configuration widget should "read" the widget profile from the configuration url at _root._chumby_instance_url, parse the returned XML, accept some user input for the configuration parameters, rewrite the XML file and post back to the configuration URL.
  • note that it's ok to create a new XML file that only contains the configuration parameters (without the extra XML)
  • also note that after POSTing the new XML configuration the server returns a copy of the "old" configuration (so you cannot use the returned values to populate the configuration dialog with the new configuration)
  • as noted before the configuration widget does not have to be a FlashLite/Flash 6/Flash 7 application since it runs on the user computer. With the new facilities of Flash 9/Flex (e4x) it's much easier to write configuration widgets using the new techniques. Creating configuration widgets using OpenLazlo it's probably also easier than creating them in the standard Flash authoring tool.

actionscript source?

Could someone post the relevant actionscript from the example for those of use who are using other tools? (e.g. MTASC) --Risacher 19:30, 18 December 2007 (PST)

I've almost got a working Configuration Widget completely developed with MTASC and swfmill. There are still some bugs and things I don't understand (I'm new to Flash) but I can already use it to change my main widget's settings. I'll post the source code as soon as it is fully operational. --Wansti