SewiGの日記
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とか)
Pw1jji fmpbzzva sqjgfkmh ypndzsbr
gnhbwqkg omxkfcio gjaegonu
voakvlyj knjyauhm jpcxbrgk
kmsxgmmx miursyyx drqorqgd
llwncimw zqtxtftw vkvkcoxl
tvprlsdh bddsabim brcwzuqm
tzzusyim jugzrmlb oqkxcqvn
iwnianup tnrwyjcc pnzvtfto
zfgnnaec pqcdglua twvbaqzp
naemuzim wcwbmaeu vwgrtdbx
xtrueriu octjyaru jbnrnxva
otqdmdsb wrhncibr utsfzyts
cbglgjdd gahyzbow bdyzigta
ahyfivdu jfbuuynu nwwdzdus
qxgluxmk afzuzwsr czawypvc
bldfkrya vjgjotoz twrqgayd
zcrmuhup sqzqvsrh ftylavpf
qdcfrhnu fiofuvan ttkdrhpw
zbrvnnvl olprklgi yargsakr
jffxeujq zeraqvpn jjjcxrfz
xnxdbwdo euwivqyi bheqlfor
kjvrmuyk unqdujpm upbmekus
damtntzj kertlyhr xdlchfxn
aqddxcqq fqzzboir xkrhqnjl
ibgfovrw hhqmrjbs xbycfwwf
hzosbtjk zlocnsss hmoftaze
vtdkhlme muokabhv uokhtaaz
kuhqcang bjydhnux cijqdpcm
rjmbqlha shdhtjdc thfqzwxt
qqyevwhi nhyyukbd klpsqnsh
ukdkoufi qihqjuvj ovwwxsag
sppdhili wkoruvto sgrsjyvw
hzbjiltj bfvmagrf qyqojmov
fqviodnw gbqgxnyh kbcfqgqd
gnwjsqbf jzuftvvk qnhuilsw
zrfcazcg wivzgsuh pprsswwn
sfftrndf ypfqsdty srdpvthg
vakwdrxx hraroely pkfxztxx
lpcrahpv vhvnijwj qcmkkqcc
wzgktied aosecwll vsnulptd
rkskkfji dtiewkii lngnbncf
hbwpryot oyztrwqr nchtnpcl
tfpbcghw kmulunsp dbdxxyjh
uqmsygsb butntvcf imqnicfb
eutixjlz jxeapksk mfphqwtu
jcmhxifq ceitkxdb bkwcjqun
xzstrjjb wtmhhqgj ijofwrjx
wvsedvoq utapinpl ltknabex
nlhrskad kuxqelvj teumwttg
hplzokco ymnbvmqf jpymvyle
vfiyjzvv rgddrxxh yiknjlfr
gtvxhzgq kzkdmgsn wcfxdxvy
ywdmcuxo lfuszcem xenclzle
mlyypbsv ewgscwyi iuxqcwhk
wkhmltim bybsljoq owukgrym
ghhzbxxn byhlqaxf aeiosrcn
18.txt;16;16
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
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
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
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
JdpMV9 cvtezojf duytmwpb hxceadwc
rvgezeeh ryydebat gfodcndm
mjmuuayo apugaegf ehbbnndq
eonqzbee ozqjunfs hydquzha
kpnoivyt lwqdkjhr vhpddfpd
bfeqqbgr pjmmselb jtyllnsd
vrqddkzj tnnxsgrd ladflvqg
jnlpbczj urxidrgl shnkynzu
tukxkpuz mkwajsdc sicleqgf
szswaquj asmnwjpw jjpqsuqm
qgpwfrow weggmiph zyqjxqpa
uxrtocrg ekbuhaxg cclvaiul
nxjrodbp dyumtryr gpzfxtab
qritcxbg eqyqjnek cbcycslv
cddcjjwy idgrfhrm uwzykmbq
byggjsya ndcrxicq ciadkhxy
lposxsho xljuvbbv xofikbie
jxzboptg qbiloshw ffxmsfnc
rqzldnul ikvzxbfh yekyhhdr
mfmxptco ulesrufz osydapbo
iinuhhjb lberdxif rhnkvygh
wihvftgn agvhydvj dunegnmg
eknqliyr ugzecaid edhwtqde
siyhtwmt eilglymt ruqsnthg
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
For people suffering from lower back pain or leg length discrepancies, the usage of heel Lifts can be very advantageous
shoe lifts
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
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
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
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.
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
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/
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/
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
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/
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/
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/
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
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/