Topic: using chumbyflashplayer.x to play a .swf and pass in variables?

Hi,

New to flash.. and to chumby hacking.. I'm interested in trying to get SWFGauges to work on the chumby. http://www.maani.us/gauge/index.php?menu=Introduction

Essentially it needs an xml file to be passed into it to direct it on rendering the right guages. If nothing is passed in the default gauge shows.

I've been able to get the default guage to show.. but not sure on how i can pass in the xml config it needs? Any assistance would be appreciated.


Here's some details if you'd like to copypasta into your chumby.


wget http://www.maani.us/gauge/gauge.zip
unzip guage.zip
chumbyflashplayer.x -i guage.swf

Re: using chumbyflashplayer.x to play a .swf and pass in variables?

Well, if you're launching it from the command line, you can pass in parameters to the Flash movie using the "-d" switch.  The paramaters become variables on the "_root" timeline.

For instance, if you do:

chumbyflashplayer.x -i mymovie.swf -dmyparam=abc

...then in Flash, you can access it as follows:

trace(_root.myparam); // should output "abc"

This how it works in AS1/AS2/AVM1 - for AS3/AVM2, the values end up in the "LoaderInfo" object.

If you turn your movie into a standard widget, then there's a different mechanism for passing in values.

Taking a quick look at the site you listed, you'd create a file (like "settings.xml") with your XML on some server somewhere, then pass the URL to that file as the value of the variable "xml_source", something like:

chumbyflashplayer.x -i mygauge.swf -dxml_source="http://www.example.com/settings.xml"

Re: using chumbyflashplayer.x to play a .swf and pass in variables?

Thanks so much - this is exactly what i was after smile yay! now to make the data stream dynamic smile