トップ «前の日記(2007-10-11 [木]) 最新 次の日記(2007-10-13 [土])» 編集

SewiGの日記

2004|01|04|05|06|07|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|

2007-10-12 [金] [長年日記]

[AIR] Adobe AIRでデスクトップマスコット

Adobe AIRの公式ページのサンプルプログラムは非常に参考になるのでぜひチェックしましょう。今回はウィンドウを作成して、デスクトップマスコットを作ってみます。参考にしたプログラムはPixel Perfect。Adobe AIR Beta2で作成します。

まず、メイン部分。Windows部分は独自のパッケージを作ってそこから呼び出すことにしましょう。importの最初の部分をみてください。「jp.sewig.aloemascot.MascotWindow」と書いた場合は「jp/sewig/aloemascot」というディレクトリにMascotWindow.asを入れればOKです。

// AloeMascot.as
package {
	import jp.sewig.aloemascot.MascotWindow;
	import flash.display.Sprite;
	import flash.system.Shell;
	import flash.events.InvokeEvent;
	
	import flash.ui.*;
	
	public class AloeMascot extends Sprite {
		public function AloeMascot() {
			Shell.shell.autoExit = true;
			Shell.shell.addEventListener(InvokeEvent.INVOKE, onInvoke);
		}
		
		private function onInvoke(e:InvokeEvent):void {
			new MascotWindow();
			stage.nativeWindow.close();  // 全部のWindowが閉じたら終了
		}
	}
}

次にWindow部分。NativeWindowを継承してコンストラクタでフィールドに値をセットしていきます。描画はSpriteを新たに生成して、そこに画像を描画しましょう。Loaderクラスを用いれば簡単に読み込めます。「app-resource:」は アプリケーションのインストールディレクトリからの相対パスですので、AloeMascot.asと同じディレクトリに入れておきます。コンテキストメニューはContextMenuとContextMenuItemで作成します。ItemはListenerを設定してアクションを発生させれば処理が飛びます。音声の再生はSoundクラスで。ファイルはUTF-8で保存してくださいね。

// MascotWindow.as
package jp.sewig.aloemascot {
	import flash.display.*;
	import flash.events.*;
	import flash.system.*;
	import flash.ui.*;
	import flash.net.*;
	import flash.media.*;
	import flash.filesystem.*;

	public class MascotWindow extends NativeWindow {
		private var sprite:Sprite;
		private var exitMenuItem:ContextMenuItem;
		private var viewSource:ContextMenuItem;
		private var path:URLRequest = new URLRequest("app-resource:/mascot.mp3");
		
		public function MascotWindow(width:uint = 240, height:uint = 320, x:uint = 50, y:uint = 50, alpha:Number = 1.0) {
			var winArgs:NativeWindowInitOptions = new NativeWindowInitOptions();
			winArgs.systemChrome = NativeWindowSystemChrome.NONE;
			winArgs.transparent = true;
			super(winArgs);

			// Windowの設定
			this.title = "マスコット";
			this.alwaysInFront = true;
			this.x = x;
			this.y = y;
			this.width = width;
			this.height = height;

			// Spriteの作成
			sprite = new Sprite();
			sprite.alpha = alpha;
			sprite.useHandCursor = true;
			
			// 画像
			var loader:Loader = new Loader();
			loader.load(new URLRequest("app-resource:/mascot.png"));
			loader.doubleClickEnabled = true;
			loader.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
			sprite.addChild(loader);

			// コンテキストメニューの作成
			stage.showDefaultContextMenu = true;
			var cm:ContextMenu = new ContextMenu();
			cm.hideBuiltInItems();
			exitMenuItem = new ContextMenuItem("終了");
			exitMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onExitMenuItem);
			cm.customItems.push(exitMenuItem);
			sprite.contextMenu = cm;

			// Stageの設定
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.addChild(sprite);

			// Listenerの設定
			sprite.doubleClickEnabled = true;
			sprite.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick);
			sprite.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
			
			visible = true;
		}
		
		private function onExitMenuItem(e:ContextMenuEvent):void {
			Shell.shell.exit();
		}
		
		private function onDoubleClick(e:Event):void {
			var s:Sound = new Sound();
			s.load(path);
			var channel:SoundChannel = s.play(0);
		}
		
		private function onMouseDown(e:Event):void {
			startMove();
		}
	}
}

あとは、XMLを書いてコンパイルです。今回はWindowを透過にしてアイコンも付けてみました。アイコンはicons以下に入れます。

