-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit. Just. Fooling. Around.
- Loading branch information
0 parents
commit e82b264
Showing
11 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } |