Difference between revisions of "FlashDevelop/Example"

From Chumby Wiki
Jump to: navigation, search
(Test your program on your Chumby)
 
(4 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
== Prerequisites ==
 
== Prerequisites ==
  
* FlashDevelop Installed on your computer
+
* [http://www.flashdevelop.org FlashDevelop] Installed on your computer
 
* A Chumby, with SSH enabled
 
* A Chumby, with SSH enabled
 
* A Thumbdrive
 
* A Thumbdrive
Line 37: Line 37:
 
  }
 
  }
  
== Test your program ==
+
== Test your program in FlashDevelop ==
  
 
Click on Project->Test Movie (or F5)
 
Click on Project->Test Movie (or F5)
Line 43: Line 43:
 
A new page will open with your Hello World program running.  Note the "Hello World.swf" tab.  You have just created your first swf file!
 
A new page will open with your Hello World program running.  Note the "Hello World.swf" tab.  You have just created your first swf file!
  
== Move your program to your chumby ==
+
== Move your program to your Chumby ==
  
 
* Copy the Hello World.swf file from your project directory to your flash drive, root directory
 
* Copy the Hello World.swf file from your project directory to your flash drive, root directory
Line 54: Line 54:
 
  chumby:~#
 
  chumby:~#
  
* Stop the current chumby flash player
+
== Test your program on your Chumby ==
 +
 
 +
* Stop the current Chumby flash player
  
 
  chumby:~# stop_control_panel
 
  chumby:~# stop_control_panel
Line 72: Line 74:
 
* Confirm your program is running on your chumby!
 
* Confirm your program is running on your chumby!
 
* Use ctrl-C to exit the player.  
 
* Use ctrl-C to exit the player.  
* Restart your Chumby to restore to normal operations
+
* Restart your Chumby to restore to normal operations OR to restart Chumby flashplayer:-
 +
  chumby:~# start_control_panel
  
  
 
Congratulations, you have successfully run your own Chumby Widget.
 
Congratulations, you have successfully run your own Chumby Widget.
 +
 +
=== Alternative Testing on your Chumby ===
 +
 +
You may find using the profile.xml file easier than the above method. 
 +
 +
See: [[Chumby_tricks#Mixing_local_widgets_into_a_channel]]

Latest revision as of 14:58, 2 May 2008

This is an example How-To for creating a "Hello World" widget to run on your Chumby.

The intent is to show a start to end process for getting your own program to run on your Chumby.

Currently being authored by Kayakpete

Prerequisites

  • FlashDevelop Installed on your computer
  • A Chumby, with SSH enabled
  • A Thumbdrive

Create a New Project

Create a new Project in FlashDevelop:

  • Start FlashDevelop.
  • Click Project -> New Project
  • Select ActionScript 2 - Default Project.
  • Give this project a name "Hello World", and check the "create directory for project" check box.

This will give you a Project pane on the right side, with a classes and library folder.

Write your program

  • Open the Main.as file, located in the classes folder, on in the right pane.
  • Write the Hello world program as follows:


class Main
{
	public static function main():Void
	{       
		_root.createTextField("t",2,20,20,100,30);
		_root.t.text = "Hello, world!";     
	}
}

Test your program in FlashDevelop

Click on Project->Test Movie (or F5)

A new page will open with your Hello World program running. Note the "Hello World.swf" tab. You have just created your first swf file!

Move your program to your Chumby

  • Copy the Hello World.swf file from your project directory to your flash drive, root directory
  • Plug your thumb drive into your chumby
  • Open a SSH session to your chumby
  • Confirm your program is visible:
chumby:~# ls /mnt/usb
Hello World.swf
chumby:~#

Test your program on your Chumby

  • Stop the current Chumby flash player
chumby:~# stop_control_panel
*** stoping services
*** stopping control panel
*** killing registered flashplayer pid: 2237
chumby:~#
  • Run your program
chumby:~# chumbyflashplayer.x -i /mnt/usb/Hello\ World.swf
Adobe FlashLite 3.0.2 Release (Version 8,1,52,0)- Chumby Industries (version 6 build 45-396 [GCC 4.1.2   Microcross GNU  X-Tools(tm)])
Features:  Video ALSA
Build time: Tue 30Oct2007 1658


  • Confirm your program is running on your chumby!
  • Use ctrl-C to exit the player.
  • Restart your Chumby to restore to normal operations OR to restart Chumby flashplayer:-
 chumby:~# start_control_panel


Congratulations, you have successfully run your own Chumby Widget.

Alternative Testing on your Chumby

You may find using the profile.xml file easier than the above method.

See: Chumby_tricks#Mixing_local_widgets_into_a_channel