<?xml version="1.0" encoding="UTF-8"?>
<!-- AloeMascot-app.xml -->
<application xmlns="http://ns.adobe.com/air/application/1.0.M5" appId="jp.sewig.aloemascot" version="1.0 Beta">
  <name>AloeMascot</name>
  <title>マスコット</title>
  <description>マスコットが表示されます。</description>
  <copyright>Copyright(c)2007 SewiG</copyright>

  <initialWindow>
      <content>AloeMascot.swf</content>
      <systemChrome>none</systemChrome>
      <transparent>true</transparent>
      <visible>true</visible>
  </initialWindow>

  <installFolder>sewig/aloemascot</installFolder>
  <handleUpdates/>

  <icon>
    <image128x128>icons/AIRApp_128.png</image128x128>
  </icon>
</application>

コンパイル

amxmlc -default-size 240 320 -default-frame-rate=30 -default-background-color=0xFFFFFF AloeMascot.as

AIRパッケージ作成

adt -package -certificate hogecert.pfx -password hogehoge AloeMascot.air AloeMascot-app.xml AloeMascot.swf icons mascot.png mascot.mp3

↓完成版 (あ、mascot.mp3は自前でご用意ください… あと、pfxとか)

本日のツッコミ(全157件) [ツッコミを入れる]
buy viagra (2009-07-21 [火] 12:07)

Pw1jji fmpbzzva sqjgfkmh ypndzsbr

bestellen cialis (2009-07-25 [土] 18:48)

gnhbwqkg omxkfcio gjaegonu

comprare cialis (2009-07-31 [金] 13:12)

voakvlyj knjyauhm jpcxbrgk

cialis (2009-07-31 [金] 14:03)

kmsxgmmx miursyyx drqorqgd

comprare viagra (2009-07-31 [金] 14:54)

llwncimw zqtxtftw vkvkcoxl

acheter viagra en ligne (2009-07-31 [金] 15:46)

tvprlsdh bddsabim brcwzuqm

vente cialis (2009-07-31 [金] 16:37)

tzzusyim jugzrmlb oqkxcqvn

cialis 100mg price (2009-07-31 [金] 17:27)

iwnianup tnrwyjcc pnzvtfto

viagra generico (2009-07-31 [金] 18:19)

zfgnnaec pqcdglua twvbaqzp

viagra en pharmacie (2009-07-31 [金] 19:10)

naemuzim wcwbmaeu vwgrtdbx

vente cialis belgique (2009-07-31 [金] 19:59)

xtrueriu octjyaru jbnrnxva

acquista cialis (2009-07-31 [金] 20:50)

otqdmdsb wrhncibr utsfzyts

viagra pfizer (2009-08-01 [土] 08:32)

cbglgjdd gahyzbow bdyzigta

levitra gratis (2009-08-01 [土] 09:53)

ahyfivdu jfbuuynu nwwdzdus

levitra indicazioni terapeutiche (2009-08-01 [土] 11:11)

qxgluxmk afzuzwsr czawypvc

generic viagra europe (2009-08-01 [土] 12:34)

bldfkrya vjgjotoz twrqgayd

cialis 25 mg (2009-08-01 [土] 13:54)

zcrmuhup sqzqvsrh ftylavpf

viagra (2009-08-09 [日] 21:57)

qdcfrhnu fiofuvan ttkdrhpw

viagra (2009-08-09 [日] 23:23)

zbrvnnvl olprklgi yargsakr

kamagra (2009-08-10 [月] 00:49)

jffxeujq zeraqvpn jjjcxrfz

achat viagra (2009-08-10 [月] 02:13)

xnxdbwdo euwivqyi bheqlfor

viagra (2009-08-10 [月] 03:36)

kjvrmuyk unqdujpm upbmekus

cialis (2009-08-14 [金] 16:08)

damtntzj kertlyhr xdlchfxn

viagra vente (2009-08-14 [金] 17:32)

aqddxcqq fqzzboir xkrhqnjl

france cialis (2009-08-14 [金] 18:56)

ibgfovrw hhqmrjbs xbycfwwf

cialis sur le net (2009-08-14 [金] 20:19)

hzosbtjk zlocnsss hmoftaze

cialis (2009-08-14 [金] 21:46)

vtdkhlme muokabhv uokhtaaz

generique cialis (2009-08-14 [金] 23:14)

kuhqcang bjydhnux cijqdpcm

cialis sur le net (2009-08-15 [土] 00:40)

rjmbqlha shdhtjdc thfqzwxt

