Skip to content

Commit

Permalink
Initial commit. Just. Fooling. Around.
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Mar 27, 2009
0 parents commit e82b264
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
*/.DS_Store
*.log
certificate.pfx
Bouncy.swf
Bouncy.air
84 changes: 84 additions & 0 deletions Bouncy.mxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
title="Bouncy"
creationComplete="initializeApplication()">

<mx:Script>
<![CDATA[
import flash.utils.*
import flash.media.*;
import flash.desktop.DockIcon;
import flash.desktop.NativeApplication;
import flash.display.NativeWindow;
import mx.controls.Alert;
/* Alert */
public var myAlert:Alert;
/* Sound */
[Embed(source="assets/sounds/Cartoon Boing.mp3")]
[Bindable]
public var sndCls:Class;
public var snd:Sound = new sndCls() as Sound;
private function initializeApplication():void
{
}
private function start():void
{
var intervalId:uint = setTimeout(displayNotification, delay.value*1000);
}
private function displayNotification():void
{
playSound();
bounceDockIcon();
displayAlert();
}
private function playSound():void
{
this.snd.play();
}
private function bounceDockIcon():void
{
if (NativeApplication.supportsDockIcon) {
var dockIcon:DockIcon = NativeApplication.nativeApplication.icon as DockIcon;
dockIcon.bounce(NotificationType.CRITICAL);
}
}
private function displayAlert():void
{
myAlert = Alert.show(message.text, "Notification after " + delay.value + " seconds", Alert.OK)
myAlert.height = 115;
myAlert.width = 200;
}
]]>
</mx:Script>

<mx:Style source="style.css" />

<mx:VBox width="100%" height="100%" verticalAlign="middle" horizontalAlign="center" verticalGap="0">

<mx:Text width="100%" text="Bouncy" styleName="header" />

<mx:Form width="100%">

<mx:FormItem label="Notify after (seconds)">
<mx:NumericStepper id="delay" value="2" stepSize="1" maximum="10"/>
</mx:FormItem>

<mx:FormItem label="Notification Message:" width="100%">
<mx:TextInput id="message" width="100%"/>
</mx:FormItem>

</mx:Form>

<mx:HBox>
<mx:Button id="bouncer" label="Set notification" click="start()"/>
</mx:HBox>

</mx:VBox>

</mx:WindowedApplication>
26 changes: 26 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'rubygems'
require 'rake'
require 'highline'

@ui = HighLine.new

task :default => 'build'

desc "Build and preview the application"
task :build do
system "amxmlc Bouncy.mxml && adl application.xml"
end

desc "Package the application"
task :package do
password = @ui.ask('Password:')
system "adt -package -storetype pkcs12 -keystore certificate.pfx -storepass #{password} Bouncy.air application.xml ."
end

desc "Generate certificate for the application"
namespace :certificate do
task :generate do
password = @ui.ask('Password:')
system "adt -certificate -cn SelfSigned 1024-RSA certificate.pfx #{password}"
end
end
25 changes: 25 additions & 0 deletions application.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
<id>Bouncy</id>
<version>0.1</version>
<filename>Bouncy</filename>
<description>Just. Fooling. Around</description>
<copyright>Copyright (c) 2006 Example Co.</copyright>

<initialWindow>
<content>Bouncy.swf</content>
<visible>true</visible>
<systemChrome>none</systemChrome>
<transparent>true</transparent>
<width>400</width>
<height>200</height>
</initialWindow>

<icon>
<image16x16>assets/icons/AIRApp_16.png</image16x16>
<image32x32>assets/icons/AIRApp_32.png</image32x32>
<image48x48>assets/icons/AIRApp_48.png</image48x48>
<image128x128>assets/icons/AIRApp_128.png</image128x128>
</icon>

</application>
Binary file added assets/icons/AIRApp_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/AIRApp_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/AIRApp_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/AIRApp_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icons/error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sounds/Cartoon Boing.mp3
Binary file not shown.
8 changes: 8 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
WindowedApplication
{ background-color: "0x999999";
background-alpha: "0.9"; }

.header
{ color: #000;
fontSize: 22;
text-align: center; }

0 comments on commit e82b264

Please sign in to comment.