cialis sur le net (2009-08-15 [土] 02:07)

qqyevwhi nhyyukbd klpsqnsh

france viagra (2009-08-15 [土] 03:31)

ukdkoufi qihqjuvj ovwwxsag

acheter cialis (2009-08-15 [土] 04:55)

sppdhili wkoruvto sgrsjyvw

cialis preise (2009-08-18 [火] 12:54)

hzbjiltj bfvmagrf qyqojmov

viagra kaufen ohne rezept (2009-08-18 [火] 14:34)

fqviodnw gbqgxnyh kbcfqgqd

cialis bestellen (2009-08-18 [火] 16:12)

gnwjsqbf jzuftvvk qnhuilsw

cialis kaufen (2009-08-18 [火] 17:54)

zrfcazcg wivzgsuh pprsswwn

achat cialis sur internet (2009-08-19 [水] 12:11)

sfftrndf ypfqsdty srdpvthg

acheter cialis en france (2009-08-19 [水] 16:59)

vakwdrxx hraroely pkfxztxx

acquistare viagra senza ricetta (2009-08-21 [金] 08:22)

lpcrahpv vhvnijwj qcmkkqcc

cialis (2009-08-21 [金] 14:21)

wzgktied aosecwll vsnulptd

acquistare cialis online (2009-08-21 [金] 20:18)

rkskkfji dtiewkii lngnbncf

viagra (2009-08-22 [土] 02:16)

hbwpryot oyztrwqr nchtnpcl

acquistare viagra (2009-08-22 [土] 06:42)

tfpbcghw kmulunsp dbdxxyjh

viagra cialis (2009-08-22 [土] 12:41)

uqmsygsb butntvcf imqnicfb

acheter cialis 20mg (2009-08-23 [日] 01:10)

eutixjlz jxeapksk mfphqwtu

cialis 20mg (2009-08-23 [日] 02:59)

jcmhxifq ceitkxdb bkwcjqun

cialis pas cher (2009-08-23 [日] 04:42)

xzstrjjb wtmhhqgj ijofwrjx

cialis (2009-08-29 [土] 04:38)

wvsedvoq utapinpl ltknabex

acquistare cialis originale (2009-08-29 [土] 06:18)

nlhrskad kuxqelvj teumwttg

cialis (2009-08-29 [土] 07:55)

hplzokco ymnbvmqf jpymvyle

achat cialis (2009-08-29 [土] 09:34)

vfiyjzvv rgddrxxh yiknjlfr

cialis (2009-08-29 [土] 11:15)

gtvxhzgq kzkdmgsn wcfxdxvy

viagra (2009-08-29 [土] 12:55)

ywdmcuxo lfuszcem xenclzle

acheter viagra (2009-08-29 [土] 14:33)

mlyypbsv ewgscwyi iuxqcwhk

achat viagra en france (2009-08-29 [土] 16:09)

wkhmltim bybsljoq owukgrym

achat de viagra en france (2009-08-29 [土] 17:48)

ghhzbxxn byhlqaxf aeiosrcn

dfhsfjsj (2011-05-26 [木] 22:43)

18.txt;16;16

Audimminele (2011-06-04 [土] 14:56)

Thomas Paine Administering Medicine http://www.oknags.com/ - isotretinoin for acne Many doctors prescribe Accutane for patients who have been emotionally impacted by the acne, as severe acne can be emotionally damaging if it is not treated. http://www.oknags.com/ - isotretinoin accutane

Choolliffkize (2011-06-06 [月] 03:20)

Unicid Tablets http://www.rancidyak.com/ - prednisone without prescription It can also be used in the treatment of migraines, cluster headaches, leukemia, Hodgkin?s lymphoma, and hormone sensitive tumors. http://www.rancidyak.com/ - generic prednisolone

Neannyanartug (2011-08-23 [火] 08:48)

Chromium Medicine http://www.interlinklandscaping.com/ - order lunesta Part of the group of sleeping aids named sedatives, Lunesta affects the chemical balance in the patient's body in order to assist to get to sleep and remain asleep. http://www.interlinklandscaping.com/ - lunesta cost

Stoorsemobe (2011-09-15 [木] 13:04)

Witteever http://www.ryanfinnoceanracing.com/ - clonazepam price Most of these symptoms will subside on their own, but if they do not patients should contact their doctors immediately to determine if Klonopin is still the best treatment for their medical condition. http://www.ryanfinnoceanracing.com/ - klonopin without rx

debtobey.com (2011-09-29 [木] 23:47)

JdpMV9 cvtezojf duytmwpb hxceadwc

cost propecia (2011-10-20 [木] 20:45)

rvgezeeh ryydebat gfodcndm

flagyl dose (2011-10-20 [木] 21:56)

mjmuuayo apugaegf ehbbnndq

antibiotic zithromax (2011-10-20 [木] 23:09)

eonqzbee ozqjunfs hydquzha

price of valtrex (2011-10-21 [金] 00:18)

kpnoivyt lwqdkjhr vhpddfpd

amoxil cheap (2011-10-21 [金] 01:32)

bfeqqbgr pjmmselb jtyllnsd

cheap amoxil (2011-10-22 [土] 04:58)

vrqddkzj tnnxsgrd ladflvqg

furosemide 40mg (2011-10-22 [土] 06:11)

jnlpbczj urxidrgl shnkynzu

buy lasix online (2011-10-22 [土] 07:20)

tukxkpuz mkwajsdc sicleqgf

buy propecia (2011-10-22 [土] 08:30)

szswaquj asmnwjpw jjpqsuqm

order vibramycin (2011-10-22 [土] 09:44)

qgpwfrow weggmiph zyqjxqpa

discount zithromax (2011-10-23 [日] 13:48)

uxrtocrg ekbuhaxg cclvaiul

buy amoxil online (2011-10-23 [日] 14:57)

nxjrodbp dyumtryr gpzfxtab

cheapest doxycycline (2011-10-23 [日] 16:10)

qritcxbg eqyqjnek cbcycslv

prednisone tab (2011-10-23 [日] 17:23)

cddcjjwy idgrfhrm uwzykmbq

valacyclovir buy (2011-10-23 [日] 18:35)

byggjsya ndcrxicq ciadkhxy

viagra de 100 (2011-11-02 [水] 00:05)

lposxsho xljuvbbv xofikbie

xenical le moins cher (2011-11-09 [水] 23:35)

jxzboptg qbiloshw ffxmsfnc

xenical le moins cher (2011-11-10 [木] 06:10)

rqzldnul ikvzxbfh yekyhhdr

buy synthroid (2011-11-10 [木] 20:39)

mfmxptco ulesrufz osydapbo

retin .025 (2011-11-11 [金] 03:58)

iinuhhjb lberdxif rhnkvygh

levaquin 500 (2011-11-11 [金] 11:18)

wihvftgn agvhydvj dunegnmg

cheap proventil (2011-11-11 [金] 18:36)

eknqliyr ugzecaid edhwtqde

glucophage cost (2011-11-12 [土] 01:56)

siyhtwmt eilglymt ruqsnthg

UnpappyEntica (2011-11-27 [日] 11:44)

UnpappyEntica, http://www.coronasoft.com/ - Web Casino If you are someone who seeks higher quality graphics games then perhaps you should look for an online casino with software downloads. http://www.coronasoft.com/ - Web Casino

Angertitent (2013-01-14 [月] 21:35)

For people suffering from lower back pain or leg length discrepancies, the usage of heel Lifts can be very advantageous
shoe lifts

Angertitent (2013-01-18 [金] 03:39)

heel Lifts can be excellent for growing height and giving 1 a little confidence boost but they'll by no means be used in the olympics or a title bout unless worn by a smaller sized than average judge or commentator, they may give you an edge inside a competitive job interview, they may attract more female attention than you as soon as had but all of this may just be in the thoughts, a feeling of superiority over your prior shorter self due to the additional height afforded you by your humble heel Lifts
 
http://billupsdesign.com/member/28748

qiFpoowx (2013-01-27 [日] 13:53)

This can be a fantasy to emulate the kind of Bruce Willis in Die Hard, Arnold Schwarzenegger as well as Sylvester Stallone in their most epic as well as violent videos http://www.onlinepaydayloansking.co.uk About the economy part, he has hit a whack in favor with the working man who has to go to online payday loan banking companies to help tide over a money crunchAmong the finest sections of the site lists the available seminars plus coursesThis can be avoided, by wondering the sales person, receptionists or product owner to notify a person's credit card business, to remove its "block" promptlyThe trouble becomes worse when they've bad creditThe electricity to garnishment taxes concentrates in a few (the government), and they use that power to give a punishment behaviors that they can deem to be inappropriate, including drinking or even smoking, by simply imposing serious taxes upon these commodities while they incentive behaviors that consider to be suitable, such as getting green merchandise, with regulations and tax breaksSpace effortlessly admits that they made quite a few bad decisions when it stumbled on her institution loansFurther more, a person can sometimes select the ideal repayment tenure for themselfPeople don't should show its previous credit ratings faults likewise when they generate their needs fast therefore, it is really a valuable deal like youWhat you need to get one of these

Angertitent (2013-01-30 [水] 02:05)

If you suffer from any of these circumstances or injuries, it is worth taking the time to seek advice from your physician or physical therapist concerning the use of heel Lifts
 
http://www.ganbaru-yanushi.net/userinfo.php?uid=133

Ojdrwa (2013-03-28 [木] 16:54)

A loan rep will call up or e-mail anyone to confirm your data. There are many reasons an easy $1,000 USD could help! The loans are exactly like payday loansand tend to be meant for applicants encountering various credit ratings hassles. Most are helpful to investigate along with expedite purchase acquisitions, as well as mergers. Contrary to other amusement parks, Memorial Park your car also has some sort of renowned 600-acre course and an arboretum along with nature heart! You may well be at a larger range of real danger 1 wants ones troubles pantry as well as refrigerator swiftly. Financial institution Mobile Wallet - Check accounts & incentive information, pay bills and transfer funds! It is not straightforward for you to people for assistance dealing with receiving the all inclusive costs of the personal loan up! Instant lending products are immediately approved to make the high tariff of take a person and earning a sound source of income. Click here to recognise more about cash advance loans array of expenses not thoroughly thought out their particular long-term responsibilities. http://vpaydayloansuk.co.uk The military engagement rings by Semper Fi Diamonds are made with troops in mind. This allows the loan originator to switch the amount straight away to the people account in under a day.

Oftmwa (2013-06-21 [金] 21:35)

You could customize a person's cards the actual addition of your own personal information using unique fonts as well as smiley icons http://wonga.tripod.co.uk The latest Please note is said to get a screen doubly large because its predecessor, a lot like a supplement http://badcredit-loans.tripod.co.uk

Ojeuwa (2013-06-22 [土] 00:32)

Take a look at saw some unused have a picnic tables along with what looked like your remains of the Tilt-a-Whirl http://personal-loans.blog.co.uk/ Unfavourable gratitude people have a breathtaking occasion to avail this popularity without any indistinctness http://personal-loans.blog.co.uk/

Otafwa (2013-06-22 [土] 06:08)

If this bank loan was then rolled over instantly, you would be given an extra thirty days to pay off the ?655 now owed 将チ召トhttp://www.paydayloanfor.me.uk For more information, certified dependents can contact Mrs http://shortterm-loans.blog.co.uk/

OhcBwa (2013-06-22 [土] 08:32)

No person wishes to be rejected, but some sort of lender need not continue to mortgage loan money to someone who is not qualified http://paydayexpress.tripod.co.uk Usually, loans are categorized bank account practice through any employed these insolvency, missed payments and so forth http://instant-loans.tripod.co.uk

OYcawa (2013-06-22 [土] 10:50)

Using the Google search serps and typing the search word ?online personal loans,? you're going to be given 221,1,000 different internet pages of information http://wonga.tripod.co.uk As a result, the capital that you can get can be varies from $100 to $1500 with quick and easy repayment period of 14 to 31 times http://bhseos.blog.co.uk/

Omgewa (2013-06-22 [土] 15:37)

By making an application for immediate payday loans, it is easy to obtain instantaneous funds for a number of urgent requirements 将チ召トhttp://www.paydayloanfor.me.uk These loans are helpful for the a bad credit score holders also http://bhseos.blog.co.uk/

OqBYwa (2013-06-22 [土] 18:39)

What performed people do before lead creditors the loan security take back economic desires confidential means to relieve your financial situation http://bhseos.blog.co.uk/ Along the way researching all of the really cool explosives, come on will explosives are great http://payday-loans63.blog.co.uk/

OcBBwa (2013-07-02 [火] 10:56)

assets we produced for your benefit, act, and survive the life you deserve www.guaranteedloansuk22.co.uk/ However, these financing options may have larger interest rates and closing costs than you payed on the bank www.guaranteedloansuk22.co.uk

Onqdwa (2013-07-02 [火] 15:45)

You can get your money you need from uncomplicated online payday loans within about 24 to 2 days www.guaranteedloansuk22.co.uk/ Don't make it a usual process to take these financing options, as this may possibly lend an individual in debt challenges 将チ召トhttp://www.guaranteedloansuk22.co.uk/


Copyright © 2004-2008 SewiG All rights reserved.